The number in the last argument to add_filter()
needs to match the number of arguments accepted by the callback function. Your function now accepts 4 arguments:
function eodwp_menu_item_class( $classes, $item, $args, $depth) {
So that last number needs to be 4
:
add_filter( 'nav_menu_css_class', 'eodwp_menu_item_class', 10, 4 );
Related Posts:
- Can I change a custom post type label from a child theme?
- Get category id from post id of a custom post type
- Custom Taxonomy as Dropdown in admin
- How to call a custom post with get_posts() instead of query_posts()?
- Hide custom post type field from author?
- WordPress Custom Post Type is Matching on Partial Slug
- How to disable a Custom Post Type Feed?
- Permalink for CPT with taxonomy
- One of two Custom Post types not being registered
- How to create custom URLs for Custom Post Type sub sections?
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Custom post type category, taxonomy and URL rewrite problem
- Trying to save custom post type from frontend partially working
- How can I remove categories in menu in custom post type?
- Dropdown list of a custom post type
- Include both default and Custom Post Type in query modified inside pre_get_posts
- Custom Post Type: How to display all of same taxonomy?
- How to use different featured image size for a custom post type?
- Adding help information to custom post edit page
- How to display recent / random posts by its category
- Exclude specific taxonomy term when using wp_get_post_terms
- Custom Post Type with metaboxes (no content) only?
- Querying Term Posts in Loop
- Custom Post Type Navigation on Custom Field
- Can’t get order_by meta_value_num to work properly
- Is it possible to place custom post type files inside a folder in theme directory?
- Post Type Description for ‘Posts’
- Custom Post Type – List all attachments on Edit Screen
- Dynamically creating custom post type items and updating them
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- Custom post type title is set by other custom post type
- Conditional Statement custom post type category
- will post_id ever change? Can I safely use post_id for custom queries?
- I have a custom post type with many posts. How do I split the list into multiple pages?
- Add Custom Post Type as top level menu item for a custom page
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post Type URL Change – (portfolio using portfolio categories) [duplicate]
- don’t publish custom post type post if a meta data field isn’t valid
- How to handle large number of images in a post?
- Proper way to display latest 5 posts grouped by post type?
- How to set up Custom Post Type archive page as Front page
- Editor / Add Media: Is it possible to only allow galleries?
- Give each post type label a different color?
- Check IF single OR multiple custom data has been entered
- get_pagination not working on a custom post type query (using WP_Query)
- How to Make infinite loop of post
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- CPT is simply not displayed in the main archive with “pre_get_posts”
- how to count the current posts terms
- CPT defaults to single.php?
- How to display wp_post by custom field value?
- Create Custom Post type that uses Page.php template
- Enqueueing TinyMCE
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Searching post types
- wordpress post_where set only for my costum post type
- Looking to Customize YouTube Video Embeds
- wp_query not returning my custom post
- Using page title as a link to term archive
- Pagination on a page
- highlight parent page menu item when in custom post type
- Combine 2 different custom post slugs into a single permalink?
- Display category name of custom posts only once in the loop
- Metaboxes inside Tab
- Virtual page and loading template
- Template for Custom Post for the EDITOR
- How to hide bottom navigation (previous/next post) in Custom Post Type plugin in WordPress?
- Restrict admin pages for specific user role
- WP_Query: how to search tags in addition to a custom post type?
- WordPress URL rewrites using Advanced Custom Field
- How to display custom post type taxonomy in Contact Form 7 text field
- Custom attachment function not working in v5.4.2?
- Custom post type author issues
- Help understand and create a loop with WP_query
- Custom Taxonomy Page
- Don’t share custom taxonomy terms if applied to multiple Custom Post Types
- How to show custom post count in archive page
- filter rest api post by a acf filed
- How can I prevent the admin to create a new custom post type more than one?
- How to prepend text to custom field value A, but only if custom field value B matches a certain string?
- Custom Taxonomy is disabled on Edit page
- I want to show specific parent terms child term with post list
- Creating multiple CPT posts from one Gravity form
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Function not pulling image or text from custom post type
- How to use wp query posts with current post meta value in text widget
- category page template for custom post type
- Delete attachment with post
- Get link for feed of specific post type AND taxonomy
- Need an idea about how to open a popup which contain only post created form in wordpress admin
- Copying custom field value in to title
- Get single object term for custom taxonomy
- Sorting custom post types by taxonomy (So close)
- Return Custom Post Type Categories
- Associating post id with its post type
- Types plugin isn’t compatible with my custom post type
- Show Posts in Vertical Tabs with Scrollbar
- img src not working correctly in custom post type
- ACF Relationship: Group posts by parent category term, then child [closed]
- Custom Post Type slug has the same Redirection entry