mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-18 12:35:03 +00:00
In image_size_input_fields()
:
* Declare `$out` as an empty array - this is not a strict PHP requirement, but is a good practice before loops * Most of this function was tabbed twice, instead of once See #30799. Built from https://develop.svn.wordpress.org/trunk@30981 git-svn-id: http://core.svn.wordpress.org/trunk@30967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f19bec8754
commit
2dbd0d0a8f
@ -949,7 +949,6 @@ function image_align_input_fields( $post, $checked = '' ) {
|
||||
* @return array
|
||||
*/
|
||||
function image_size_input_fields( $post, $check = '' ) {
|
||||
|
||||
/**
|
||||
* Filter the names and labels of the default image sizes.
|
||||
*
|
||||
@ -965,8 +964,10 @@ function image_size_input_fields( $post, $check = '' ) {
|
||||
'full' => __( 'Full Size' )
|
||||
) );
|
||||
|
||||
if ( empty($check) )
|
||||
if ( empty( $check ) ) {
|
||||
$check = get_user_setting('imgsize', 'medium');
|
||||
}
|
||||
$out = array();
|
||||
|
||||
foreach ( $size_names as $size => $label ) {
|
||||
$downsize = image_downsize( $post->ID, $size );
|
||||
@ -978,10 +979,11 @@ function image_size_input_fields( $post, $check = '' ) {
|
||||
|
||||
// If this size is the default but that's not available, don't select it.
|
||||
if ( $size == $check ) {
|
||||
if ( $enabled )
|
||||
if ( $enabled ) {
|
||||
$checked = " checked='checked'";
|
||||
else
|
||||
} else {
|
||||
$check = '';
|
||||
}
|
||||
} elseif ( ! $check && $enabled && 'thumbnail' != $size ) {
|
||||
/*
|
||||
* If $check is not enabled, default to the first available size
|
||||
@ -996,9 +998,9 @@ function image_size_input_fields( $post, $check = '' ) {
|
||||
$html .= "<label for='{$css_id}'>$label</label>";
|
||||
|
||||
// Only show the dimensions if that choice is available.
|
||||
if ( $enabled )
|
||||
if ( $enabled ) {
|
||||
$html .= " <label for='{$css_id}' class='help'>" . sprintf( "(%d × %d)", $downsize[1], $downsize[2] ). "</label>";
|
||||
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
$out[] = $html;
|
||||
|
Loading…
x
Reference in New Issue
Block a user