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
}
[500] Fix | Delete
[501] Fix | Delete
return '_default_wp_die_handler';
[502] Fix | Delete
}
[503] Fix | Delete
[504] Fix | Delete
/**
[505] Fix | Delete
* Starts preview and customize theme.
[506] Fix | Delete
*
[507] Fix | Delete
* Check if customize query variable exist. Init filters to filter the active theme.
[508] Fix | Delete
*
[509] Fix | Delete
* @since 3.4.0
[510] Fix | Delete
*
[511] Fix | Delete
* @global string $pagenow The filename of the current screen.
[512] Fix | Delete
*/
[513] Fix | Delete
public function setup_theme() {
[514] Fix | Delete
global $pagenow;
[515] Fix | Delete
[516] Fix | Delete
// Check permissions for customize.php access since this method is called before customize.php can run any code.
[517] Fix | Delete
if ( 'customize.php' === $pagenow && ! current_user_can( 'customize' ) ) {
[518] Fix | Delete
if ( ! is_user_logged_in() ) {
[519] Fix | Delete
auth_redirect();
[520] Fix | Delete
} else {
[521] Fix | Delete
wp_die(
[522] Fix | Delete
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
[523] Fix | Delete
'<p>' . __( 'Sorry, you are not allowed to customize this site.' ) . '</p>',
[524] Fix | Delete
403
[525] Fix | Delete
);
[526] Fix | Delete
}
[527] Fix | Delete
return;
[528] Fix | Delete
}
[529] Fix | Delete
[530] Fix | Delete
// If a changeset was provided is invalid.
[531] Fix | Delete
if ( isset( $this->_changeset_uuid ) && false !== $this->_changeset_uuid && ! wp_is_uuid( $this->_changeset_uuid ) ) {
[532] Fix | Delete
$this->wp_die( -1, __( 'Invalid changeset UUID' ) );
[533] Fix | Delete
}
[534] Fix | Delete
[535] Fix | Delete
/*
[536] Fix | Delete
* Clear incoming post data if the user lacks a CSRF token (nonce). Note that the customizer
[537] Fix | Delete
* application will inject the customize_preview_nonce query parameter into all Ajax requests.
[538] Fix | Delete
* For similar behavior elsewhere in WordPress, see rest_cookie_check_errors() which logs out
[539] Fix | Delete
* a user when a valid nonce isn't present.
[540] Fix | Delete
*/
[541] Fix | Delete
$has_post_data_nonce = (
[542] Fix | Delete
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'nonce', false )
[543] Fix | Delete
||
[544] Fix | Delete
check_ajax_referer( 'save-customize_' . $this->get_stylesheet(), 'nonce', false )
[545] Fix | Delete
||
[546] Fix | Delete
check_ajax_referer( 'preview-customize_' . $this->get_stylesheet(), 'customize_preview_nonce', false )
[547] Fix | Delete
);
[548] Fix | Delete
if ( ! current_user_can( 'customize' ) || ! $has_post_data_nonce ) {
[549] Fix | Delete
unset( $_POST['customized'] );
[550] Fix | Delete
unset( $_REQUEST['customized'] );
[551] Fix | Delete
}
[552] Fix | Delete
[553] Fix | Delete
/*
[554] Fix | Delete
* If unauthenticated then require a valid changeset UUID to load the preview.
[555] Fix | Delete
* In this way, the UUID serves as a secret key. If the messenger channel is present,
[556] Fix | Delete
* then send unauthenticated code to prompt re-auth.
[557] Fix | Delete
*/
[558] Fix | Delete
if ( ! current_user_can( 'customize' ) && ! $this->changeset_post_id() ) {
[559] Fix | Delete
$this->wp_die( $this->messenger_channel ? 0 : -1, __( 'Non-existent changeset UUID.' ) );
[560] Fix | Delete
}
[561] Fix | Delete
[562] Fix | Delete
if ( ! headers_sent() ) {
[563] Fix | Delete
send_origin_headers();
[564] Fix | Delete
}
[565] Fix | Delete
[566] Fix | Delete
// Hide the admin bar if we're embedded in the customizer iframe.
[567] Fix | Delete
if ( $this->messenger_channel ) {
[568] Fix | Delete
show_admin_bar( false );
[569] Fix | Delete
}
[570] Fix | Delete
[571] Fix | Delete
if ( $this->is_theme_active() ) {
[572] Fix | Delete
// Once the theme is loaded, we'll validate it.
[573] Fix | Delete
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ) );
[574] Fix | Delete
} else {
[575] Fix | Delete
/*
[576] Fix | Delete
* If the requested theme is not the active theme and the user doesn't have
[577] Fix | Delete
* the switch_themes cap, bail.
[578] Fix | Delete
*/
[579] Fix | Delete
if ( ! current_user_can( 'switch_themes' ) ) {
[580] Fix | Delete
$this->wp_die( -1, __( 'Sorry, you are not allowed to edit theme options on this site.' ) );
[581] Fix | Delete
}
[582] Fix | Delete
[583] Fix | Delete
// If the theme has errors while loading, bail.
[584] Fix | Delete
if ( $this->theme()->errors() ) {
[585] Fix | Delete
$this->wp_die( -1, $this->theme()->errors()->get_error_message() );
[586] Fix | Delete
}
[587] Fix | Delete
[588] Fix | Delete
// If the theme isn't allowed per multisite settings, bail.
[589] Fix | Delete
if ( ! $this->theme()->is_allowed() ) {
[590] Fix | Delete
$this->wp_die( -1, __( 'The requested theme does not exist.' ) );
[591] Fix | Delete
}
[592] Fix | Delete
}
[593] Fix | Delete
[594] Fix | Delete
// Make sure changeset UUID is established immediately after the theme is loaded.
[595] Fix | Delete
add_action( 'after_setup_theme', array( $this, 'establish_loaded_changeset' ), 5 );
[596] Fix | Delete
[597] Fix | Delete
/*
[598] Fix | Delete
* Import theme starter content for fresh installations when landing in the customizer.
[599] Fix | Delete
* Import starter content at after_setup_theme:100 so that any
[600] Fix | Delete
* add_theme_support( 'starter-content' ) calls will have been made.
[601] Fix | Delete
*/
[602] Fix | Delete
if ( get_option( 'fresh_site' ) && 'customize.php' === $pagenow ) {
[603] Fix | Delete
add_action( 'after_setup_theme', array( $this, 'import_theme_starter_content' ), 100 );
[604] Fix | Delete
}
[605] Fix | Delete
[606] Fix | Delete
$this->start_previewing_theme();
[607] Fix | Delete
}
[608] Fix | Delete
[609] Fix | Delete
/**
[610] Fix | Delete
* Establishes the loaded changeset.
[611] Fix | Delete
*
[612] Fix | Delete
* This method runs right at after_setup_theme and applies the 'customize_changeset_branching' filter to determine
[613] Fix | Delete
* whether concurrent changesets are allowed. Then if the Customizer is not initialized with a `changeset_uuid` param,
[614] Fix | Delete
* this method will determine which UUID should be used. If changeset branching is disabled, then the most saved
[615] Fix | Delete
* changeset will be loaded by default. Otherwise, if there are no existing saved changesets or if changeset branching is
[616] Fix | Delete
* enabled, then a new UUID will be generated.
[617] Fix | Delete
*
[618] Fix | Delete
* @since 4.9.0
[619] Fix | Delete
*
[620] Fix | Delete
* @global string $pagenow The filename of the current screen.
[621] Fix | Delete
*/
[622] Fix | Delete
public function establish_loaded_changeset() {
[623] Fix | Delete
global $pagenow;
[624] Fix | Delete
[625] Fix | Delete
if ( empty( $this->_changeset_uuid ) ) {
[626] Fix | Delete
$changeset_uuid = null;
[627] Fix | Delete
[628] Fix | Delete
if ( ! $this->branching() && $this->is_theme_active() ) {
[629] Fix | Delete
$unpublished_changeset_posts = $this->get_changeset_posts(
[630] Fix | Delete
array(
[631] Fix | Delete
'post_status' => array_diff( get_post_stati(), array( 'auto-draft', 'publish', 'trash', 'inherit', 'private' ) ),
[632] Fix | Delete
'exclude_restore_dismissed' => false,
[633] Fix | Delete
'author' => 'any',
[634] Fix | Delete
'posts_per_page' => 1,
[635] Fix | Delete
'order' => 'DESC',
[636] Fix | Delete
'orderby' => 'date',
[637] Fix | Delete
)
[638] Fix | Delete
);
[639] Fix | Delete
$unpublished_changeset_post = array_shift( $unpublished_changeset_posts );
[640] Fix | Delete
if ( ! empty( $unpublished_changeset_post ) && wp_is_uuid( $unpublished_changeset_post->post_name ) ) {
[641] Fix | Delete
$changeset_uuid = $unpublished_changeset_post->post_name;
[642] Fix | Delete
}
[643] Fix | Delete
}
[644] Fix | Delete
[645] Fix | Delete
// If no changeset UUID has been set yet, then generate a new one.
[646] Fix | Delete
if ( empty( $changeset_uuid ) ) {
[647] Fix | Delete
$changeset_uuid = wp_generate_uuid4();
[648] Fix | Delete
}
[649] Fix | Delete
[650] Fix | Delete
$this->_changeset_uuid = $changeset_uuid;
[651] Fix | Delete
}
[652] Fix | Delete
[653] Fix | Delete
if ( is_admin() && 'customize.php' === $pagenow ) {
[654] Fix | Delete
$this->set_changeset_lock( $this->changeset_post_id() );
[655] Fix | Delete
}
[656] Fix | Delete
}
[657] Fix | Delete
[658] Fix | Delete
/**
[659] Fix | Delete
* Callback to validate a theme once it is loaded
[660] Fix | Delete
*
[661] Fix | Delete
* @since 3.4.0
[662] Fix | Delete
*/
[663] Fix | Delete
public function after_setup_theme() {
[664] Fix | Delete
$doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_POST['customized'] ) );
[665] Fix | Delete
if ( ! $doing_ajax_or_is_customized && ! validate_current_theme() ) {
[666] Fix | Delete
wp_redirect( 'themes.php?broken=true' );
[667] Fix | Delete
exit;
[668] Fix | Delete
}
[669] Fix | Delete
}
[670] Fix | Delete
[671] Fix | Delete
/**
[672] Fix | Delete
* If the theme to be previewed isn't the active theme, add filter callbacks
[673] Fix | Delete
* to swap it out at runtime.
[674] Fix | Delete
*
[675] Fix | Delete
* @since 3.4.0
[676] Fix | Delete
*/
[677] Fix | Delete
public function start_previewing_theme() {
[678] Fix | Delete
// Bail if we're already previewing.
[679] Fix | Delete
if ( $this->is_preview() ) {
[680] Fix | Delete
return;
[681] Fix | Delete
}
[682] Fix | Delete
[683] Fix | Delete
$this->previewing = true;
[684] Fix | Delete
[685] Fix | Delete
if ( ! $this->is_theme_active() ) {
[686] Fix | Delete
add_filter( 'template', array( $this, 'get_template' ) );
[687] Fix | Delete
add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
[688] Fix | Delete
add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
[689] Fix | Delete
[690] Fix | Delete
// @link: https://core.trac.wordpress.org/ticket/20027
[691] Fix | Delete
add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
[692] Fix | Delete
add_filter( 'pre_option_template', array( $this, 'get_template' ) );
[693] Fix | Delete
[694] Fix | Delete
// Handle custom theme roots.
[695] Fix | Delete
add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
[696] Fix | Delete
add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
[697] Fix | Delete
}
[698] Fix | Delete
[699] Fix | Delete
/**
[700] Fix | Delete
* Fires once the Customizer theme preview has started.
[701] Fix | Delete
*
[702] Fix | Delete
* @since 3.4.0
[703] Fix | Delete
*
[704] Fix | Delete
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
[705] Fix | Delete
*/
[706] Fix | Delete
do_action( 'start_previewing_theme', $this );
[707] Fix | Delete
}
[708] Fix | Delete
[709] Fix | Delete
/**
[710] Fix | Delete
* Stops previewing the selected theme.
[711] Fix | Delete
*
[712] Fix | Delete
* Removes filters to change the active theme.
[713] Fix | Delete
*
[714] Fix | Delete
* @since 3.4.0
[715] Fix | Delete
*/
[716] Fix | Delete
public function stop_previewing_theme() {
[717] Fix | Delete
if ( ! $this->is_preview() ) {
[718] Fix | Delete
return;
[719] Fix | Delete
}
[720] Fix | Delete
[721] Fix | Delete
$this->previewing = false;
[722] Fix | Delete
[723] Fix | Delete
if ( ! $this->is_theme_active() ) {
[724] Fix | Delete
remove_filter( 'template', array( $this, 'get_template' ) );
[725] Fix | Delete
remove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
[726] Fix | Delete
remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
[727] Fix | Delete
[728] Fix | Delete
// @link: https://core.trac.wordpress.org/ticket/20027
[729] Fix | Delete
remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
[730] Fix | Delete
remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
[731] Fix | Delete
[732] Fix | Delete
// Handle custom theme roots.
[733] Fix | Delete
remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
[734] Fix | Delete
remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
[735] Fix | Delete
}
[736] Fix | Delete
[737] Fix | Delete
/**
[738] Fix | Delete
* Fires once the Customizer theme preview has stopped.
[739] Fix | Delete
*
[740] Fix | Delete
* @since 3.4.0
[741] Fix | Delete
*
[742] Fix | Delete
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
[743] Fix | Delete
*/
[744] Fix | Delete
do_action( 'stop_previewing_theme', $this );
[745] Fix | Delete
}
[746] Fix | Delete
[747] Fix | Delete
/**
[748] Fix | Delete
* Gets whether settings are or will be previewed.
[749] Fix | Delete
*
[750] Fix | Delete
* @since 4.9.0
[751] Fix | Delete
*
[752] Fix | Delete
* @see WP_Customize_Setting::preview()
[753] Fix | Delete
*
[754] Fix | Delete
* @return bool
[755] Fix | Delete
*/
[756] Fix | Delete
public function settings_previewed() {
[757] Fix | Delete
return $this->settings_previewed;
[758] Fix | Delete
}
[759] Fix | Delete
[760] Fix | Delete
/**
[761] Fix | Delete
* Gets whether data from a changeset's autosaved revision should be loaded if it exists.
[762] Fix | Delete
*
[763] Fix | Delete
* @since 4.9.0
[764] Fix | Delete
*
[765] Fix | Delete
* @see WP_Customize_Manager::changeset_data()
[766] Fix | Delete
*
[767] Fix | Delete
* @return bool Is using autosaved changeset revision.
[768] Fix | Delete
*/
[769] Fix | Delete
public function autosaved() {
[770] Fix | Delete
return $this->autosaved;
[771] Fix | Delete
}
[772] Fix | Delete
[773] Fix | Delete
/**
[774] Fix | Delete
* Whether the changeset branching is allowed.
[775] Fix | Delete
*
[776] Fix | Delete
* @since 4.9.0
[777] Fix | Delete
*
[778] Fix | Delete
* @see WP_Customize_Manager::establish_loaded_changeset()
[779] Fix | Delete
*
[780] Fix | Delete
* @return bool Is changeset branching.
[781] Fix | Delete
*/
[782] Fix | Delete
public function branching() {
[783] Fix | Delete
[784] Fix | Delete
/**
[785] Fix | Delete
* Filters whether or not changeset branching is allowed.
[786] Fix | Delete
*
[787] Fix | Delete
* By default in core, when changeset branching is not allowed, changesets will operate
[788] Fix | Delete
* linearly in that only one saved changeset will exist at a time (with a 'draft' or
[789] Fix | Delete
* 'future' status). This makes the Customizer operate in a way that is similar to going to
[790] Fix | Delete
* "edit" to one existing post: all users will be making changes to the same post, and autosave
[791] Fix | Delete
* revisions will be made for that post.
[792] Fix | Delete
*
[793] Fix | Delete
* By contrast, when changeset branching is allowed, then the model is like users going
[794] Fix | Delete
* to "add new" for a page and each user makes changes independently of each other since
[795] Fix | Delete
* they are all operating on their own separate pages, each getting their own separate
[796] Fix | Delete
* initial auto-drafts and then once initially saved, autosave revisions on top of that
[797] Fix | Delete
* user's specific post.
[798] Fix | Delete
*
[799] Fix | Delete
* Since linear changesets are deemed to be more suitable for the majority of WordPress users,
[800] Fix | Delete
* they are the default. For WordPress sites that have heavy site management in the Customizer
[801] Fix | Delete
* by multiple users then branching changesets should be enabled by means of this filter.
[802] Fix | Delete
*
[803] Fix | Delete
* @since 4.9.0
[804] Fix | Delete
*
[805] Fix | Delete
* @param bool $allow_branching Whether branching is allowed. If `false`, the default,
[806] Fix | Delete
* then only one saved changeset exists at a time.
[807] Fix | Delete
* @param WP_Customize_Manager $wp_customize Manager instance.
[808] Fix | Delete
*/
[809] Fix | Delete
$this->branching = apply_filters( 'customize_changeset_branching', $this->branching, $this );
[810] Fix | Delete
[811] Fix | Delete
return $this->branching;
[812] Fix | Delete
}
[813] Fix | Delete
[814] Fix | Delete
/**
[815] Fix | Delete
* Gets the changeset UUID.
[816] Fix | Delete
*
[817] Fix | Delete
* @since 4.7.0
[818] Fix | Delete
*
[819] Fix | Delete
* @see WP_Customize_Manager::establish_loaded_changeset()
[820] Fix | Delete
*
[821] Fix | Delete
* @return string UUID.
[822] Fix | Delete
*/
[823] Fix | Delete
public function changeset_uuid() {
[824] Fix | Delete
if ( empty( $this->_changeset_uuid ) ) {
[825] Fix | Delete
$this->establish_loaded_changeset();
[826] Fix | Delete
}
[827] Fix | Delete
return $this->_changeset_uuid;
[828] Fix | Delete
}
[829] Fix | Delete
[830] Fix | Delete
/**
[831] Fix | Delete
* Gets the theme being customized.
[832] Fix | Delete
*
[833] Fix | Delete
* @since 3.4.0
[834] Fix | Delete
*
[835] Fix | Delete
* @return WP_Theme
[836] Fix | Delete
*/
[837] Fix | Delete
public function theme() {
[838] Fix | Delete
if ( ! $this->theme ) {
[839] Fix | Delete
$this->theme = wp_get_theme();
[840] Fix | Delete
}
[841] Fix | Delete
return $this->theme;
[842] Fix | Delete
}
[843] Fix | Delete
[844] Fix | Delete
/**
[845] Fix | Delete
* Gets the registered settings.
[846] Fix | Delete
*
[847] Fix | Delete
* @since 3.4.0
[848] Fix | Delete
*
[849] Fix | Delete
* @return array
[850] Fix | Delete
*/
[851] Fix | Delete
public function settings() {
[852] Fix | Delete
return $this->settings;
[853] Fix | Delete
}
[854] Fix | Delete
[855] Fix | Delete
/**
[856] Fix | Delete
* Gets the registered controls.
[857] Fix | Delete
*
[858] Fix | Delete
* @since 3.4.0
[859] Fix | Delete
*
[860] Fix | Delete
* @return array
[861] Fix | Delete
*/
[862] Fix | Delete
public function controls() {
[863] Fix | Delete
return $this->controls;
[864] Fix | Delete
}
[865] Fix | Delete
[866] Fix | Delete
/**
[867] Fix | Delete
* Gets the registered containers.
[868] Fix | Delete
*
[869] Fix | Delete
* @since 4.0.0
[870] Fix | Delete
*
[871] Fix | Delete
* @return array
[872] Fix | Delete
*/
[873] Fix | Delete
public function containers() {
[874] Fix | Delete
return $this->containers;
[875] Fix | Delete
}
[876] Fix | Delete
[877] Fix | Delete
/**
[878] Fix | Delete
* Gets the registered sections.
[879] Fix | Delete
*
[880] Fix | Delete
* @since 3.4.0
[881] Fix | Delete
*
[882] Fix | Delete
* @return array
[883] Fix | Delete
*/
[884] Fix | Delete
public function sections() {
[885] Fix | Delete
return $this->sections;
[886] Fix | Delete
}
[887] Fix | Delete
[888] Fix | Delete
/**
[889] Fix | Delete
* Gets the registered panels.
[890] Fix | Delete
*
[891] Fix | Delete
* @since 4.0.0
[892] Fix | Delete
*
[893] Fix | Delete
* @return array Panels.
[894] Fix | Delete
*/
[895] Fix | Delete
public function panels() {
[896] Fix | Delete
return $this->panels;
[897] Fix | Delete
}
[898] Fix | Delete
[899] Fix | Delete
/**
[900] Fix | Delete
* Checks if the current theme is active.
[901] Fix | Delete
*
[902] Fix | Delete
* @since 3.4.0
[903] Fix | Delete
*
[904] Fix | Delete
* @return bool
[905] Fix | Delete
*/
[906] Fix | Delete
public function is_theme_active() {
[907] Fix | Delete
return $this->get_stylesheet() === $this->original_stylesheet;
[908] Fix | Delete
}
[909] Fix | Delete
[910] Fix | Delete
/**
[911] Fix | Delete
* Registers styles/scripts and initialize the preview of each setting
[912] Fix | Delete
*
[913] Fix | Delete
* @since 3.4.0
[914] Fix | Delete
*/
[915] Fix | Delete
public function wp_loaded() {
[916] Fix | Delete
[917] Fix | Delete
/*
[918] Fix | Delete
* Unconditionally register core types for panels, sections, and controls
[919] Fix | Delete
* in case plugin unhooks all customize_register actions.
[920] Fix | Delete
*/
[921] Fix | Delete
$this->register_panel_type( 'WP_Customize_Panel' );
[922] Fix | Delete
$this->register_panel_type( 'WP_Customize_Themes_Panel' );
[923] Fix | Delete
$this->register_section_type( 'WP_Customize_Section' );
[924] Fix | Delete
$this->register_section_type( 'WP_Customize_Sidebar_Section' );
[925] Fix | Delete
$this->register_section_type( 'WP_Customize_Themes_Section' );
[926] Fix | Delete
$this->register_control_type( 'WP_Customize_Color_Control' );
[927] Fix | Delete
$this->register_control_type( 'WP_Customize_Media_Control' );
[928] Fix | Delete
$this->register_control_type( 'WP_Customize_Upload_Control' );
[929] Fix | Delete
$this->register_control_type( 'WP_Customize_Image_Control' );
[930] Fix | Delete
$this->register_control_type( 'WP_Customize_Background_Image_Control' );
[931] Fix | Delete
$this->register_control_type( 'WP_Customize_Background_Position_Control' );
[932] Fix | Delete
$this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
[933] Fix | Delete
$this->register_control_type( 'WP_Customize_Site_Icon_Control' );
[934] Fix | Delete
$this->register_control_type( 'WP_Customize_Theme_Control' );
[935] Fix | Delete
$this->register_control_type( 'WP_Customize_Code_Editor_Control' );
[936] Fix | Delete
$this->register_control_type( 'WP_Customize_Date_Time_Control' );
[937] Fix | Delete
[938] Fix | Delete
/**
[939] Fix | Delete
* Fires once WordPress has loaded, allowing scripts and styles to be initialized.
[940] Fix | Delete
*
[941] Fix | Delete
* @since 3.4.0
[942] Fix | Delete
*
[943] Fix | Delete
* @param WP_Customize_Manager $manager WP_Customize_Manager instance.
[944] Fix | Delete
*/
[945] Fix | Delete
do_action( 'customize_register', $this );
[946] Fix | Delete
[947] Fix | Delete
if ( $this->settings_previewed() ) {
[948] Fix | Delete
foreach ( $this->settings as $setting ) {
[949] Fix | Delete
$setting->preview();
[950] Fix | Delete
}
[951] Fix | Delete
}
[952] Fix | Delete
[953] Fix | Delete
if ( $this->is_preview() && ! is_admin() ) {
[954] Fix | Delete
$this->customize_preview_init();
[955] Fix | Delete
}
[956] Fix | Delete
}
[957] Fix | Delete
[958] Fix | Delete
/**
[959] Fix | Delete
* Prevents Ajax requests from following redirects when previewing a theme
[960] Fix | Delete
* by issuing a 200 response instead of a 30x.
[961] Fix | Delete
*
[962] Fix | Delete
* Instead, the JS will sniff out the location header.
[963] Fix | Delete
*
[964] Fix | Delete
* @since 3.4.0
[965] Fix | Delete
* @deprecated 4.7.0
[966] Fix | Delete
*
[967] Fix | Delete
* @param int $status Status.
[968] Fix | Delete
* @return int
[969] Fix | Delete
*/
[970] Fix | Delete
public function wp_redirect_status( $status ) {
[971] Fix | Delete
_deprecated_function( __FUNCTION__, '4.7.0' );
[972] Fix | Delete
[973] Fix | Delete
if ( $this->is_preview() && ! is_admin() ) {
[974] Fix | Delete
return 200;
[975] Fix | Delete
}
[976] Fix | Delete
[977] Fix | Delete
return $status;
[978] Fix | Delete
}
[979] Fix | Delete
[980] Fix | Delete
/**
[981] Fix | Delete
* Finds the changeset post ID for a given changeset UUID.
[982] Fix | Delete
*
[983] Fix | Delete
* @since 4.7.0
[984] Fix | Delete
*
[985] Fix | Delete
* @param string $uuid Changeset UUID.
[986] Fix | Delete
* @return int|null Returns post ID on success and null on failure.
[987] Fix | Delete
*/
[988] Fix | Delete
public function find_changeset_post_id( $uuid ) {
[989] Fix | Delete
$cache_group = 'customize_changeset_post';
[990] Fix | Delete
$changeset_post_id = wp_cache_get( $uuid, $cache_group );
[991] Fix | Delete
if ( $changeset_post_id && 'customize_changeset' === get_post_type( $changeset_post_id ) ) {
[992] Fix | Delete
return $changeset_post_id;
[993] Fix | Delete
}
[994] Fix | Delete
[995] Fix | Delete
$changeset_post_query = new WP_Query(
[996] Fix | Delete
array(
[997] Fix | Delete
'post_type' => 'customize_changeset',
[998] Fix | Delete
'post_status' => get_post_stati(),
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function