• Hi,
    I updated all of my plug-ins, backed up my site and then installed the latest version of WordPress (4.5.1) for http://theadventuresofflapjack.com. /br

    However, after doing so, I saw the following notice posted on my dashboard, but I’m unsure if I’ve understood exactly what to do with it since my actions haven’t resulted in it no longer appearing. The notice reads:

    Notice: add_object_page is deprecated since version 4.5! Use add_menu_page() instead. in /home4/wsbydesi/public_html/theadventuresofflapjack.com/wp-includes/functions.php on line 3658

    /br

    I downloaded the PHP file and changed line 3658 from:

    trigger_error( sprintf( __(‘%1$s is deprecated since version %2$s! Use %3$s instead.’), $function, $version, $replacement ) );

    /br

    to:

    trigger_error( sprintf( __(‘%1$s is deprecated since version %2$s! Use add_menu_page() instead.’), $function, $version, $replacement ) );

    /br

    But the notice is still showing up on my dashboard. What have I missed? Please help!/br

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi kimcohen. I don’t know for sure what the error means but my guess is that either your theme or one of your plugins is using the add_object_page() function that was deprecated in WP v4.5, and is now generating the error. The error is not coming from the core functions.php file; that’s the file displaying the error message. So, the first thing I would recommend is that you restore the original functions.php file. Then I’d disable all your plugins and see if you still get the error. If so, it’s probably in the theme. If not, activate your plugins one at a time until you find the one that generates the error.

    Yes, restore that file; it’s a good idea to never alter core files.

    And, that’s a PHP notice, not an error or fatal error, so you can really ignore it if you want to. You’re seeing it on the dashboard because you’ve got debug set to true in wp-config.php. Remove any/all these lines from wp-config.php to disable the display of notices and errors:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', true);

    The line listed is where the notice is triggered, not what is causing it. Take a look at https://wordpress.org/plugins/log-deprecated-notices/ to help you identify the plugin or theme that is causing the issue and then report the issue to the author.

    I wouldn’t keep log-deprecated-notices activated after you use it, it can be a bit of a resource hog to do the backtrace to where the notice is caused.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unsure what to do with WP notice to update PHP file’ is closed to new replies.