Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Move title logic to functions.php #13

merged 0 commits into from May 23, 2012


None yet
2 participants

obenland commented Mar 22, 2012

As suggested by Ian in #12, I prepared a patch for your convenience, which moves the title logic from header.php to functions.php - giving plugin authors the chance to override the title output cleanly.
If this does not meet your standards in any way, I'd be happy to go over it again.


Mamaduka commented Apr 6, 2012

@obenland I like using filter idea and want to implement them in my themes, but while reading Yoast's article discovered, that this solution can break SEO plugins that use output buffering. See article for more information - - Discuss: The Page Title in WordPress Themes.


obenland commented Apr 6, 2012

Thank you for your feedback and the link! Wow, this really IS a mess. :)

My take from the article and the trac ticket is, that plugins need to buffer the output because of implementations like in Toolbox and _s. You'll probably agree that filtering 'wp_title' (as required by the WPTRT) is at the least a step in the right direction.

Concerning the breakage of plugins I want to quote Otto from a different conversation on a different subject:
"We should NOT be programming our code to accommodate what Google does. We should be programming it to be correct, and then let Google adapt to US." - Otto (http://core.trac.wordpress.org/ticket/20194#comment:23)

I agree, the proposed change is probably not the most golden of solutions, but (IMHO) the best we can currently do, given the circumstances.


Mamaduka commented Apr 6, 2012

Right, we shouldn't stop doing step forward for best practice just because it breaks some plugins, it's plugin authors responsibility to update them and match standards. Unfortunately not all themes will update their header.php and use wp_title filter instead, so simply that would mean more user complains to plugin authors that use right method.

@obenland obenland merged commit 55ab0fa into Automattic:master May 23, 2012

@obenland obenland added a commit that referenced this pull request Nov 28, 2012

@obenland obenland Merge pull request #79 from kovshenin/patch-11
* Introduces a filter for wp_title instead of hard-coding things in header.php
* Renames inc/tweaks.php to inc/extras.php
* Includes inc/extras.php by default in functions.php

See #12, #13, #33

@carl-alberto carl-alberto pushed a commit to carl-alberto/business-portfolio that referenced this pull request May 27, 2016

@swalkinshaw swalkinshaw Updated relative path function to work with sub dirs - fixes #13 40485c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment