WPIntell

Source evidence

php warnings thrown before menu save..

Widgets in Menu for WordPress · support · 2015-09-21T21:09:00+00:00

mixedsentiment
mediumseverity
0.84relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 15 rows with source links

6.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

14 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Justin Fletcher resolved
just 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.

Comments

4 shown
Abdul Cholik 2015-10-10T10:31:00+00:00

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; }

Justin Fletcher 2015-10-12T11:37:00+00:00

looks better are you going to add to the next version?

Saurabh 2016-07-27T08:01:00+00:00

Please do not modify the main plugin file. I’ll check and push an update soon.

Saurabh 2016-12-15T23:19:00+00:00

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.