[wp-trac] [WordPress Trac] #18951: A function to add default images for themes

WordPress Trac noreply at wordpress.org
Mon Oct 27 10:12:22 UTC 2014


#18951: A function to add default images for themes
-----------------------------+-----------------------------
 Reporter:  F J Kaiser       |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Themes           |     Version:  3.2.1
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+-----------------------------
Changes (by F J Kaiser):

 * keywords:  has-patch reporter-feedback => has-patch


Comment:

 A theme that uses post thumbnails would force the user to always have a
 post thumbnail - or break layout. The proposed function would make that
 much easier for theme authors. The only other way currently is to add a
 pretty complicated callback to the
 [https://github.com/WordPress/WordPress/blob/4.0/wp-includes/meta.php#L466
 get_{$meta_type}_metadata] filter.

 Use case/Example:
 {{{
 if ( have_posts() ) {
     while ( have_posts() ) {
         the_posts();

         the_title();
         if ( has_post_thumbnail() ) {
             the_post_thumbnail();
         }
         else {
             wp_default_img();
         }
         the_content();
     }
 }
 }}}

 One of the side effects that I could see is that theme shops or
 marketplace authors would have less questions of the following sort by
 users

 > "I installed the theme. Why doesn't it look like the demo?"

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


More information about the wp-trac mailing list