Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu...
File: class-wp-customize-manager.php
'theme_supports' => 'custom-background',
[5500] Fix | Delete
'sanitize_callback' => array( $this, '_sanitize_background_setting' ),
[5501] Fix | Delete
)
[5502] Fix | Delete
);
[5503] Fix | Delete
[5504] Fix | Delete
$this->add_control(
[5505] Fix | Delete
'background_preset',
[5506] Fix | Delete
array(
[5507] Fix | Delete
'label' => _x( 'Preset', 'Background Preset' ),
[5508] Fix | Delete
'section' => 'background_image',
[5509] Fix | Delete
'type' => 'select',
[5510] Fix | Delete
'choices' => array(
[5511] Fix | Delete
'default' => _x( 'Default', 'Default Preset' ),
[5512] Fix | Delete
'fill' => __( 'Fill Screen' ),
[5513] Fix | Delete
'fit' => __( 'Fit to Screen' ),
[5514] Fix | Delete
'repeat' => _x( 'Repeat', 'Repeat Image' ),
[5515] Fix | Delete
'custom' => _x( 'Custom', 'Custom Preset' ),
[5516] Fix | Delete
),
[5517] Fix | Delete
)
[5518] Fix | Delete
);
[5519] Fix | Delete
[5520] Fix | Delete
$this->add_setting(
[5521] Fix | Delete
'background_position_x',
[5522] Fix | Delete
array(
[5523] Fix | Delete
'default' => get_theme_support( 'custom-background', 'default-position-x' ),
[5524] Fix | Delete
'theme_supports' => 'custom-background',
[5525] Fix | Delete
'sanitize_callback' => array( $this, '_sanitize_background_setting' ),
[5526] Fix | Delete
)
[5527] Fix | Delete
);
[5528] Fix | Delete
[5529] Fix | Delete
$this->add_setting(
[5530] Fix | Delete
'background_position_y',
[5531] Fix | Delete
array(
[5532] Fix | Delete
'default' => get_theme_support( 'custom-background', 'default-position-y' ),
[5533] Fix | Delete
'theme_supports' => 'custom-background',
[5534] Fix | Delete
'sanitize_callback' => array( $this, '_sanitize_background_setting' ),
[5535] Fix | Delete
)
[5536] Fix | Delete
);
[5537] Fix | Delete
[5538] Fix | Delete
$this->add_control(
[5539] Fix | Delete
new WP_Customize_Background_Position_Control(
[5540] Fix | Delete
$this,
[5541] Fix | Delete
'background_position',
[5542] Fix | Delete
array(
[5543] Fix | Delete
'label' => __( 'Image Position' ),
[5544] Fix | Delete
'section' => 'background_image',
[5545] Fix | Delete
'settings' => array(
[5546] Fix | Delete
'x' => 'background_position_x',
[5547] Fix | Delete
'y' => 'background_position_y',
[5548] Fix | Delete
),
[5549] Fix | Delete
)
[5550] Fix | Delete
)
[5551] Fix | Delete
);
[5552] Fix | Delete
[5553] Fix | Delete
$this->add_setting(
[5554] Fix | Delete
'background_size',
[5555] Fix | Delete
array(
[5556] Fix | Delete
'default' => get_theme_support( 'custom-background', 'default-size' ),
[5557] Fix | Delete
'theme_supports' => 'custom-background',
[5558] Fix | Delete
'sanitize_callback' => array( $this, '_sanitize_background_setting' ),
[5559] Fix | Delete
)
[5560] Fix | Delete
);
[5561] Fix | Delete
[5562] Fix | Delete
$this->add_control(
[5563] Fix | Delete
'background_size',
[5564] Fix | Delete
array(
[5565] Fix | Delete
'label' => __( 'Image Size' ),
[5566] Fix | Delete
'section' => 'background_image',
[5567] Fix | Delete
'type' => 'select',
[5568] Fix | Delete
'choices' => array(
[5569] Fix | Delete
'auto' => _x( 'Original', 'Original Size' ),
[5570] Fix | Delete
'contain' => __( 'Fit to Screen' ),
[5571] Fix | Delete
'cover' => __( 'Fill Screen' ),
[5572] Fix | Delete
),
[5573] Fix | Delete
)
[5574] Fix | Delete
);
[5575] Fix | Delete
[5576] Fix | Delete
$this->add_setting(
[5577] Fix | Delete
'background_repeat',
[5578] Fix | Delete
array(
[5579] Fix | Delete
'default' => get_theme_support( 'custom-background', 'default-repeat' ),
[5580] Fix | Delete
'sanitize_callback' => array( $this, '_sanitize_background_setting' ),
[5581] Fix | Delete
'theme_supports' => 'custom-background',
[5582] Fix | Delete
)
[5583] Fix | Delete
);
[5584] Fix | Delete
[5585] Fix | Delete
$this->add_control(
[5586] Fix | Delete
'background_repeat',
[5587] Fix | Delete
array(
[5588] Fix | Delete
'label' => __( 'Repeat Background Image' ),
[5589] Fix | Delete
'section' => 'background_image',
[5590] Fix | Delete
'type' => 'checkbox',
[5591] Fix | Delete
)
[5592] Fix | Delete
);
[5593] Fix | Delete
[5594] Fix | Delete
$this->add_setting(
[5595] Fix | Delete
'background_attachment',
[5596] Fix | Delete
array(
[5597] Fix | Delete
'default' => get_theme_support( 'custom-background', 'default-attachment' ),
[5598] Fix | Delete
'sanitize_callback' => array( $this, '_sanitize_background_setting' ),
[5599] Fix | Delete
'theme_supports' => 'custom-background',
[5600] Fix | Delete
)
[5601] Fix | Delete
);
[5602] Fix | Delete
[5603] Fix | Delete
$this->add_control(
[5604] Fix | Delete
'background_attachment',
[5605] Fix | Delete
array(
[5606] Fix | Delete
'label' => __( 'Scroll with Page' ),
[5607] Fix | Delete
'section' => 'background_image',
[5608] Fix | Delete
'type' => 'checkbox',
[5609] Fix | Delete
)
[5610] Fix | Delete
);
[5611] Fix | Delete
[5612] Fix | Delete
/*
[5613] Fix | Delete
* If the theme is using the default background callback, we can update
[5614] Fix | Delete
* the background CSS using postMessage.
[5615] Fix | Delete
*/
[5616] Fix | Delete
if ( get_theme_support( 'custom-background', 'wp-head-callback' ) === '_custom_background_cb' ) {
[5617] Fix | Delete
foreach ( array( 'color', 'image', 'preset', 'position_x', 'position_y', 'size', 'repeat', 'attachment' ) as $prop ) {
[5618] Fix | Delete
$this->get_setting( 'background_' . $prop )->transport = 'postMessage';
[5619] Fix | Delete
}
[5620] Fix | Delete
}
[5621] Fix | Delete
[5622] Fix | Delete
/*
[5623] Fix | Delete
* Static Front Page
[5624] Fix | Delete
* See also https://core.trac.wordpress.org/ticket/19627 which introduces the static-front-page theme_support.
[5625] Fix | Delete
* The following replicates behavior from options-reading.php.
[5626] Fix | Delete
*/
[5627] Fix | Delete
[5628] Fix | Delete
$this->add_section(
[5629] Fix | Delete
'static_front_page',
[5630] Fix | Delete
array(
[5631] Fix | Delete
'title' => __( 'Homepage Settings' ),
[5632] Fix | Delete
'priority' => 120,
[5633] Fix | Delete
'description' => __( 'You can choose what’s displayed on the homepage of your site. It can be posts in reverse chronological order (classic blog), or a fixed/static page. To set a static homepage, you first need to create two Pages. One will become the homepage, and the other will be where your posts are displayed.' ),
[5634] Fix | Delete
'active_callback' => array( $this, 'has_published_pages' ),
[5635] Fix | Delete
)
[5636] Fix | Delete
);
[5637] Fix | Delete
[5638] Fix | Delete
$this->add_setting(
[5639] Fix | Delete
'show_on_front',
[5640] Fix | Delete
array(
[5641] Fix | Delete
'default' => get_option( 'show_on_front' ),
[5642] Fix | Delete
'capability' => 'manage_options',
[5643] Fix | Delete
'type' => 'option',
[5644] Fix | Delete
)
[5645] Fix | Delete
);
[5646] Fix | Delete
[5647] Fix | Delete
$this->add_control(
[5648] Fix | Delete
'show_on_front',
[5649] Fix | Delete
array(
[5650] Fix | Delete
'label' => __( 'Your homepage displays' ),
[5651] Fix | Delete
'section' => 'static_front_page',
[5652] Fix | Delete
'type' => 'radio',
[5653] Fix | Delete
'choices' => array(
[5654] Fix | Delete
'posts' => __( 'Your latest posts' ),
[5655] Fix | Delete
'page' => __( 'A static page' ),
[5656] Fix | Delete
),
[5657] Fix | Delete
)
[5658] Fix | Delete
);
[5659] Fix | Delete
[5660] Fix | Delete
$this->add_setting(
[5661] Fix | Delete
'page_on_front',
[5662] Fix | Delete
array(
[5663] Fix | Delete
'type' => 'option',
[5664] Fix | Delete
'capability' => 'manage_options',
[5665] Fix | Delete
)
[5666] Fix | Delete
);
[5667] Fix | Delete
[5668] Fix | Delete
$this->add_control(
[5669] Fix | Delete
'page_on_front',
[5670] Fix | Delete
array(
[5671] Fix | Delete
'label' => __( 'Homepage' ),
[5672] Fix | Delete
'section' => 'static_front_page',
[5673] Fix | Delete
'type' => 'dropdown-pages',
[5674] Fix | Delete
'allow_addition' => true,
[5675] Fix | Delete
)
[5676] Fix | Delete
);
[5677] Fix | Delete
[5678] Fix | Delete
$this->add_setting(
[5679] Fix | Delete
'page_for_posts',
[5680] Fix | Delete
array(
[5681] Fix | Delete
'type' => 'option',
[5682] Fix | Delete
'capability' => 'manage_options',
[5683] Fix | Delete
)
[5684] Fix | Delete
);
[5685] Fix | Delete
[5686] Fix | Delete
$this->add_control(
[5687] Fix | Delete
'page_for_posts',
[5688] Fix | Delete
array(
[5689] Fix | Delete
'label' => __( 'Posts page' ),
[5690] Fix | Delete
'section' => 'static_front_page',
[5691] Fix | Delete
'type' => 'dropdown-pages',
[5692] Fix | Delete
'allow_addition' => true,
[5693] Fix | Delete
)
[5694] Fix | Delete
);
[5695] Fix | Delete
[5696] Fix | Delete
/* Custom CSS */
[5697] Fix | Delete
$section_description = '<p>';
[5698] Fix | Delete
$section_description .= __( 'Add your own CSS code here to customize the appearance and layout of your site.' );
[5699] Fix | Delete
$section_description .= sprintf(
[5700] Fix | Delete
' <a href="%1$s" class="external-link" target="_blank">%2$s<span class="screen-reader-text"> %3$s</span></a>',
[5701] Fix | Delete
esc_url( __( 'https://developer.wordpress.org/advanced-administration/wordpress/css/' ) ),
[5702] Fix | Delete
__( 'Learn more about CSS' ),
[5703] Fix | Delete
/* translators: Hidden accessibility text. */
[5704] Fix | Delete
__( '(opens in a new tab)' )
[5705] Fix | Delete
);
[5706] Fix | Delete
$section_description .= '</p>';
[5707] Fix | Delete
[5708] Fix | Delete
$section_description .= '<p id="editor-keyboard-trap-help-1">' . __( 'When using a keyboard to navigate:' ) . '</p>';
[5709] Fix | Delete
$section_description .= '<ul>';
[5710] Fix | Delete
$section_description .= '<li id="editor-keyboard-trap-help-2">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>';
[5711] Fix | Delete
$section_description .= '<li id="editor-keyboard-trap-help-3">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>';
[5712] Fix | Delete
$section_description .= '<li id="editor-keyboard-trap-help-4">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>';
[5713] Fix | Delete
$section_description .= '</ul>';
[5714] Fix | Delete
[5715] Fix | Delete
if ( 'false' !== wp_get_current_user()->syntax_highlighting ) {
[5716] Fix | Delete
$section_description .= '<p>';
[5717] Fix | Delete
$section_description .= sprintf(
[5718] Fix | Delete
/* translators: 1: Link to user profile, 2: Additional link attributes, 3: Accessibility text. */
[5719] Fix | Delete
__( 'The edit field automatically highlights code syntax. You can disable this in your <a href="%1$s" %2$s>user profile%3$s</a> to work in plain text mode.' ),
[5720] Fix | Delete
esc_url( get_edit_profile_url() ),
[5721] Fix | Delete
'class="external-link" target="_blank"',
[5722] Fix | Delete
sprintf(
[5723] Fix | Delete
'<span class="screen-reader-text"> %s</span>',
[5724] Fix | Delete
/* translators: Hidden accessibility text. */
[5725] Fix | Delete
__( '(opens in a new tab)' )
[5726] Fix | Delete
)
[5727] Fix | Delete
);
[5728] Fix | Delete
$section_description .= '</p>';
[5729] Fix | Delete
}
[5730] Fix | Delete
[5731] Fix | Delete
$section_description .= '<p class="section-description-buttons">';
[5732] Fix | Delete
$section_description .= '<button type="button" class="button-link section-description-close">' . __( 'Close' ) . '</button>';
[5733] Fix | Delete
$section_description .= '</p>';
[5734] Fix | Delete
[5735] Fix | Delete
$this->add_section(
[5736] Fix | Delete
'custom_css',
[5737] Fix | Delete
array(
[5738] Fix | Delete
'title' => __( 'Additional CSS' ),
[5739] Fix | Delete
'priority' => 200,
[5740] Fix | Delete
'description_hidden' => true,
[5741] Fix | Delete
'description' => $section_description,
[5742] Fix | Delete
)
[5743] Fix | Delete
);
[5744] Fix | Delete
[5745] Fix | Delete
$custom_css_setting = new WP_Customize_Custom_CSS_Setting(
[5746] Fix | Delete
$this,
[5747] Fix | Delete
sprintf( 'custom_css[%s]', get_stylesheet() ),
[5748] Fix | Delete
array(
[5749] Fix | Delete
'capability' => 'edit_css',
[5750] Fix | Delete
'default' => '',
[5751] Fix | Delete
)
[5752] Fix | Delete
);
[5753] Fix | Delete
$this->add_setting( $custom_css_setting );
[5754] Fix | Delete
[5755] Fix | Delete
$this->add_control(
[5756] Fix | Delete
new WP_Customize_Code_Editor_Control(
[5757] Fix | Delete
$this,
[5758] Fix | Delete
'custom_css',
[5759] Fix | Delete
array(
[5760] Fix | Delete
'label' => __( 'CSS code' ),
[5761] Fix | Delete
'section' => 'custom_css',
[5762] Fix | Delete
'settings' => array( 'default' => $custom_css_setting->id ),
[5763] Fix | Delete
'code_type' => 'text/css',
[5764] Fix | Delete
'input_attrs' => array(
[5765] Fix | Delete
'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',
[5766] Fix | Delete
),
[5767] Fix | Delete
)
[5768] Fix | Delete
)
[5769] Fix | Delete
);
[5770] Fix | Delete
}
[5771] Fix | Delete
[5772] Fix | Delete
/**
[5773] Fix | Delete
* Returns whether there are published pages.
[5774] Fix | Delete
*
[5775] Fix | Delete
* Used as active callback for static front page section and controls.
[5776] Fix | Delete
*
[5777] Fix | Delete
* @since 4.7.0
[5778] Fix | Delete
*
[5779] Fix | Delete
* @return bool Whether there are published (or to be published) pages.
[5780] Fix | Delete
*/
[5781] Fix | Delete
public function has_published_pages() {
[5782] Fix | Delete
[5783] Fix | Delete
$setting = $this->get_setting( 'nav_menus_created_posts' );
[5784] Fix | Delete
if ( $setting ) {
[5785] Fix | Delete
foreach ( $setting->value() as $post_id ) {
[5786] Fix | Delete
if ( 'page' === get_post_type( $post_id ) ) {
[5787] Fix | Delete
return true;
[5788] Fix | Delete
}
[5789] Fix | Delete
}
[5790] Fix | Delete
}
[5791] Fix | Delete
[5792] Fix | Delete
return 0 !== count(
[5793] Fix | Delete
get_pages(
[5794] Fix | Delete
array(
[5795] Fix | Delete
'number' => 1,
[5796] Fix | Delete
'hierarchical' => 0,
[5797] Fix | Delete
)
[5798] Fix | Delete
)
[5799] Fix | Delete
);
[5800] Fix | Delete
}
[5801] Fix | Delete
[5802] Fix | Delete
/**
[5803] Fix | Delete
* Adds settings from the POST data that were not added with code, e.g. dynamically-created settings for Widgets
[5804] Fix | Delete
*
[5805] Fix | Delete
* @since 4.2.0
[5806] Fix | Delete
*
[5807] Fix | Delete
* @see add_dynamic_settings()
[5808] Fix | Delete
*/
[5809] Fix | Delete
public function register_dynamic_settings() {
[5810] Fix | Delete
$setting_ids = array_keys( $this->unsanitized_post_values() );
[5811] Fix | Delete
$this->add_dynamic_settings( $setting_ids );
[5812] Fix | Delete
}
[5813] Fix | Delete
[5814] Fix | Delete
/**
[5815] Fix | Delete
* Loads themes into the theme browsing/installation UI.
[5816] Fix | Delete
*
[5817] Fix | Delete
* @since 4.9.0
[5818] Fix | Delete
*/
[5819] Fix | Delete
public function handle_load_themes_request() {
[5820] Fix | Delete
check_ajax_referer( 'switch_themes', 'nonce' );
[5821] Fix | Delete
[5822] Fix | Delete
if ( ! current_user_can( 'switch_themes' ) ) {
[5823] Fix | Delete
wp_die( -1 );
[5824] Fix | Delete
}
[5825] Fix | Delete
[5826] Fix | Delete
if ( empty( $_POST['theme_action'] ) ) {
[5827] Fix | Delete
wp_send_json_error( 'missing_theme_action' );
[5828] Fix | Delete
}
[5829] Fix | Delete
$theme_action = sanitize_key( $_POST['theme_action'] );
[5830] Fix | Delete
$themes = array();
[5831] Fix | Delete
$args = array();
[5832] Fix | Delete
[5833] Fix | Delete
// Define query filters based on user input.
[5834] Fix | Delete
if ( ! array_key_exists( 'search', $_POST ) ) {
[5835] Fix | Delete
$args['search'] = '';
[5836] Fix | Delete
} else {
[5837] Fix | Delete
$args['search'] = sanitize_text_field( wp_unslash( $_POST['search'] ) );
[5838] Fix | Delete
}
[5839] Fix | Delete
[5840] Fix | Delete
if ( ! array_key_exists( 'tags', $_POST ) ) {
[5841] Fix | Delete
$args['tag'] = '';
[5842] Fix | Delete
} else {
[5843] Fix | Delete
$args['tag'] = array_map( 'sanitize_text_field', wp_unslash( (array) $_POST['tags'] ) );
[5844] Fix | Delete
}
[5845] Fix | Delete
[5846] Fix | Delete
if ( ! array_key_exists( 'page', $_POST ) ) {
[5847] Fix | Delete
$args['page'] = 1;
[5848] Fix | Delete
} else {
[5849] Fix | Delete
$args['page'] = absint( $_POST['page'] );
[5850] Fix | Delete
}
[5851] Fix | Delete
[5852] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/theme.php';
[5853] Fix | Delete
[5854] Fix | Delete
if ( 'installed' === $theme_action ) {
[5855] Fix | Delete
[5856] Fix | Delete
// Load all installed themes from wp_prepare_themes_for_js().
[5857] Fix | Delete
$themes = array( 'themes' => array() );
[5858] Fix | Delete
foreach ( wp_prepare_themes_for_js() as $theme ) {
[5859] Fix | Delete
$theme['type'] = 'installed';
[5860] Fix | Delete
$theme['active'] = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme['id'] );
[5861] Fix | Delete
$themes['themes'][] = $theme;
[5862] Fix | Delete
}
[5863] Fix | Delete
} elseif ( 'wporg' === $theme_action ) {
[5864] Fix | Delete
[5865] Fix | Delete
// Load WordPress.org themes from the .org API and normalize data to match installed theme objects.
[5866] Fix | Delete
if ( ! current_user_can( 'install_themes' ) ) {
[5867] Fix | Delete
wp_die( -1 );
[5868] Fix | Delete
}
[5869] Fix | Delete
[5870] Fix | Delete
// Arguments for all queries.
[5871] Fix | Delete
$wporg_args = array(
[5872] Fix | Delete
'per_page' => 100,
[5873] Fix | Delete
'fields' => array(
[5874] Fix | Delete
'reviews_url' => true, // Explicitly request the reviews URL to be linked from the customizer.
[5875] Fix | Delete
),
[5876] Fix | Delete
);
[5877] Fix | Delete
[5878] Fix | Delete
$args = array_merge( $wporg_args, $args );
[5879] Fix | Delete
[5880] Fix | Delete
if ( '' === $args['search'] && '' === $args['tag'] ) {
[5881] Fix | Delete
$args['browse'] = 'new'; // Sort by latest themes by default.
[5882] Fix | Delete
}
[5883] Fix | Delete
[5884] Fix | Delete
// Load themes from the .org API.
[5885] Fix | Delete
$themes = themes_api( 'query_themes', $args );
[5886] Fix | Delete
if ( is_wp_error( $themes ) ) {
[5887] Fix | Delete
wp_send_json_error();
[5888] Fix | Delete
}
[5889] Fix | Delete
[5890] Fix | Delete
// This list matches the allowed tags in wp-admin/includes/theme-install.php.
[5891] Fix | Delete
$themes_allowedtags = array_fill_keys(
[5892] Fix | Delete
array( 'a', 'abbr', 'acronym', 'code', 'pre', 'em', 'strong', 'div', 'p', 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'img' ),
[5893] Fix | Delete
array()
[5894] Fix | Delete
);
[5895] Fix | Delete
$themes_allowedtags['a'] = array_fill_keys( array( 'href', 'title', 'target' ), true );
[5896] Fix | Delete
$themes_allowedtags['acronym']['title'] = true;
[5897] Fix | Delete
$themes_allowedtags['abbr']['title'] = true;
[5898] Fix | Delete
$themes_allowedtags['img'] = array_fill_keys( array( 'src', 'class', 'alt' ), true );
[5899] Fix | Delete
[5900] Fix | Delete
// Prepare a list of installed themes to check against before the loop.
[5901] Fix | Delete
$installed_themes = array();
[5902] Fix | Delete
$wp_themes = wp_get_themes();
[5903] Fix | Delete
foreach ( $wp_themes as $theme ) {
[5904] Fix | Delete
$installed_themes[] = $theme->get_stylesheet();
[5905] Fix | Delete
}
[5906] Fix | Delete
$update_php = network_admin_url( 'update.php?action=install-theme' );
[5907] Fix | Delete
[5908] Fix | Delete
// Set up properties for themes available on WordPress.org.
[5909] Fix | Delete
foreach ( $themes->themes as &$theme ) {
[5910] Fix | Delete
$theme->install_url = add_query_arg(
[5911] Fix | Delete
array(
[5912] Fix | Delete
'theme' => $theme->slug,
[5913] Fix | Delete
'_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),
[5914] Fix | Delete
),
[5915] Fix | Delete
$update_php
[5916] Fix | Delete
);
[5917] Fix | Delete
[5918] Fix | Delete
$theme->name = wp_kses( $theme->name, $themes_allowedtags );
[5919] Fix | Delete
$theme->version = wp_kses( $theme->version, $themes_allowedtags );
[5920] Fix | Delete
$theme->description = wp_kses( $theme->description, $themes_allowedtags );
[5921] Fix | Delete
$theme->stars = wp_star_rating(
[5922] Fix | Delete
array(
[5923] Fix | Delete
'rating' => $theme->rating,
[5924] Fix | Delete
'type' => 'percent',
[5925] Fix | Delete
'number' => $theme->num_ratings,
[5926] Fix | Delete
'echo' => false,
[5927] Fix | Delete
)
[5928] Fix | Delete
);
[5929] Fix | Delete
$theme->num_ratings = number_format_i18n( $theme->num_ratings );
[5930] Fix | Delete
$theme->preview_url = set_url_scheme( $theme->preview_url );
[5931] Fix | Delete
[5932] Fix | Delete
// Handle themes that are already installed as installed themes.
[5933] Fix | Delete
if ( in_array( $theme->slug, $installed_themes, true ) ) {
[5934] Fix | Delete
$theme->type = 'installed';
[5935] Fix | Delete
} else {
[5936] Fix | Delete
$theme->type = $theme_action;
[5937] Fix | Delete
}
[5938] Fix | Delete
[5939] Fix | Delete
// Set active based on customized theme.
[5940] Fix | Delete
$theme->active = ( isset( $_POST['customized_theme'] ) && $_POST['customized_theme'] === $theme->slug );
[5941] Fix | Delete
[5942] Fix | Delete
// Map available theme properties to installed theme properties.
[5943] Fix | Delete
$theme->id = $theme->slug;
[5944] Fix | Delete
$theme->screenshot = array( $theme->screenshot_url );
[5945] Fix | Delete
$theme->authorAndUri = wp_kses( $theme->author['display_name'], $themes_allowedtags );
[5946] Fix | Delete
$theme->compatibleWP = is_wp_version_compatible( $theme->requires ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName
[5947] Fix | Delete
$theme->compatiblePHP = is_php_version_compatible( $theme->requires_php ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName
[5948] Fix | Delete
[5949] Fix | Delete
if ( isset( $theme->parent ) ) {
[5950] Fix | Delete
$theme->parent = $theme->parent['slug'];
[5951] Fix | Delete
} else {
[5952] Fix | Delete
$theme->parent = false;
[5953] Fix | Delete
}
[5954] Fix | Delete
unset( $theme->slug );
[5955] Fix | Delete
unset( $theme->screenshot_url );
[5956] Fix | Delete
unset( $theme->author );
[5957] Fix | Delete
} // End foreach().
[5958] Fix | Delete
} // End if().
[5959] Fix | Delete
[5960] Fix | Delete
/**
[5961] Fix | Delete
* Filters the theme data loaded in the customizer.
[5962] Fix | Delete
*
[5963] Fix | Delete
* This allows theme data to be loading from an external source,
[5964] Fix | Delete
* or modification of data loaded from `wp_prepare_themes_for_js()`
[5965] Fix | Delete
* or WordPress.org via `themes_api()`.
[5966] Fix | Delete
*
[5967] Fix | Delete
* @since 4.9.0
[5968] Fix | Delete
*
[5969] Fix | Delete
* @see wp_prepare_themes_for_js()
[5970] Fix | Delete
* @see themes_api()
[5971] Fix | Delete
* @see WP_Customize_Manager::__construct()
[5972] Fix | Delete
*
[5973] Fix | Delete
* @param array|stdClass $themes Nested array or object of theme data.
[5974] Fix | Delete
* @param array $args List of arguments, such as page, search term, and tags to query for.
[5975] Fix | Delete
* @param WP_Customize_Manager $manager Instance of Customize manager.
[5976] Fix | Delete
*/
[5977] Fix | Delete
$themes = apply_filters( 'customize_load_themes', $themes, $args, $this );
[5978] Fix | Delete
[5979] Fix | Delete
wp_send_json_success( $themes );
[5980] Fix | Delete
}
[5981] Fix | Delete
[5982] Fix | Delete
[5983] Fix | Delete
/**
[5984] Fix | Delete
* Callback for validating the header_textcolor value.
[5985] Fix | Delete
*
[5986] Fix | Delete
* Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash().
[5987] Fix | Delete
* Returns default text color if hex color is empty.
[5988] Fix | Delete
*
[5989] Fix | Delete
* @since 3.4.0
[5990] Fix | Delete
*
[5991] Fix | Delete
* @param string $color
[5992] Fix | Delete
* @return mixed
[5993] Fix | Delete
*/
[5994] Fix | Delete
public function _sanitize_header_textcolor( $color ) {
[5995] Fix | Delete
if ( 'blank' === $color ) {
[5996] Fix | Delete
return 'blank';
[5997] Fix | Delete
}
[5998] Fix | Delete
[5999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function