I am creating a custom walker class.

I need to identify the custom links that will be added to the menu from Appearace > Menu > Custom Link

so that they will have a different format to the page/post links

Any thoughts on how I can do this within walker class possibly using if statement?

something like

if (link = custom-link) {
  // Do something

Test for …

$item->object = 'custom'

This is used for custom links only. $item->object is always the post type or the item type (category for example). Not sure what happens when someone registers a custom post type named custom :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.