WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 12 months ago

#24202 closed enhancement

Self-explanatory argument values for new media functions — at Initial Version

Reported by: SergeyBiryukov Owned by:
Milestone: 3.6 Priority: high
Severity: major Version: 3.6
Component: Media Keywords: dev-feedback has-patch
Focuses: Cc:

Description

We've introduced a bunch of functions, some with a relatively long list of arguments, which accept booleans:

function get_content_media( $type, &$content, $html = true, $remove = false, $limit = 0 )
function get_content_audio( &$content, $html = true, $remove = false )
function get_embedded_audio( &$content, $remove = false )
function get_content_video( &$content, $html = true, $remove = false )
function get_embedded_video( &$content, $remove = false )
function get_content_images( &$content, $html = true, $remove = false, $limit = 0 )
function get_content_image( &$content, $html = true, $remove = false )
function get_content_galleries( &$content, $html = true, $remove = false, $limit = 0 )
function get_post_galleries( $post_id = 0, $html = true )
function get_post_gallery( $post_id = 0, $html = true )
function get_content_chat( &$content, $remove = false )
function get_content_quote( &$content, $remove = false, $replace = '' )
function get_content_url( &$content, $remove = false )

I wonder if we can convert them to use arrays instead for future-proof changes, or at least switch from booleans to self-explanatory values, per our coding standards.

Otherwise, we might fall into a trap of submit_button(): #20492.

Change History (0)

Note: See TracTickets for help on using tickets.