Incorrectly calling a filter
-
On line 36 of the main plugin file, you have the following line of code:
self::$has_custom_walker = 'Walker_Nav_Menu_Edit' !== apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit' );
I’m not certain calling
apply_filters()
in this way is best, but if you are going to do it, you need to send a 2nd parameter through, as that is what other plugins expect. The second parameter should be a menu ID. You can see that in the documentation for the filter within WordPress core:/** * Filters the Walker class used when adding nav menu items. * * @since 3.0.0 * * @param string $class The walker class to use. Default 'Walker_Nav_Menu_Edit'. * @param int $menu_id ID of the menu being rendered. */
So, again, if you’re not calling this filter for a specific menu ID, you’re probably not doing it right. But, if this is going to be done, please send a second parameter, even if it is
null
.Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Incorrectly calling a filter’ is closed to new replies.