Plugin Directory

Changeset 3264087


Ignore:
Timestamp:
03/30/2025 01:02:50 PM (9 months ago)
Author:
janw.oostendorp
Message:

Update to version 1.8.1 from GitHub

Location:
default-featured-image
Files:
8 added
4 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • default-featured-image/tags/1.8.1/app/class-dfi.php

    r3219198 r3264087  
    1111     * @var self
    1212     */
    13     protected static $inst = null;
     13    protected static $inst;
    1414
    1515    /**
     
    196196    public function admin_scripts() {
    197197        wp_enqueue_media(); // scripts used for uploader.
    198         wp_enqueue_script( 'dfi-script', DFI_URL . 'set-default-featured-image.js', array(), DFI_VERSION, true );
     198        wp_enqueue_script( 'dfi-script', DFI_URL . 'src/dfi-admin.js', array(), DFI_VERSION, true );
    199199        wp_localize_script(
    200200            'dfi-script',
     
    217217        $output  = '<div id="preview-image" style="float:left; padding: 0 5px 0 0;">';
    218218        $output .= wp_get_attachment_image( $image_id, array( 80, 60 ), true );
    219         $output .= '</div>';
    220 
    221         return $output;
     219
     220        return $output . '</div>';
    222221    }
    223222
  • default-featured-image/tags/1.8.1/readme.txt

    r3219198 r3264087  
    33Tags: media, image
    44Requires at least: 6.2
    5 Tested up to: 6.7.1
     5Tested up to: 6.7.2
    66Requires PHP: 7.4
    7 Stable tag: 1.8.0
     7Stable tag: 1.8.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    109109
    110110== Changelog ==
     111= 1.8.1 =
     112* Small refactor, no code or feature changes.
     113* Removed wp.org assets from plugin zip.
     114
    111115= 1.8.0 =
    112116* Expose the DFI option via the rest API.
  • default-featured-image/tags/1.8.1/set-default-featured-image.php

    r3219198 r3264087  
    44 * Plugin URI: http://wordpress.org/extend/plugins/default-featured-image/
    55 * Description: Allows users to select a default featured image in the media settings
    6  * Version: 1.8.0
     6 * Version: 1.8.1
    77 * Requires at least: 6.2
    88 * Requires PHP: 7.4
     
    1212 * Text Domain: default-featured-image
    1313 *
     14 * This file is still the main plugin file for Backwards compatibility.
     15 *
    1416 * @package DFI
    1517 */
    1618
    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 );
     19require_once __DIR__ . DIRECTORY_SEPARATOR . 'dfi.php';
  • default-featured-image/trunk/app/class-dfi.php

    r3219198 r3264087  
    1111     * @var self
    1212     */
    13     protected static $inst = null;
     13    protected static $inst;
    1414
    1515    /**
     
    196196    public function admin_scripts() {
    197197        wp_enqueue_media(); // scripts used for uploader.
    198         wp_enqueue_script( 'dfi-script', DFI_URL . 'set-default-featured-image.js', array(), DFI_VERSION, true );
     198        wp_enqueue_script( 'dfi-script', DFI_URL . 'src/dfi-admin.js', array(), DFI_VERSION, true );
    199199        wp_localize_script(
    200200            'dfi-script',
     
    217217        $output  = '<div id="preview-image" style="float:left; padding: 0 5px 0 0;">';
    218218        $output .= wp_get_attachment_image( $image_id, array( 80, 60 ), true );
    219         $output .= '</div>';
    220 
    221         return $output;
     219
     220        return $output . '</div>';
    222221    }
    223222
  • default-featured-image/trunk/readme.txt

    r3219198 r3264087  
    33Tags: media, image
    44Requires at least: 6.2
    5 Tested up to: 6.7.1
     5Tested up to: 6.7.2
    66Requires PHP: 7.4
    7 Stable tag: 1.8.0
     7Stable tag: 1.8.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    109109
    110110== Changelog ==
     111= 1.8.1 =
     112* Small refactor, no code or feature changes.
     113* Removed wp.org assets from plugin zip.
     114
    111115= 1.8.0 =
    112116* Expose the DFI option via the rest API.
  • default-featured-image/trunk/set-default-featured-image.php

    r3219198 r3264087  
    44 * Plugin URI: http://wordpress.org/extend/plugins/default-featured-image/
    55 * Description: Allows users to select a default featured image in the media settings
    6  * Version: 1.8.0
     6 * Version: 1.8.1
    77 * Requires at least: 6.2
    88 * Requires PHP: 7.4
     
    1212 * Text Domain: default-featured-image
    1313 *
     14 * This file is still the main plugin file for Backwards compatibility.
     15 *
    1416 * @package DFI
    1517 */
    1618
    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 );
     19require_once __DIR__ . DIRECTORY_SEPARATOR . 'dfi.php';
Note: See TracChangeset for help on using the changeset viewer.