WordPress.org

Ready to get started?Download WordPress

Forums

Toolbar Theme Switcher
[resolved] Depricated call in debug mode - headers sent (3 posts)

  1. Jacob N. Breetvelt
    Member
    Posted 2 years ago #

    There is a depricated call ( get_allowed_themes(); ) warning, generated on line 168. This causes header elready sent troubles in debug mode.

    The cause is that you first check on the existance of get_allowed_themes(); (that is being called although discouraged) and in second instance on wp_get_themes();

    You should always first check on the existance of a new function and if it does not exist on the existance of the old function, to avoid this kind of problems.

    Simply interchange the content of the if {} with the elseif {}

    if ( function_exists( 'get_allowed_themes' ) ) {
    				$themes = get_allowed_themes();
    			}
    			elseif ( function_exists( 'wp_get_themes' ) )  {
    				$wp_themes = wp_get_themes( array( 'allowed' => true ) );
    				$themes = array();
    etc...

    Great plugin, Thanx!!

    http://wordpress.org/extend/plugins/toolbar-theme-switcher/

  2. Andrey "Rarst" Savchenko
    Member
    Plugin Author

    Posted 2 years ago #

    Yeah, I caught the order issue after I committed bugfix version for WP 3.4

    Rearranged the checks and pushed 1.1.2 just now:
    http://wordpress.org/extend/plugins/toolbar-theme-switcher/changelog/

  3. Jacob N. Breetvelt
    Member
    Posted 2 years ago #

    Thanx!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.