WP Custom Admin Bar
Fix for notice about $ID (1 post)

  1. Liam Gladdy
    Posted 3 years ago #

    When using heavily custom pages, get_queried_object()->ID might not be set, causing a PHP notice.

    The fix for this is to replace the block of code from line 66 > 70 of custom-admin-bar-functions.php with:

    $hidepage = isset($current_object->ID) ? "?cab_hide_page=".$current_object->ID : '';
    	array(	'parent' => 'cab-menu',
    		'id' => 'cab_hide_page',
    		'title' => __( 'Hide For This Page' ),
    		'href' => parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH).$hidepage

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Custom Admin Bar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.