[wp-trac] [WordPress Trac] #24202: Self-explanatory argument values for new media functions

WordPress Trac noreply at wordpress.org
Fri Apr 26 13:26:51 UTC 2013


#24202: Self-explanatory argument values for new media functions
--------------------------------------+--------------------
 Reporter:  SergeyBiryukov            |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  3.6
Component:  Media                     |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  dev-feedback 2nd-opinion  |
--------------------------------------+--------------------

Comment (by SergeyBiryukov):

 Also, the `$limit` argument might be confusing.

 In `get_content_*()` functions, it's the number of items to return:
 {{{
  * @param int $limit Optional. The number of medias to return
 ...
 function get_content_media( $type, &$content, $html = true, $remove =
 false, $limit = 0 )
 ...
  * @param int $limit Optional. The number of galleries to return
 ...
 function get_embedded_media( $type, &$content, $remove = false, $limit = 0
 )
 ...
  * @param int $limit Optional. The number of image srcs to return
 ...
 function get_content_images( &$content, $html = true, $remove = false,
 $limit = 0 )
 ...
  * @param int $limit Optional. The number of galleries to return
 ...
 function get_content_galleries( &$content, $html = true, $remove = false,
 $limit = 0 )
 }}}

 In `get_the_post_format_media()`, however, it's the number of items to
 remove from content:
 {{{
  * @param int $limit Optional. The number of medias to remove if content
 is scanned.
 ...
 function get_the_post_format_media( $type, &$post = null, $limit = 0 )
 }}}

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


More information about the wp-trac mailing list