[wp-trac] [WordPress Trac] #18548: Add a better option for <title> tags

WordPress Trac noreply at wordpress.org
Sat Nov 1 03:58:03 UTC 2014


#18548: Add a better option for <title> tags
-------------------------------------------------+-------------------------
 Reporter:  joostdevalk                          |       Owner:
     Type:  enhancement                          |  joostdevalk
 Priority:  normal                               |      Status:  new
Component:  Themes                               |   Milestone:  4.1
 Severity:  normal                               |     Version:  3.3
 Keywords:  has-patch dev-feedback twenty-       |  Resolution:
  fifteen needs-docs                             |     Focuses:  template
-------------------------------------------------+-------------------------

Comment (by boonebgorges):

 Replying to [comment:101 obenland]:
 > Interesting. r30074 introduced `_wp_render_title_tag()`, which the test
 checks for in line 54.
 [https://core.trac.wordpress.org/changeset/435/tests The tests were
 introduced here], adding tests for a patch on this ticket. I'm pretty sure
 they can all be removed.

 Thanks for the link. You're right that the reason these tests just started
 failing now is because the `function_exists()` check finally started
 running.

 I looked back through the history of `current_theme_supports()`, and it
 looks to me like the `types` array and the `rand_str() => rand_str()`
 array would never have worked. `current_theme_supports( 'post-thumbnails'
 )` checks (and has always checked) for post support on specific post types
 with `in_array( $content_type, $_wp_theme_features['post-thumbnails'][0]
 )`. A string $content_type will only ever pass this test if the array is
 flat; `array( 'types' => array( 'post', 'page' ) )` is not. And a specific
 content_type string will only pass the check if it actually matches an
 item in the array; when you register with `rand_str()` and check again
 with another `rand_str()`, it'll fail. No one ever noticed that these
 tests incorrectly described `current_theme_supports()` because they never
 got that far :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/18548#comment:102>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list