[wp-trac] [WordPress Trac] #25549: Twenty Fourteen: implement featured content "tag" mechanism

WordPress Trac noreply at wordpress.org
Fri Nov 1 07:58:29 UTC 2013


#25549: Twenty Fourteen: implement featured content "tag" mechanism
---------------------------+--------------------
 Reporter:  lancewillett   |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  3.8
Component:  Bundled Theme  |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |
---------------------------+--------------------

Comment (by celloexpressions):

 [attachment:25549.customizer.1.diff] is a ''rough'' first-pass at moving
 the settings to the customizer. Everything still works to the extent that
 it did previously, but I ran into several issues:
 - The layout and quantity options work as expected, but the tag name
 doesn't properly update in the customizer (it uses the tag id, which is
 updated when the tag name option is sanitized), and the hide-tag option
 doesn't update in the customizer (even when the tag is kept the same). The
 options do save just fine but you need to reload the customizer page to
 get them to update in the preview, even after they're live on the site
 when you save changes. Something's being cached where it shouldn't,  I
 guess, although it didn't appear to be related to the setting of the
 transient in `featured-content.php`.
 - We ''should'' be running into same issue as generated accent colors
 (#25580) with the patched approach for setting the featured content tag
 id. Since we generate the tag id based on the tag name, similarly to the
 need to generate color variations, I'm starting to think that we should
 explore improved core support for generated options in the customizer...
 alternatively we could just do all of the extra filtering as in obenland's
 patch on #25580.
 - I'm not buying the `add_theme_support` approach. If the featured content
 file is designed to be a "module", including it should be enough to
 indicate a desire to support it in the theme. A solution for the quantity
 support (which I ignored for now) should be explored, though.
 - The new settings are added to `customizer.php` because they logically
 fit there and the customize_register code can't be put into a function in
 `featured-content.php` because that would result in nested class
 declarations (unless we put it outside of the class, in that file).
 - Speaking of that custom customizer control, perhaps there should be
 support for the number input type in core? While we're at it, range would
 be nice and could also utilize min and max.
 - When merging my implementation and lancewillett's of the layout
 settings, I had done it with a radio UI instead of select. That seems more
 logical to me because there are only two options anyway so it's better if
 you can see what they are right away (the select sets up an expectation
 for more than just one alternative, and feels like we're trying to hide
 the feature); anyone have thoughts on that? Patch also removes a couple of
 unneeded parameters there (they're the defaults).
 - `ajaxurl` not being defined in the customizer seems like a core bug. The
 suggest script doesn't appear to work even with the definition of ajaxurl,
 but it may just be super slow.
 - I didn't actually implement making a "featured" tag default, just threw
 it in as the default theme_mod value.

 There are obviously a lot of details to work out, but I think this is a
 much better UI direction for this setting. If anyone has ideas for fixes
 (or discussions points) for any of the above (particularly the blatant
 bugs), patch away!

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25549#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list