Changeset 3264087
- Timestamp:
- 03/30/2025 01:02:50 PM (9 months ago)
- Location:
- default-featured-image
- Files:
-
- 8 added
- 4 deleted
- 6 edited
- 1 copied
-
tags/1.8.1 (copied) (copied from default-featured-image/trunk)
-
tags/1.8.1/.wordpress-org (deleted)
-
tags/1.8.1/app/class-dfi.php (modified) (3 diffs)
-
tags/1.8.1/dfi.php (added)
-
tags/1.8.1/languages/default-featured-image.pot (added)
-
tags/1.8.1/readme.txt (modified) (2 diffs)
-
tags/1.8.1/set-default-featured-image.js (deleted)
-
tags/1.8.1/set-default-featured-image.php (modified) (2 diffs)
-
tags/1.8.1/src (added)
-
tags/1.8.1/src/dfi-admin.js (added)
-
trunk/.wordpress-org (deleted)
-
trunk/app/class-dfi.php (modified) (3 diffs)
-
trunk/dfi.php (added)
-
trunk/languages/default-featured-image.pot (added)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/set-default-featured-image.js (deleted)
-
trunk/set-default-featured-image.php (modified) (2 diffs)
-
trunk/src (added)
-
trunk/src/dfi-admin.js (added)
Legend:
- Unmodified
- Added
- Removed
-
default-featured-image/tags/1.8.1/app/class-dfi.php
r3219198 r3264087 11 11 * @var self 12 12 */ 13 protected static $inst = null;13 protected static $inst; 14 14 15 15 /** … … 196 196 public function admin_scripts() { 197 197 wp_enqueue_media(); // scripts used for uploader. 198 wp_enqueue_script( 'dfi-script', DFI_URL . 's et-default-featured-image.js', array(), DFI_VERSION, true );198 wp_enqueue_script( 'dfi-script', DFI_URL . 'src/dfi-admin.js', array(), DFI_VERSION, true ); 199 199 wp_localize_script( 200 200 'dfi-script', … … 217 217 $output = '<div id="preview-image" style="float:left; padding: 0 5px 0 0;">'; 218 218 $output .= wp_get_attachment_image( $image_id, array( 80, 60 ), true ); 219 $output .= '</div>'; 220 221 return $output; 219 220 return $output . '</div>'; 222 221 } 223 222 -
default-featured-image/tags/1.8.1/readme.txt
r3219198 r3264087 3 3 Tags: media, image 4 4 Requires at least: 6.2 5 Tested up to: 6.7. 15 Tested up to: 6.7.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.8. 07 Stable tag: 1.8.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 109 109 110 110 == Changelog == 111 = 1.8.1 = 112 * Small refactor, no code or feature changes. 113 * Removed wp.org assets from plugin zip. 114 111 115 = 1.8.0 = 112 116 * Expose the DFI option via the rest API. -
default-featured-image/tags/1.8.1/set-default-featured-image.php
r3219198 r3264087 4 4 * Plugin URI: http://wordpress.org/extend/plugins/default-featured-image/ 5 5 * Description: Allows users to select a default featured image in the media settings 6 * Version: 1.8. 06 * Version: 1.8.1 7 7 * Requires at least: 6.2 8 8 * Requires PHP: 7.4 … … 12 12 * Text Domain: default-featured-image 13 13 * 14 * This file is still the main plugin file for Backwards compatibility. 15 * 14 16 * @package DFI 15 17 */ 16 18 17 define( 'DFI_VERSION', '1.8.0' ); 18 define( 'DFI_DIR', plugin_dir_path( __FILE__ ) ); 19 define( 'DFI_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'DFI_NAME', basename( __DIR__ ) . DIRECTORY_SEPARATOR . basename( __FILE__ ) ); 21 22 require_once DFI_DIR . 'app' . DIRECTORY_SEPARATOR . 'class-dfi.php'; 23 require_once DFI_DIR . 'app' . DIRECTORY_SEPARATOR . 'class-dfi-exceptions.php'; 24 25 $dfi = DFI::instance(); 26 27 // add the settings field to the media page. 28 add_action( 'admin_init', array( $dfi, 'media_setting' ) ); 29 add_action( 'rest_api_init', array( $dfi, 'register_media_setting' ) ); 30 // enqueue the js. 31 add_action( 'admin_print_scripts-options-media.php', array( $dfi, 'admin_scripts' ) ); 32 // get the preview image ajax call. 33 add_action( 'wp_ajax_dfi_change_preview', array( $dfi, 'ajax_wrapper' ) ); 34 // set dfi meta key on every occasion. 35 add_filter( 'get_post_metadata', array( $dfi, 'set_dfi_meta_key' ), 10, 3 ); 36 // display a default featured image. 37 add_filter( 'post_thumbnail_html', array( $dfi, 'show_dfi' ), 20, 5 ); 38 // add a link on the plugin page to the setting. 39 add_filter( 'plugin_action_links_default-featured-image/set-default-featured-image.php', array( $dfi, 'add_settings_link' ) ); 40 // add L10n. 41 add_action( 'init', array( $dfi, 'load_plugin_textdomain' ) ); 42 // remove setting on removal. 43 register_uninstall_hook( __FILE__, array( 'DFI', 'uninstall' ) ); 44 45 /** 46 * Exception: https://wordpress.org/plugins/wp-user-frontend/ 47 * 48 * @see https://wordpress.org/support/topic/couldnt-able-to-edit-default-featured-image-from-post/ 49 */ 50 add_filter( 'pre_do_shortcode_tag', array( 'DFI_Exceptions', 'wp_user_frontend_pre' ), 9, 2 ); 51 add_filter( 'do_shortcode_tag', array( 'DFI_Exceptions', 'wp_user_frontend_after' ), 9, 2 ); 52 53 /** 54 * Exception: https://www.wpallimport.com/ 55 * 56 * @see https://wordpress.org/support/topic/importing-images-into-woocommerce-using-cron/ 57 */ 58 add_filter( 'dfi_thumbnail_id', array( 'DFI_Exceptions', 'wp_all_import_dfi_workaround' ), 9 ); 19 require_once __DIR__ . DIRECTORY_SEPARATOR . 'dfi.php'; -
default-featured-image/trunk/app/class-dfi.php
r3219198 r3264087 11 11 * @var self 12 12 */ 13 protected static $inst = null;13 protected static $inst; 14 14 15 15 /** … … 196 196 public function admin_scripts() { 197 197 wp_enqueue_media(); // scripts used for uploader. 198 wp_enqueue_script( 'dfi-script', DFI_URL . 's et-default-featured-image.js', array(), DFI_VERSION, true );198 wp_enqueue_script( 'dfi-script', DFI_URL . 'src/dfi-admin.js', array(), DFI_VERSION, true ); 199 199 wp_localize_script( 200 200 'dfi-script', … … 217 217 $output = '<div id="preview-image" style="float:left; padding: 0 5px 0 0;">'; 218 218 $output .= wp_get_attachment_image( $image_id, array( 80, 60 ), true ); 219 $output .= '</div>'; 220 221 return $output; 219 220 return $output . '</div>'; 222 221 } 223 222 -
default-featured-image/trunk/readme.txt
r3219198 r3264087 3 3 Tags: media, image 4 4 Requires at least: 6.2 5 Tested up to: 6.7. 15 Tested up to: 6.7.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.8. 07 Stable tag: 1.8.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 109 109 110 110 == Changelog == 111 = 1.8.1 = 112 * Small refactor, no code or feature changes. 113 * Removed wp.org assets from plugin zip. 114 111 115 = 1.8.0 = 112 116 * Expose the DFI option via the rest API. -
default-featured-image/trunk/set-default-featured-image.php
r3219198 r3264087 4 4 * Plugin URI: http://wordpress.org/extend/plugins/default-featured-image/ 5 5 * Description: Allows users to select a default featured image in the media settings 6 * Version: 1.8. 06 * Version: 1.8.1 7 7 * Requires at least: 6.2 8 8 * Requires PHP: 7.4 … … 12 12 * Text Domain: default-featured-image 13 13 * 14 * This file is still the main plugin file for Backwards compatibility. 15 * 14 16 * @package DFI 15 17 */ 16 18 17 define( 'DFI_VERSION', '1.8.0' ); 18 define( 'DFI_DIR', plugin_dir_path( __FILE__ ) ); 19 define( 'DFI_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'DFI_NAME', basename( __DIR__ ) . DIRECTORY_SEPARATOR . basename( __FILE__ ) ); 21 22 require_once DFI_DIR . 'app' . DIRECTORY_SEPARATOR . 'class-dfi.php'; 23 require_once DFI_DIR . 'app' . DIRECTORY_SEPARATOR . 'class-dfi-exceptions.php'; 24 25 $dfi = DFI::instance(); 26 27 // add the settings field to the media page. 28 add_action( 'admin_init', array( $dfi, 'media_setting' ) ); 29 add_action( 'rest_api_init', array( $dfi, 'register_media_setting' ) ); 30 // enqueue the js. 31 add_action( 'admin_print_scripts-options-media.php', array( $dfi, 'admin_scripts' ) ); 32 // get the preview image ajax call. 33 add_action( 'wp_ajax_dfi_change_preview', array( $dfi, 'ajax_wrapper' ) ); 34 // set dfi meta key on every occasion. 35 add_filter( 'get_post_metadata', array( $dfi, 'set_dfi_meta_key' ), 10, 3 ); 36 // display a default featured image. 37 add_filter( 'post_thumbnail_html', array( $dfi, 'show_dfi' ), 20, 5 ); 38 // add a link on the plugin page to the setting. 39 add_filter( 'plugin_action_links_default-featured-image/set-default-featured-image.php', array( $dfi, 'add_settings_link' ) ); 40 // add L10n. 41 add_action( 'init', array( $dfi, 'load_plugin_textdomain' ) ); 42 // remove setting on removal. 43 register_uninstall_hook( __FILE__, array( 'DFI', 'uninstall' ) ); 44 45 /** 46 * Exception: https://wordpress.org/plugins/wp-user-frontend/ 47 * 48 * @see https://wordpress.org/support/topic/couldnt-able-to-edit-default-featured-image-from-post/ 49 */ 50 add_filter( 'pre_do_shortcode_tag', array( 'DFI_Exceptions', 'wp_user_frontend_pre' ), 9, 2 ); 51 add_filter( 'do_shortcode_tag', array( 'DFI_Exceptions', 'wp_user_frontend_after' ), 9, 2 ); 52 53 /** 54 * Exception: https://www.wpallimport.com/ 55 * 56 * @see https://wordpress.org/support/topic/importing-images-into-woocommerce-using-cron/ 57 */ 58 add_filter( 'dfi_thumbnail_id', array( 'DFI_Exceptions', 'wp_all_import_dfi_workaround' ), 9 ); 19 require_once __DIR__ . DIRECTORY_SEPARATOR . 'dfi.php';
Note: See TracChangeset
for help on using the changeset viewer.