Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Don't do active fix for CPT if no archive page #180

Merged
merged 1 commit into from
Jun 12, 2017

Conversation

dotsam
Copy link

@dotsam dotsam commented May 4, 2017

If the custom post type is set to not have an archive, get_post_type_archive_link() returns false. When that false value is provided to the url_compare() util function, it runs it through trailingslashit() which returns the string /, which is then less than helpful in the string comparisons to follow.

This PR just skips url_compare() when the CPT doesn't have an archive set. It's not able to set any class to active then, but that's better than setting all CPT menu items to active

@retlehs retlehs merged commit 9ff7ff3 into roots:master Jun 12, 2017
@retlehs
Copy link
Member

retlehs commented Jun 12, 2017

thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants