Edit File by line
/home/zeestwma/redstone.../wp-admin/includes
File: class-custom-background.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* The custom background script.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* The custom background class.
[9] Fix | Delete
*
[10] Fix | Delete
* @since 3.0.0
[11] Fix | Delete
*/
[12] Fix | Delete
#[AllowDynamicProperties]
[13] Fix | Delete
class Custom_Background {
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Callback for administration header.
[17] Fix | Delete
*
[18] Fix | Delete
* @since 3.0.0
[19] Fix | Delete
* @var callable
[20] Fix | Delete
*/
[21] Fix | Delete
public $admin_header_callback;
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Callback for header div.
[25] Fix | Delete
*
[26] Fix | Delete
* @since 3.0.0
[27] Fix | Delete
* @var callable
[28] Fix | Delete
*/
[29] Fix | Delete
public $admin_image_div_callback;
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* Used to trigger a success message when settings updated and set to true.
[33] Fix | Delete
*
[34] Fix | Delete
* @since 3.0.0
[35] Fix | Delete
* @var bool
[36] Fix | Delete
*/
[37] Fix | Delete
private $updated;
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Constructor - Registers administration header callback.
[41] Fix | Delete
*
[42] Fix | Delete
* @since 3.0.0
[43] Fix | Delete
*
[44] Fix | Delete
* @param callable $admin_header_callback Optional. Administration header callback.
[45] Fix | Delete
* Default empty string.
[46] Fix | Delete
* @param callable $admin_image_div_callback Optional. Custom image div output callback.
[47] Fix | Delete
* Default empty string.
[48] Fix | Delete
*/
[49] Fix | Delete
public function __construct( $admin_header_callback = '', $admin_image_div_callback = '' ) {
[50] Fix | Delete
$this->admin_header_callback = $admin_header_callback;
[51] Fix | Delete
$this->admin_image_div_callback = $admin_image_div_callback;
[52] Fix | Delete
[53] Fix | Delete
add_action( 'admin_menu', array( $this, 'init' ) );
[54] Fix | Delete
[55] Fix | Delete
add_action( 'wp_ajax_custom-background-add', array( $this, 'ajax_background_add' ) );
[56] Fix | Delete
[57] Fix | Delete
// Unused since 3.5.0.
[58] Fix | Delete
add_action( 'wp_ajax_set-background-image', array( $this, 'wp_set_background_image' ) );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Sets up the hooks for the Custom Background admin page.
[63] Fix | Delete
*
[64] Fix | Delete
* @since 3.0.0
[65] Fix | Delete
*/
[66] Fix | Delete
public function init() {
[67] Fix | Delete
$page = add_theme_page(
[68] Fix | Delete
_x( 'Background', 'custom background' ),
[69] Fix | Delete
_x( 'Background', 'custom background' ),
[70] Fix | Delete
'edit_theme_options',
[71] Fix | Delete
'custom-background',
[72] Fix | Delete
array( $this, 'admin_page' )
[73] Fix | Delete
);
[74] Fix | Delete
[75] Fix | Delete
if ( ! $page ) {
[76] Fix | Delete
return;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
add_action( "load-{$page}", array( $this, 'admin_load' ) );
[80] Fix | Delete
add_action( "load-{$page}", array( $this, 'take_action' ), 49 );
[81] Fix | Delete
add_action( "load-{$page}", array( $this, 'handle_upload' ), 49 );
[82] Fix | Delete
[83] Fix | Delete
if ( $this->admin_header_callback ) {
[84] Fix | Delete
add_action( "admin_head-{$page}", $this->admin_header_callback, 51 );
[85] Fix | Delete
}
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
/**
[89] Fix | Delete
* Sets up the enqueue for the CSS & JavaScript files.
[90] Fix | Delete
*
[91] Fix | Delete
* @since 3.0.0
[92] Fix | Delete
*/
[93] Fix | Delete
public function admin_load() {
[94] Fix | Delete
get_current_screen()->add_help_tab(
[95] Fix | Delete
array(
[96] Fix | Delete
'id' => 'overview',
[97] Fix | Delete
'title' => __( 'Overview' ),
[98] Fix | Delete
'content' =>
[99] Fix | Delete
'<p>' . __( 'You can customize the look of your site without touching any of your theme&#8217;s code by using a custom background. Your background can be an image or a color.' ) . '</p>' .
[100] Fix | Delete
'<p>' . __( 'To use a background image, simply upload it or choose an image that has already been uploaded to your Media Library by clicking the &#8220;Choose Image&#8221; button. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.' ) . '</p>' .
[101] Fix | Delete
'<p>' . __( 'You can also choose a background color by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. &#8220;#ff0000&#8221; for red, or by choosing a color using the color picker.' ) . '</p>' .
[102] Fix | Delete
'<p>' . __( 'Do not forget to click on the Save Changes button when you are finished.' ) . '</p>',
[103] Fix | Delete
)
[104] Fix | Delete
);
[105] Fix | Delete
[106] Fix | Delete
get_current_screen()->set_help_sidebar(
[107] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[108] Fix | Delete
'<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Background_Screen">Documentation on Custom Background</a>' ) . '</p>' .
[109] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
[110] Fix | Delete
);
[111] Fix | Delete
[112] Fix | Delete
wp_enqueue_media();
[113] Fix | Delete
wp_enqueue_script( 'custom-background' );
[114] Fix | Delete
wp_enqueue_style( 'wp-color-picker' );
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
/**
[118] Fix | Delete
* Executes custom background modification.
[119] Fix | Delete
*
[120] Fix | Delete
* @since 3.0.0
[121] Fix | Delete
*/
[122] Fix | Delete
public function take_action() {
[123] Fix | Delete
if ( empty( $_POST ) ) {
[124] Fix | Delete
return;
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
if ( isset( $_POST['reset-background'] ) ) {
[128] Fix | Delete
check_admin_referer( 'custom-background-reset', '_wpnonce-custom-background-reset' );
[129] Fix | Delete
[130] Fix | Delete
remove_theme_mod( 'background_image' );
[131] Fix | Delete
remove_theme_mod( 'background_image_thumb' );
[132] Fix | Delete
[133] Fix | Delete
$this->updated = true;
[134] Fix | Delete
return;
[135] Fix | Delete
}
[136] Fix | Delete
[137] Fix | Delete
if ( isset( $_POST['remove-background'] ) ) {
[138] Fix | Delete
// @todo Uploaded files are not removed here.
[139] Fix | Delete
check_admin_referer( 'custom-background-remove', '_wpnonce-custom-background-remove' );
[140] Fix | Delete
[141] Fix | Delete
set_theme_mod( 'background_image', '' );
[142] Fix | Delete
set_theme_mod( 'background_image_thumb', '' );
[143] Fix | Delete
[144] Fix | Delete
$this->updated = true;
[145] Fix | Delete
wp_safe_redirect( $_POST['_wp_http_referer'] );
[146] Fix | Delete
return;
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
if ( isset( $_POST['background-preset'] ) ) {
[150] Fix | Delete
check_admin_referer( 'custom-background' );
[151] Fix | Delete
[152] Fix | Delete
if ( in_array( $_POST['background-preset'], array( 'default', 'fill', 'fit', 'repeat', 'custom' ), true ) ) {
[153] Fix | Delete
$preset = $_POST['background-preset'];
[154] Fix | Delete
} else {
[155] Fix | Delete
$preset = 'default';
[156] Fix | Delete
}
[157] Fix | Delete
[158] Fix | Delete
set_theme_mod( 'background_preset', $preset );
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
if ( isset( $_POST['background-position'] ) ) {
[162] Fix | Delete
check_admin_referer( 'custom-background' );
[163] Fix | Delete
[164] Fix | Delete
$position = explode( ' ', $_POST['background-position'] );
[165] Fix | Delete
[166] Fix | Delete
if ( in_array( $position[0], array( 'left', 'center', 'right' ), true ) ) {
[167] Fix | Delete
$position_x = $position[0];
[168] Fix | Delete
} else {
[169] Fix | Delete
$position_x = 'left';
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
if ( in_array( $position[1], array( 'top', 'center', 'bottom' ), true ) ) {
[173] Fix | Delete
$position_y = $position[1];
[174] Fix | Delete
} else {
[175] Fix | Delete
$position_y = 'top';
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
set_theme_mod( 'background_position_x', $position_x );
[179] Fix | Delete
set_theme_mod( 'background_position_y', $position_y );
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
if ( isset( $_POST['background-size'] ) ) {
[183] Fix | Delete
check_admin_referer( 'custom-background' );
[184] Fix | Delete
[185] Fix | Delete
if ( in_array( $_POST['background-size'], array( 'auto', 'contain', 'cover' ), true ) ) {
[186] Fix | Delete
$size = $_POST['background-size'];
[187] Fix | Delete
} else {
[188] Fix | Delete
$size = 'auto';
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
set_theme_mod( 'background_size', $size );
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
if ( isset( $_POST['background-repeat'] ) ) {
[195] Fix | Delete
check_admin_referer( 'custom-background' );
[196] Fix | Delete
[197] Fix | Delete
$repeat = $_POST['background-repeat'];
[198] Fix | Delete
[199] Fix | Delete
if ( 'no-repeat' !== $repeat ) {
[200] Fix | Delete
$repeat = 'repeat';
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
set_theme_mod( 'background_repeat', $repeat );
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
if ( isset( $_POST['background-attachment'] ) ) {
[207] Fix | Delete
check_admin_referer( 'custom-background' );
[208] Fix | Delete
[209] Fix | Delete
$attachment = $_POST['background-attachment'];
[210] Fix | Delete
[211] Fix | Delete
if ( 'fixed' !== $attachment ) {
[212] Fix | Delete
$attachment = 'scroll';
[213] Fix | Delete
}
[214] Fix | Delete
[215] Fix | Delete
set_theme_mod( 'background_attachment', $attachment );
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
if ( isset( $_POST['background-color'] ) ) {
[219] Fix | Delete
check_admin_referer( 'custom-background' );
[220] Fix | Delete
[221] Fix | Delete
$color = preg_replace( '/[^0-9a-fA-F]/', '', $_POST['background-color'] );
[222] Fix | Delete
[223] Fix | Delete
if ( strlen( $color ) === 6 || strlen( $color ) === 3 ) {
[224] Fix | Delete
set_theme_mod( 'background_color', $color );
[225] Fix | Delete
} else {
[226] Fix | Delete
set_theme_mod( 'background_color', '' );
[227] Fix | Delete
}
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
$this->updated = true;
[231] Fix | Delete
}
[232] Fix | Delete
[233] Fix | Delete
/**
[234] Fix | Delete
* Displays the custom background page.
[235] Fix | Delete
*
[236] Fix | Delete
* @since 3.0.0
[237] Fix | Delete
*/
[238] Fix | Delete
public function admin_page() {
[239] Fix | Delete
?>
[240] Fix | Delete
<div class="wrap" id="custom-background">
[241] Fix | Delete
<h1><?php _e( 'Custom Background' ); ?></h1>
[242] Fix | Delete
[243] Fix | Delete
<?php
[244] Fix | Delete
if ( current_user_can( 'customize' ) ) {
[245] Fix | Delete
$message = sprintf(
[246] Fix | Delete
/* translators: %s: URL to background image configuration in Customizer. */
[247] Fix | Delete
__( 'You can now manage and live-preview Custom Backgrounds in the <a href="%s">Customizer</a>.' ),
[248] Fix | Delete
admin_url( 'customize.php?autofocus[control]=background_image' )
[249] Fix | Delete
);
[250] Fix | Delete
wp_admin_notice(
[251] Fix | Delete
$message,
[252] Fix | Delete
array(
[253] Fix | Delete
'type' => 'info',
[254] Fix | Delete
'additional_classes' => array( 'hide-if-no-customize' ),
[255] Fix | Delete
)
[256] Fix | Delete
);
[257] Fix | Delete
}
[258] Fix | Delete
[259] Fix | Delete
if ( ! empty( $this->updated ) ) {
[260] Fix | Delete
$updated_message = sprintf(
[261] Fix | Delete
/* translators: %s: Home URL. */
[262] Fix | Delete
__( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ),
[263] Fix | Delete
esc_url( home_url( '/' ) )
[264] Fix | Delete
);
[265] Fix | Delete
wp_admin_notice(
[266] Fix | Delete
$updated_message,
[267] Fix | Delete
array(
[268] Fix | Delete
'id' => 'message',
[269] Fix | Delete
'additional_classes' => array( 'updated' ),
[270] Fix | Delete
)
[271] Fix | Delete
);
[272] Fix | Delete
}
[273] Fix | Delete
?>
[274] Fix | Delete
[275] Fix | Delete
<h2><?php _e( 'Background Image' ); ?></h2>
[276] Fix | Delete
[277] Fix | Delete
<table class="form-table" role="presentation">
[278] Fix | Delete
<tbody>
[279] Fix | Delete
<tr>
[280] Fix | Delete
<th scope="row"><?php _e( 'Preview' ); ?></th>
[281] Fix | Delete
<td>
[282] Fix | Delete
<?php
[283] Fix | Delete
if ( $this->admin_image_div_callback ) {
[284] Fix | Delete
call_user_func( $this->admin_image_div_callback );
[285] Fix | Delete
} else {
[286] Fix | Delete
$background_styles = '';
[287] Fix | Delete
$bgcolor = get_background_color();
[288] Fix | Delete
if ( $bgcolor ) {
[289] Fix | Delete
$background_styles .= 'background-color: ' . maybe_hash_hex_color( $bgcolor ) . ';';
[290] Fix | Delete
}
[291] Fix | Delete
[292] Fix | Delete
$background_image_thumb = get_background_image();
[293] Fix | Delete
if ( $background_image_thumb ) {
[294] Fix | Delete
$background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) );
[295] Fix | Delete
$background_position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
[296] Fix | Delete
$background_position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );
[297] Fix | Delete
$background_size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );
[298] Fix | Delete
$background_repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
[299] Fix | Delete
$background_attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
[300] Fix | Delete
[301] Fix | Delete
// Background-image URL must be single quote, see below.
[302] Fix | Delete
$background_styles .= " background-image: url('$background_image_thumb');"
[303] Fix | Delete
. " background-size: $background_size;"
[304] Fix | Delete
. " background-position: $background_position_x $background_position_y;"
[305] Fix | Delete
. " background-repeat: $background_repeat;"
[306] Fix | Delete
. " background-attachment: $background_attachment;";
[307] Fix | Delete
}
[308] Fix | Delete
?>
[309] Fix | Delete
<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // Must be double quote, see above. ?>
[310] Fix | Delete
<?php if ( $background_image_thumb ) { ?>
[311] Fix | Delete
<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br />
[312] Fix | Delete
<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" />
[313] Fix | Delete
<?php } ?>
[314] Fix | Delete
</div>
[315] Fix | Delete
<?php } ?>
[316] Fix | Delete
</td>
[317] Fix | Delete
</tr>
[318] Fix | Delete
[319] Fix | Delete
<?php if ( get_background_image() ) : ?>
[320] Fix | Delete
<tr>
[321] Fix | Delete
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
[322] Fix | Delete
<td>
[323] Fix | Delete
<form method="post">
[324] Fix | Delete
<?php wp_nonce_field( 'custom-background-remove', '_wpnonce-custom-background-remove' ); ?>
[325] Fix | Delete
<?php submit_button( __( 'Remove Background Image' ), '', 'remove-background', false ); ?><br />
[326] Fix | Delete
<?php _e( 'This will remove the background image. You will not be able to restore any customizations.' ); ?>
[327] Fix | Delete
</form>
[328] Fix | Delete
</td>
[329] Fix | Delete
</tr>
[330] Fix | Delete
<?php endif; ?>
[331] Fix | Delete
[332] Fix | Delete
<?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>
[333] Fix | Delete
<?php if ( $default_image && get_background_image() !== $default_image ) : ?>
[334] Fix | Delete
<tr>
[335] Fix | Delete
<th scope="row"><?php _e( 'Restore Original Image' ); ?></th>
[336] Fix | Delete
<td>
[337] Fix | Delete
<form method="post">
[338] Fix | Delete
<?php wp_nonce_field( 'custom-background-reset', '_wpnonce-custom-background-reset' ); ?>
[339] Fix | Delete
<?php submit_button( __( 'Restore Original Image' ), '', 'reset-background', false ); ?><br />
[340] Fix | Delete
<?php _e( 'This will restore the original background image. You will not be able to restore any customizations.' ); ?>
[341] Fix | Delete
</form>
[342] Fix | Delete
</td>
[343] Fix | Delete
</tr>
[344] Fix | Delete
<?php endif; ?>
[345] Fix | Delete
[346] Fix | Delete
<?php if ( current_user_can( 'upload_files' ) ) : ?>
[347] Fix | Delete
<tr>
[348] Fix | Delete
<th scope="row"><?php _e( 'Select Image' ); ?></th>
[349] Fix | Delete
<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post">
[350] Fix | Delete
<p>
[351] Fix | Delete
<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
[352] Fix | Delete
<input type="file" id="upload" name="import" />
[353] Fix | Delete
<input type="hidden" name="action" value="save" />
[354] Fix | Delete
<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
[355] Fix | Delete
<?php submit_button( _x( 'Upload', 'verb' ), '', 'submit', false ); ?>
[356] Fix | Delete
</p>
[357] Fix | Delete
<p>
[358] Fix | Delete
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
[359] Fix | Delete
<button id="choose-from-library-link" class="button"
[360] Fix | Delete
data-choose="<?php esc_attr_e( 'Choose a Background Image' ); ?>"
[361] Fix | Delete
data-update="<?php esc_attr_e( 'Set as background' ); ?>"><?php _e( 'Choose Image' ); ?></button>
[362] Fix | Delete
</p>
[363] Fix | Delete
</form>
[364] Fix | Delete
</td>
[365] Fix | Delete
</tr>
[366] Fix | Delete
<?php endif; ?>
[367] Fix | Delete
</tbody>
[368] Fix | Delete
</table>
[369] Fix | Delete
[370] Fix | Delete
<h2><?php _e( 'Display Options' ); ?></h2>
[371] Fix | Delete
<form method="post">
[372] Fix | Delete
<table class="form-table" role="presentation">
[373] Fix | Delete
<tbody>
[374] Fix | Delete
<?php if ( get_background_image() ) : ?>
[375] Fix | Delete
<input name="background-preset" type="hidden" value="custom">
[376] Fix | Delete
[377] Fix | Delete
<?php
[378] Fix | Delete
$background_position_title = __( 'Image Position' );
[379] Fix | Delete
[380] Fix | Delete
$background_position = sprintf(
[381] Fix | Delete
'%s %s',
[382] Fix | Delete
get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ),
[383] Fix | Delete
get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) )
[384] Fix | Delete
);
[385] Fix | Delete
[386] Fix | Delete
$background_position_options = array(
[387] Fix | Delete
array(
[388] Fix | Delete
'left top' => array(
[389] Fix | Delete
'label' => __( 'Top Left' ),
[390] Fix | Delete
'icon' => 'dashicons dashicons-arrow-left-alt',
[391] Fix | Delete
),
[392] Fix | Delete
'center top' => array(
[393] Fix | Delete
'label' => __( 'Top' ),
[394] Fix | Delete
'icon' => 'dashicons dashicons-arrow-up-alt',
[395] Fix | Delete
),
[396] Fix | Delete
'right top' => array(
[397] Fix | Delete
'label' => __( 'Top Right' ),
[398] Fix | Delete
'icon' => 'dashicons dashicons-arrow-right-alt',
[399] Fix | Delete
),
[400] Fix | Delete
),
[401] Fix | Delete
array(
[402] Fix | Delete
'left center' => array(
[403] Fix | Delete
'label' => __( 'Left' ),
[404] Fix | Delete
'icon' => 'dashicons dashicons-arrow-left-alt',
[405] Fix | Delete
),
[406] Fix | Delete
'center center' => array(
[407] Fix | Delete
'label' => __( 'Center' ),
[408] Fix | Delete
'icon' => 'background-position-center-icon',
[409] Fix | Delete
),
[410] Fix | Delete
'right center' => array(
[411] Fix | Delete
'label' => __( 'Right' ),
[412] Fix | Delete
'icon' => 'dashicons dashicons-arrow-right-alt',
[413] Fix | Delete
),
[414] Fix | Delete
),
[415] Fix | Delete
array(
[416] Fix | Delete
'left bottom' => array(
[417] Fix | Delete
'label' => __( 'Bottom Left' ),
[418] Fix | Delete
'icon' => 'dashicons dashicons-arrow-left-alt',
[419] Fix | Delete
),
[420] Fix | Delete
'center bottom' => array(
[421] Fix | Delete
'label' => __( 'Bottom' ),
[422] Fix | Delete
'icon' => 'dashicons dashicons-arrow-down-alt',
[423] Fix | Delete
),
[424] Fix | Delete
'right bottom' => array(
[425] Fix | Delete
'label' => __( 'Bottom Right' ),
[426] Fix | Delete
'icon' => 'dashicons dashicons-arrow-right-alt',
[427] Fix | Delete
),
[428] Fix | Delete
),
[429] Fix | Delete
);
[430] Fix | Delete
?>
[431] Fix | Delete
<tr>
[432] Fix | Delete
<th scope="row"><?php echo $background_position_title; ?></th>
[433] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_position_title; ?></span></legend>
[434] Fix | Delete
<div class="background-position-control">
[435] Fix | Delete
<?php foreach ( $background_position_options as $group ) : ?>
[436] Fix | Delete
<div class="button-group">
[437] Fix | Delete
<?php foreach ( $group as $value => $input ) : ?>
[438] Fix | Delete
<label>
[439] Fix | Delete
<input class="ui-helper-hidden-accessible" name="background-position" type="radio" value="<?php echo esc_attr( $value ); ?>"<?php checked( $value, $background_position ); ?>>
[440] Fix | Delete
<span class="button display-options position"><span class="<?php echo esc_attr( $input['icon'] ); ?>" aria-hidden="true"></span></span>
[441] Fix | Delete
<span class="screen-reader-text"><?php echo $input['label']; ?></span>
[442] Fix | Delete
</label>
[443] Fix | Delete
<?php endforeach; ?>
[444] Fix | Delete
</div>
[445] Fix | Delete
<?php endforeach; ?>
[446] Fix | Delete
</div>
[447] Fix | Delete
</fieldset></td>
[448] Fix | Delete
</tr>
[449] Fix | Delete
[450] Fix | Delete
<?php $image_size_title = __( 'Image Size' ); ?>
[451] Fix | Delete
<tr>
[452] Fix | Delete
<th scope="row"><label for="background-size"><?php echo $image_size_title; ?></label></th>
[453] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php echo $image_size_title; ?></span></legend>
[454] Fix | Delete
<select id="background-size" name="background-size">
[455] Fix | Delete
<option value="auto"<?php selected( 'auto', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _ex( 'Original', 'Original Size' ); ?></option>
[456] Fix | Delete
<option value="contain"<?php selected( 'contain', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fit to Screen' ); ?></option>
[457] Fix | Delete
<option value="cover"<?php selected( 'cover', get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ) ); ?>><?php _e( 'Fill Screen' ); ?></option>
[458] Fix | Delete
</select>
[459] Fix | Delete
</fieldset></td>
[460] Fix | Delete
</tr>
[461] Fix | Delete
[462] Fix | Delete
<?php $background_repeat_title = _x( 'Repeat', 'Background Repeat' ); ?>
[463] Fix | Delete
<tr>
[464] Fix | Delete
<th scope="row"><?php echo $background_repeat_title; ?></th>
[465] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_repeat_title; ?></span></legend>
[466] Fix | Delete
<input name="background-repeat" type="hidden" value="no-repeat">
[467] Fix | Delete
<label><input type="checkbox" name="background-repeat" value="repeat"<?php checked( 'repeat', get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) ); ?>> <?php _e( 'Repeat Background Image' ); ?></label>
[468] Fix | Delete
</fieldset></td>
[469] Fix | Delete
</tr>
[470] Fix | Delete
[471] Fix | Delete
<?php $background_scroll_title = _x( 'Scroll', 'Background Scroll' ); ?>
[472] Fix | Delete
<tr>
[473] Fix | Delete
<th scope="row"><?php echo $background_scroll_title; ?></th>
[474] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_scroll_title; ?></span></legend>
[475] Fix | Delete
<input name="background-attachment" type="hidden" value="fixed">
[476] Fix | Delete
<label><input name="background-attachment" type="checkbox" value="scroll" <?php checked( 'scroll', get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ) ); ?>> <?php _e( 'Scroll with Page' ); ?></label>
[477] Fix | Delete
</fieldset></td>
[478] Fix | Delete
</tr>
[479] Fix | Delete
<?php endif; // get_background_image() ?>
[480] Fix | Delete
[481] Fix | Delete
<?php $background_color_title = __( 'Background Color' ); ?>
[482] Fix | Delete
<tr>
[483] Fix | Delete
<th scope="row"><?php echo $background_color_title; ?></th>
[484] Fix | Delete
<td><fieldset><legend class="screen-reader-text"><span><?php echo $background_color_title; ?></span></legend>
[485] Fix | Delete
<?php
[486] Fix | Delete
$default_color = '';
[487] Fix | Delete
if ( current_theme_supports( 'custom-background', 'default-color' ) ) {
[488] Fix | Delete
$default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
[489] Fix | Delete
}
[490] Fix | Delete
?>
[491] Fix | Delete
<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color; ?>>
[492] Fix | Delete
</fieldset></td>
[493] Fix | Delete
</tr>
[494] Fix | Delete
</tbody>
[495] Fix | Delete
</table>
[496] Fix | Delete
[497] Fix | Delete
<?php wp_nonce_field( 'custom-background' ); ?>
[498] Fix | Delete
<?php submit_button( null, 'primary', 'save-background-options' ); ?>
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function