You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.
You left some pretty good comments on why you want to check that the global $id is available, but according to this ticket on trac, usage of the $id is frowned upon. It's also not listed on WordPress' list of global variables.
Is there something else you can use to check the placement of the post?
The text was updated successfully, but these errors were encountered:
Context. The reason I've used this, as you saw, is because titles in navigation menus were getting borked when I didn't run a check against $id. If I'm on a single post or page with a subtitle, then it keeps showing up in the navigation menu (if the same post or page title is present) unless I run that check. I cribbed it from setup_postdata, but looking at that function now the variable is simply using $id = (int) $post->ID;. Let me see what I can come up with. I remember using a vanilla $post->ID not working so well but let me re-verify.
I'm now unable to reproduce any need for having $id checks in Subtitles, so I've removed this check from the plugin. If users report that subtitles show up erroneously in their navigation menus, then I will need to revisit this. But for now, I think the present checks in place, especially the in_the_loop check that takes place, is more than adequate enough to make sure that subtitles aren't used in nav menus. The only way this would come up is if someone used a navigation menu within The Loop, which isn't good and not something that we'd want to encourage anyway.
You left some pretty good comments on why you want to check that the
global $id
is available, but according to this ticket on trac, usage of the$id
is frowned upon. It's also not listed on WordPress' list of global variables.Is there something else you can use to check the placement of the post?
The text was updated successfully, but these errors were encountered: