Jason Weber
Jason Weber

Reputation: 5741

Wordpress admin error when adjusting certain plugins - "get_themes is deprecated"

As a Wordpress/PHP newbie, I'm confused. When I try to do some things in my WP admin, for instance, when I go into my W3 Total Cache settings and check off the minify / enable button, then save the settings, I get the following error (7 of them, all the same):

Notice: get_theme is deprecated since version 3.4! Use wp_get_theme( $stylesheet )  
instead. in /home/jpweber/public_html/wp-includes/functions.php on line 2824

Notice: get_themes is deprecated since version 3.4! Use wp_get_themes() instead. in 
/home/jpweber/public_html/wp-includes/functions.php on line 2824

I get this error doing other things while in admin, as well. I'm running WP 3.5, and it's just a vanilla install, so it's just the functions.php that came with the installation, and W3 Total Cache comes with the 1-click installation the shared host I'm with provides.

Here's my line 2824 in functions.php:

trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! 
Use %3$s instead.'), $function, $version, $replacement ) );

The complete block of code for that is as follows:

function _deprecated_function( $function, $version, $replacement = null ) {

do_action( 'deprecated_function_run', $function, $replacement, $version );

// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
    if ( ! is_null($replacement) )
        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> 
since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
    else
        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> 
since version %2$s with no alternative available.'), $function, $version ) );
    }
}

Any guidance would be greatly appreciated!

Upvotes: 0

Views: 1507

Answers (1)

Melvin
Melvin

Reputation: 226

you have a plugin or template which use the "get_theme" function as stated above, whereas it should not use it anymore.

You can set "wp_debug" to false to "hide" the error, see how to do that here : http://codex.wordpress.org/WP_DEBUG

But the best thing to do would be to update all your plugins/templates, or tell the authors that you got this mistake if they did not update their code since then ;).

Upvotes: 2

Related Questions