Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author gqevu6bsiz

    (@gqevu6bsiz)

    Hi David,

    Thank you for your inquiry and your pointed out.

    When using the child theme, I was also checked.
    Indeed, this is it is not good.

    >However, that will break backwards compatibility for people upgrading!
    I think so too.

    This is my think of “js_css_include_manager_location”,

    $current_theme = wp_get_theme();
    	$parent = $current_theme->parent();
    	if( !empty( $parent ) ) {
    		$Location[3] = array(
    			'name' => __('The Active Theme\'s Directory', 'js_css_include_manager').' <span class="description">('.$current_theme->display('Name').')</span>',
    			'location' => get_stylesheet_directory_uri().'/'
    		);
    	}

    This is override location.

    or

    $current_theme = wp_get_theme();
    	$parent = $current_theme->parent();
    	if( !empty( $parent ) ) {
    		$Location[6] = array(
    			'name' => __('The Active Theme\'s Directory of Child', 'js_css_include_manager').' <span class="description">('.$current_theme->display('Name').')</span>',
    			'location' => get_stylesheet_directory_uri().'/'
    		);
    	}

    This is add location.

    Which do you think is better?
    If you don’t mind, I would like to get your feedback.

    If you have any questions please feel free to contact me.

    Thanks,
    gqevu6bsiz

    Thread Starter David Anderson / Team Updraft

    (@davidanderson)

    Hi,

    I think that code will still not be backwards compatible??

    Here is an idea:

    1) Store an extra field in the include data to indicate which version of the plugin it was first created with. If the field is not present, then assume that it was created with a “legacy” version.

    2) For “legacy” versions, use get_template_directory_uri(); for newer ones, use get_stylesheet_directory_uri(). Always use/show get_stylesheet_directory_uri() when creating a new include.

    Alternatively, you could:

    i) Always use get_stylesheet_directory_uri(), but…

    ii) … use an update detection to rewrite old data of type ‘3’ (active theme directory) to type ‘4’ (other theme directory).

    I think either of those ways would be backwards compatible, and also show the correct active theme directory in future?

    Plugin Author gqevu6bsiz

    (@gqevu6bsiz)

    Thank you for your ideas and your pointed out!

    I’m sorry, I was maybe wrong understanding of this meaning.
    “backwards compatibility”.

    I had understand in this.
    User to use from now to “choose”.

    I tried to many times re-read the English of you.

    I think maybe understood of your says “backwards compatibility” .
    Does this have realize of your idea?
    https://downloads.www.ads-software.com/plugin/js-css-include-manager.zip
    (Trunk version)
    I added a input extra field (data_ver), and branch function to Active theme directory.

    If I wrong.
    If you don’t mind, I would like to also get your feedback.
    I am going to show the correct active theme directory in future.

    If you have any questions, please feel free to ask.

    Thanks,
    gqevu6bsiz

    Thread Starter David Anderson / Team Updraft

    (@davidanderson)

    Hi gqevu6bsiz,

    Yes, that’s exactly what I meant. I’ve tested your version, and it worked well – thank you!

    David

    Plugin Author gqevu6bsiz

    (@gqevu6bsiz)

    Hi David,

    Thnak you for your tested!
    In the near future, that is update for WordPress 3.6.
    Thank you for the good advice!

    Thanks,
    gqevu6bsiz

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Should use child theme directory…’ is closed to new replies.