4 ms·
You're completely right on that, and I couldn't agree more; the mystery of the global states is frustrating to a new WP developer. Additionally, Wordpress has
by jwarren 13y ago
You're completely right on that, and I couldn't agree more; the mystery of the global states is frustrating to a new WP developer.
Additionally, Wordpress has tons and tons of bad functions. If so many themes weren't dependent on them, I'd advocate for entirely stripping out a good chunk of them. Someone needs to write Wordpress: The Good Parts, or at least a really canonical good practise guide. I guess it could be a good weekend project.
For the functions you mention, you're actually not too far off what they really do. the_title() [1] is just slightly formatting get_the_title [2], which is mostly just returning $post->post_title.
Unfortunately, skipping the built-in functions means also skipping the slightly obtuse but powerful filter system. However, if you're not interested in the built in WP stuff, then there's no harm in outputting the titles directly.
Btw, yes, I realise this is mostly academic in the context we're talking about.
[1]: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post-template.php#L71 http://core.trac.wordpress.org/browser/tags/3.5.1/wp-include...
[2]: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post-template.php#L102 http://core.trac.wordpress.org/browser/tags/3.5.1/wp-include...