[buddypress-trac] [BuddyPress Trac] #6008: Remove HTML from post_title for groups
buddypress-trac
noreply at wordpress.org
Fri Nov 14 13:16:08 UTC 2014
#6008: Remove HTML from post_title for groups
-------------------------------+------------------------------
Reporter: alexander.rohmann | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: Awaiting Review
Component: Groups | Version: 2.1
Severity: major | Resolution:
Keywords: |
-------------------------------+------------------------------
Comment (by imath):
Replying to [comment:12 boonebgorges]:
> Why are we not just filtering `'the_title'`?
The problem : what is the best moment to filter it ? For a bbPress plugin
(support topic) i've played in this area and it's quite complex.
{{{get_the_title()}}} (the function where the_title filter is) can be used
:
- in meta tags (eg: the facebook og:title meta as explained
alexander.rohmann in a previous comment)
- in breadcrumbs
- in widgets
- in footer
When are we absolutely sure to be in the targetted entry title ? I'd say
never. There's no hooks before or after that is precise enough from my
point of view.
You can wait wp_head, but then sidebar ? Sidebar can be in the header
template of the theme (eg: twentyfifteen), or after the_content? So you
need to [https://github.com/imath/buddy-bbPress-Support-
Topic/blob/master/includes/functions.php#L105 toggle a global] to
true/false on the [https://github.com/imath/buddy-bbPress-Support-
Topic/blob/master/buddy-bbpress-support-topic.php#L179 hooks]
{{{dynamic_sidebar_before}}} / {{{dynamic_sidebar_after}}}
And if the theme has breadcrumbs... Then you need to leave a way for the
user to filter your [https://github.com/imath/buddy-bbPress-Support-
Topic/blob/master/includes/functions.php#L661 filter]
So IMHO, the best choices are : remove links in title as johnjamesjacoby
suggested or add a filter to leave themes/plugins remove the link when
they need > eg
[https://buddypress.trac.wordpress.org/attachment/ticket/6008/6008.patch
6008.patch] or do nothing : they just could do a {{{strip_tags(
get_the_title() )}}} to absolutely be sure to only get the title for their
metas/breadcrumbs ....
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6008#comment:14>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list