Conversation
supportjust trialling on a test site and found php warnings thrown before menu save. Notice: Trying to get property of non-object in C:\wamp\www\dev\wp-content\plugins\widgets-in-menu\index.php on line 450 call stack warnings… ( ! ) Notice: Undefined variable: _object in C:\wamp\www\dev\wp-admin\includes\ajax-actions.php on line 1117 Call Stack # Time Memory Function Location 1 0.0014 286648 {main}( ) ..\admin-ajax.php:0 2 0.9657 36178232 do_action( ) ..\admin-ajax.php:89 3 0.9657 36179728 call_user_func_array:{C:\wamp\www\dev\wp-includes\plugin.php:503} ( ) ..\plugin.php:503 4 0.9657 36179760 wp_ajax_add_menu_item( ) ..\plugin.php:503 ( ! ) Notice: Trying to get property of non-object in C:\wamp\www\dev\wp-content\plugins\widgets-in-menu\index.php on line 450 Call Stack # Time Memory Function Location 1 0.0014 286648 {main}( ) ..\admin-ajax.php:0 2 0.9657 36178232 do_action( ) ..\admin-ajax.php:89 3 0.9657 36179728 call_user_func_array:{C:\wamp\www\dev\wp-includes\plugin.php:503} ( ) ..\plugin.php:503 4 0.9657 36179760 wp_ajax_add_menu_item( ) ..\plugin.php:503 5 0.9699 36512520 array_map ( ) ..\ajax-actions.php:1117 6 0.9699 36512824 wp_setup_nav_menu_item( ) ..\ajax-actions.php:1117 7 0.9699 36515232 apply_filters( ) ..\nav-menu.php:824 8 0.9700 36516584 call_user_func_array:{C:\wamp\www\dev\wp-includes\plugin.php:213} ( ) ..\plugin.php:213 9 0.9700 36516616 yawpWIM->label( ) ..\plugin.php:213 ( ! ) Notice: Trying to get property of non-object in C:\wamp\www\dev\wp-admin\includes\ajax-actions.php on line 1121 Call Stack # Time Memory Function Location 1 0.0014 286648 {main}( ) ..\admin-ajax.php:0 2 0.9657 36178232 do_action( ) ..\admin-ajax.php:89 3 0.9657 36179728 call_user_func_array:{C:\wamp\www\dev\wp-includes\plugin.php:503} ( ) ..\plugin.php:503 4 0.9657 36179760 wp_ajax_add_menu_item( ) ..\plugin.php:503 https://wordpress.org/plugins/widgets-in-menu/
Hi, Please try to replace label functions with code below function label( $item ) { if ( isset( $item->object) && $this->prefix== $item->object) { $item->type_label = __('Widget', $this->domain); } return $item; }
looks better are you going to add to the next version?
Please do not modify the main plugin file. I’ll check and push an update soon.
I have fixed this issue. It was a little complicated and involved overriding the default function that adds menu items via ajax that I wasn’t comfortable doing earlier. The fix mentioned above is bad. Please don’t use it. I’ll be releasing a new version in a day or so.
Hi, Please try to replace label functions with code below function label( $item ) { if ( isset( $item->object) && $this->prefix== $item->object) { $item->type_label = __('Widget', $this->domain); } return $item; }
looks better are you going to add to the next version?
Please do not modify the main plugin file. I’ll check and push an update soon.
I have fixed this issue. It was a little complicated and involved overriding the default function that adds menu items via ajax that I wasn’t comfortable doing earlier. The fix mentioned above is bad. Please don’t use it. I’ll be releasing a new version in a day or so.