Plugin Directory

Changeset 3822865


Ignore:
Timestamp:
11/25/2026 12:55:31 PM (12 hours ago)
Author:
flawlesstheme
Message:

release 1.0.24

Location:
flawless-themes-demo-importer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • flawless-themes-demo-importer/trunk/README.txt

    r3822747 r3822865  
    55Requires at least: 6.0
    66Tested up to: 7.1
    7 Stable tag: 1.0.23
     7Stable tag: 1.0.24
    88Requires PHP: 7.4
    99License: GPLv2 or later
    … …  
    103103        * Improved compatibility with WordPress.org Plugin Check.
    104104
     105        = 1.0.24 =
     106        * Fixed a demo importer plugin activation error.
     107
    105108== Upgrade Notice ==
    106109
  • flawless-themes-demo-importer/trunk/flawless-demo-importer.php

    r3822747 r3822865  
    1717 * Plugin URI:       
    1818 * Description:       Import Demo Content for Flawless Themes free version Themes
    19  * Version:           1.0.23
     19 * Version:           1.0.24
    2020 * Author:            Flawless Themes
    2121 * Author URI:        https://flawlessthemes.com/
    … …  
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'FLAWLESS_DEMO_IMPORTER_VERSION', '1.0.23' );
     38define( 'FLAWLESS_DEMO_IMPORTER_VERSION', '1.0.24' );
    3939
    4040/**
  • flawless-themes-demo-importer/trunk/includes/class-flawless-demo-importer.php

    r3822747 r3822865  
    373373    }
    374374}
    375 if (in_array('one-click-demo-import/one-click-demo-import.php', apply_filters('flawless_demo_importer_active_plugins', get_option('flawless_demo_importer_active_plugins')))) {
    376 
    377     add_filter('pt-ocdi/import_files', 'flawless_demo_importer_import_files');
     375
     376
     377$active_plugins = apply_filters(
     378    'flawless_demo_importer_active_plugins',
     379    get_option( 'flawless_demo_importer_active_plugins', array() )
     380);
     381
     382// Ensure active plugins is always an array.
     383if ( ! is_array( $active_plugins ) ) {
     384    $active_plugins = array();
     385}
     386
     387if ( in_array( 'one-click-demo-import/one-click-demo-import.php', $active_plugins, true ) ) {
     388
     389    add_filter( 'pt-ocdi/import_files', 'flawless_demo_importer_import_files' );
    378390    add_action( 'pt-ocdi/after_import', 'flawless_demo_importer_after_import_setup' );
    379 }
    380 else{
    381         function flawless_demo_importer_sample_admin_notice__error() {
    382             $class = 'notice notice-error';
    383             $message = __( 'You have not installed or activated the One Click Demo Import Plugin', 'flawless-themes-demo-importer' );
    384          
    385             printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
    386         }
    387         add_action( 'admin_notices', 'flawless_demo_importer_sample_admin_notice__error' );
     391
     392} else {
     393
     394    if ( ! function_exists( 'flawless_demo_importer_sample_admin_notice__error' ) ) {
     395
     396        function flawless_demo_importer_sample_admin_notice__error() {
     397            $class = 'notice notice-error';
     398            $message = __( 'You have not installed or activated the One Click Demo Import Plugin', 'flawless-themes-demo-importer' );
     399
     400            printf(
     401                '<div class="%1$s"><p>%2$s</p></div>',
     402                esc_attr( $class ),
     403                esc_html( $message )
     404            );
     405        }
     406    }
     407
     408    add_action( 'admin_notices', 'flawless_demo_importer_sample_admin_notice__error' );
    388409}
    389410
Note: See TracChangeset for help on using the changeset viewer.