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: theme.php
* @param string $old_name Old theme name.
[3500] Fix | Delete
* @param WP_Theme $old_theme WP_Theme instance of the old theme.
[3501] Fix | Delete
*/
[3502] Fix | Delete
do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme );
[3503] Fix | Delete
} else {
[3504] Fix | Delete
/** This action is documented in wp-includes/theme.php */
[3505] Fix | Delete
do_action( 'after_switch_theme', $stylesheet, $old_theme );
[3506] Fix | Delete
}
[3507] Fix | Delete
[3508] Fix | Delete
flush_rewrite_rules();
[3509] Fix | Delete
[3510] Fix | Delete
update_option( 'theme_switched', false );
[3511] Fix | Delete
}
[3512] Fix | Delete
}
[3513] Fix | Delete
[3514] Fix | Delete
/**
[3515] Fix | Delete
* Includes and instantiates the WP_Customize_Manager class.
[3516] Fix | Delete
*
[3517] Fix | Delete
* Loads the Customizer at plugins_loaded when accessing the customize.php admin
[3518] Fix | Delete
* page or when any request includes a wp_customize=on param or a customize_changeset
[3519] Fix | Delete
* param (a UUID). This param is a signal for whether to bootstrap the Customizer when
[3520] Fix | Delete
* WordPress is loading, especially in the Customizer preview
[3521] Fix | Delete
* or when making Customizer Ajax requests for widgets or menus.
[3522] Fix | Delete
*
[3523] Fix | Delete
* @since 3.4.0
[3524] Fix | Delete
*
[3525] Fix | Delete
* @global WP_Customize_Manager $wp_customize
[3526] Fix | Delete
*/
[3527] Fix | Delete
function _wp_customize_include() {
[3528] Fix | Delete
[3529] Fix | Delete
$is_customize_admin_page = ( is_admin() && 'customize.php' === basename( $_SERVER['PHP_SELF'] ) );
[3530] Fix | Delete
$should_include = (
[3531] Fix | Delete
$is_customize_admin_page
[3532] Fix | Delete
||
[3533] Fix | Delete
( isset( $_REQUEST['wp_customize'] ) && 'on' === $_REQUEST['wp_customize'] )
[3534] Fix | Delete
||
[3535] Fix | Delete
( ! empty( $_GET['customize_changeset_uuid'] ) || ! empty( $_POST['customize_changeset_uuid'] ) )
[3536] Fix | Delete
);
[3537] Fix | Delete
[3538] Fix | Delete
if ( ! $should_include ) {
[3539] Fix | Delete
return;
[3540] Fix | Delete
}
[3541] Fix | Delete
[3542] Fix | Delete
/*
[3543] Fix | Delete
* Note that wp_unslash() is not being used on the input vars because it is
[3544] Fix | Delete
* called before wp_magic_quotes() gets called. Besides this fact, none of
[3545] Fix | Delete
* the values should contain any characters needing slashes anyway.
[3546] Fix | Delete
*/
[3547] Fix | Delete
$keys = array(
[3548] Fix | Delete
'changeset_uuid',
[3549] Fix | Delete
'customize_changeset_uuid',
[3550] Fix | Delete
'customize_theme',
[3551] Fix | Delete
'theme',
[3552] Fix | Delete
'customize_messenger_channel',
[3553] Fix | Delete
'customize_autosaved',
[3554] Fix | Delete
);
[3555] Fix | Delete
$input_vars = array_merge(
[3556] Fix | Delete
wp_array_slice_assoc( $_GET, $keys ),
[3557] Fix | Delete
wp_array_slice_assoc( $_POST, $keys )
[3558] Fix | Delete
);
[3559] Fix | Delete
[3560] Fix | Delete
$theme = null;
[3561] Fix | Delete
$autosaved = null;
[3562] Fix | Delete
$messenger_channel = null;
[3563] Fix | Delete
[3564] Fix | Delete
/*
[3565] Fix | Delete
* Value false indicates UUID should be determined after_setup_theme
[3566] Fix | Delete
* to either re-use existing saved changeset or else generate a new UUID if none exists.
[3567] Fix | Delete
*/
[3568] Fix | Delete
$changeset_uuid = false;
[3569] Fix | Delete
[3570] Fix | Delete
/*
[3571] Fix | Delete
* Set initially to false since defaults to true for back-compat;
[3572] Fix | Delete
* can be overridden via the customize_changeset_branching filter.
[3573] Fix | Delete
*/
[3574] Fix | Delete
$branching = false;
[3575] Fix | Delete
[3576] Fix | Delete
if ( $is_customize_admin_page && isset( $input_vars['changeset_uuid'] ) ) {
[3577] Fix | Delete
$changeset_uuid = sanitize_key( $input_vars['changeset_uuid'] );
[3578] Fix | Delete
} elseif ( ! empty( $input_vars['customize_changeset_uuid'] ) ) {
[3579] Fix | Delete
$changeset_uuid = sanitize_key( $input_vars['customize_changeset_uuid'] );
[3580] Fix | Delete
}
[3581] Fix | Delete
[3582] Fix | Delete
// Note that theme will be sanitized via WP_Theme.
[3583] Fix | Delete
if ( $is_customize_admin_page && isset( $input_vars['theme'] ) ) {
[3584] Fix | Delete
$theme = $input_vars['theme'];
[3585] Fix | Delete
} elseif ( isset( $input_vars['customize_theme'] ) ) {
[3586] Fix | Delete
$theme = $input_vars['customize_theme'];
[3587] Fix | Delete
}
[3588] Fix | Delete
[3589] Fix | Delete
if ( ! empty( $input_vars['customize_autosaved'] ) ) {
[3590] Fix | Delete
$autosaved = true;
[3591] Fix | Delete
}
[3592] Fix | Delete
[3593] Fix | Delete
if ( isset( $input_vars['customize_messenger_channel'] ) ) {
[3594] Fix | Delete
$messenger_channel = sanitize_key( $input_vars['customize_messenger_channel'] );
[3595] Fix | Delete
}
[3596] Fix | Delete
[3597] Fix | Delete
/*
[3598] Fix | Delete
* Note that settings must be previewed even outside the customizer preview
[3599] Fix | Delete
* and also in the customizer pane itself. This is to enable loading an existing
[3600] Fix | Delete
* changeset into the customizer. Previewing the settings only has to be prevented
[3601] Fix | Delete
* here in the case of a customize_save action because this will cause WP to think
[3602] Fix | Delete
* there is nothing changed that needs to be saved.
[3603] Fix | Delete
*/
[3604] Fix | Delete
$is_customize_save_action = (
[3605] Fix | Delete
wp_doing_ajax()
[3606] Fix | Delete
&&
[3607] Fix | Delete
isset( $_REQUEST['action'] )
[3608] Fix | Delete
&&
[3609] Fix | Delete
'customize_save' === wp_unslash( $_REQUEST['action'] )
[3610] Fix | Delete
);
[3611] Fix | Delete
$settings_previewed = ! $is_customize_save_action;
[3612] Fix | Delete
[3613] Fix | Delete
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
[3614] Fix | Delete
$GLOBALS['wp_customize'] = new WP_Customize_Manager(
[3615] Fix | Delete
compact(
[3616] Fix | Delete
'changeset_uuid',
[3617] Fix | Delete
'theme',
[3618] Fix | Delete
'messenger_channel',
[3619] Fix | Delete
'settings_previewed',
[3620] Fix | Delete
'autosaved',
[3621] Fix | Delete
'branching'
[3622] Fix | Delete
)
[3623] Fix | Delete
);
[3624] Fix | Delete
}
[3625] Fix | Delete
[3626] Fix | Delete
/**
[3627] Fix | Delete
* Publishes a snapshot's changes.
[3628] Fix | Delete
*
[3629] Fix | Delete
* @since 4.7.0
[3630] Fix | Delete
* @access private
[3631] Fix | Delete
*
[3632] Fix | Delete
* @global WP_Customize_Manager $wp_customize Customizer instance.
[3633] Fix | Delete
*
[3634] Fix | Delete
* @param string $new_status New post status.
[3635] Fix | Delete
* @param string $old_status Old post status.
[3636] Fix | Delete
* @param WP_Post $changeset_post Changeset post object.
[3637] Fix | Delete
*/
[3638] Fix | Delete
function _wp_customize_publish_changeset( $new_status, $old_status, $changeset_post ) {
[3639] Fix | Delete
global $wp_customize;
[3640] Fix | Delete
[3641] Fix | Delete
$is_publishing_changeset = (
[3642] Fix | Delete
'customize_changeset' === $changeset_post->post_type
[3643] Fix | Delete
&&
[3644] Fix | Delete
'publish' === $new_status
[3645] Fix | Delete
&&
[3646] Fix | Delete
'publish' !== $old_status
[3647] Fix | Delete
);
[3648] Fix | Delete
if ( ! $is_publishing_changeset ) {
[3649] Fix | Delete
return;
[3650] Fix | Delete
}
[3651] Fix | Delete
[3652] Fix | Delete
if ( empty( $wp_customize ) ) {
[3653] Fix | Delete
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
[3654] Fix | Delete
$wp_customize = new WP_Customize_Manager(
[3655] Fix | Delete
array(
[3656] Fix | Delete
'changeset_uuid' => $changeset_post->post_name,
[3657] Fix | Delete
'settings_previewed' => false,
[3658] Fix | Delete
)
[3659] Fix | Delete
);
[3660] Fix | Delete
}
[3661] Fix | Delete
[3662] Fix | Delete
if ( ! did_action( 'customize_register' ) ) {
[3663] Fix | Delete
/*
[3664] Fix | Delete
* When running from CLI or Cron, the customize_register action will need
[3665] Fix | Delete
* to be triggered in order for core, themes, and plugins to register their
[3666] Fix | Delete
* settings. Normally core will add_action( 'customize_register' ) at
[3667] Fix | Delete
* priority 10 to register the core settings, and if any themes/plugins
[3668] Fix | Delete
* also add_action( 'customize_register' ) at the same priority, they
[3669] Fix | Delete
* will have a $wp_customize with those settings registered since they
[3670] Fix | Delete
* call add_action() afterward, normally. However, when manually doing
[3671] Fix | Delete
* the customize_register action after the setup_theme, then the order
[3672] Fix | Delete
* will be reversed for two actions added at priority 10, resulting in
[3673] Fix | Delete
* the core settings no longer being available as expected to themes/plugins.
[3674] Fix | Delete
* So the following manually calls the method that registers the core
[3675] Fix | Delete
* settings up front before doing the action.
[3676] Fix | Delete
*/
[3677] Fix | Delete
remove_action( 'customize_register', array( $wp_customize, 'register_controls' ) );
[3678] Fix | Delete
$wp_customize->register_controls();
[3679] Fix | Delete
[3680] Fix | Delete
/** This filter is documented in wp-includes/class-wp-customize-manager.php */
[3681] Fix | Delete
do_action( 'customize_register', $wp_customize );
[3682] Fix | Delete
}
[3683] Fix | Delete
$wp_customize->_publish_changeset_values( $changeset_post->ID );
[3684] Fix | Delete
[3685] Fix | Delete
/*
[3686] Fix | Delete
* Trash the changeset post if revisions are not enabled. Unpublished
[3687] Fix | Delete
* changesets by default get garbage collected due to the auto-draft status.
[3688] Fix | Delete
* When a changeset post is published, however, it would no longer get cleaned
[3689] Fix | Delete
* out. This is a problem when the changeset posts are never displayed anywhere,
[3690] Fix | Delete
* since they would just be endlessly piling up. So here we use the revisions
[3691] Fix | Delete
* feature to indicate whether or not a published changeset should get trashed
[3692] Fix | Delete
* and thus garbage collected.
[3693] Fix | Delete
*/
[3694] Fix | Delete
if ( ! wp_revisions_enabled( $changeset_post ) ) {
[3695] Fix | Delete
$wp_customize->trash_changeset_post( $changeset_post->ID );
[3696] Fix | Delete
}
[3697] Fix | Delete
}
[3698] Fix | Delete
[3699] Fix | Delete
/**
[3700] Fix | Delete
* Filters changeset post data upon insert to ensure post_name is intact.
[3701] Fix | Delete
*
[3702] Fix | Delete
* This is needed to prevent the post_name from being dropped when the post is
[3703] Fix | Delete
* transitioned into pending status by a contributor.
[3704] Fix | Delete
*
[3705] Fix | Delete
* @since 4.7.0
[3706] Fix | Delete
*
[3707] Fix | Delete
* @see wp_insert_post()
[3708] Fix | Delete
*
[3709] Fix | Delete
* @param array $post_data An array of slashed post data.
[3710] Fix | Delete
* @param array $supplied_post_data An array of sanitized, but otherwise unmodified post data.
[3711] Fix | Delete
* @return array Filtered data.
[3712] Fix | Delete
*/
[3713] Fix | Delete
function _wp_customize_changeset_filter_insert_post_data( $post_data, $supplied_post_data ) {
[3714] Fix | Delete
if ( isset( $post_data['post_type'] ) && 'customize_changeset' === $post_data['post_type'] ) {
[3715] Fix | Delete
[3716] Fix | Delete
// Prevent post_name from being dropped, such as when contributor saves a changeset post as pending.
[3717] Fix | Delete
if ( empty( $post_data['post_name'] ) && ! empty( $supplied_post_data['post_name'] ) ) {
[3718] Fix | Delete
$post_data['post_name'] = $supplied_post_data['post_name'];
[3719] Fix | Delete
}
[3720] Fix | Delete
}
[3721] Fix | Delete
return $post_data;
[3722] Fix | Delete
}
[3723] Fix | Delete
[3724] Fix | Delete
/**
[3725] Fix | Delete
* Adds settings for the customize-loader script.
[3726] Fix | Delete
*
[3727] Fix | Delete
* @since 3.4.0
[3728] Fix | Delete
*/
[3729] Fix | Delete
function _wp_customize_loader_settings() {
[3730] Fix | Delete
$admin_origin = parse_url( admin_url() );
[3731] Fix | Delete
$home_origin = parse_url( home_url() );
[3732] Fix | Delete
$cross_domain = ( strtolower( $admin_origin['host'] ) !== strtolower( $home_origin['host'] ) );
[3733] Fix | Delete
[3734] Fix | Delete
$browser = array(
[3735] Fix | Delete
'mobile' => wp_is_mobile(),
[3736] Fix | Delete
'ios' => wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ),
[3737] Fix | Delete
);
[3738] Fix | Delete
[3739] Fix | Delete
$settings = array(
[3740] Fix | Delete
'url' => esc_url( admin_url( 'customize.php' ) ),
[3741] Fix | Delete
'isCrossDomain' => $cross_domain,
[3742] Fix | Delete
'browser' => $browser,
[3743] Fix | Delete
'l10n' => array(
[3744] Fix | Delete
'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ),
[3745] Fix | Delete
'mainIframeTitle' => __( 'Customizer' ),
[3746] Fix | Delete
),
[3747] Fix | Delete
);
[3748] Fix | Delete
[3749] Fix | Delete
$script = 'var _wpCustomizeLoaderSettings = ' . wp_json_encode( $settings ) . ';';
[3750] Fix | Delete
[3751] Fix | Delete
$wp_scripts = wp_scripts();
[3752] Fix | Delete
$data = $wp_scripts->get_data( 'customize-loader', 'data' );
[3753] Fix | Delete
if ( $data ) {
[3754] Fix | Delete
$script = "$data\n$script";
[3755] Fix | Delete
}
[3756] Fix | Delete
[3757] Fix | Delete
$wp_scripts->add_data( 'customize-loader', 'data', $script );
[3758] Fix | Delete
}
[3759] Fix | Delete
[3760] Fix | Delete
/**
[3761] Fix | Delete
* Returns a URL to load the Customizer.
[3762] Fix | Delete
*
[3763] Fix | Delete
* @since 3.4.0
[3764] Fix | Delete
*
[3765] Fix | Delete
* @param string $stylesheet Optional. Theme to customize. Defaults to active theme.
[3766] Fix | Delete
* The theme's stylesheet will be urlencoded if necessary.
[3767] Fix | Delete
* @return string
[3768] Fix | Delete
*/
[3769] Fix | Delete
function wp_customize_url( $stylesheet = '' ) {
[3770] Fix | Delete
$url = admin_url( 'customize.php' );
[3771] Fix | Delete
if ( $stylesheet ) {
[3772] Fix | Delete
$url .= '?theme=' . urlencode( $stylesheet );
[3773] Fix | Delete
}
[3774] Fix | Delete
return esc_url( $url );
[3775] Fix | Delete
}
[3776] Fix | Delete
[3777] Fix | Delete
/**
[3778] Fix | Delete
* Prints a script to check whether or not the Customizer is supported,
[3779] Fix | Delete
* and apply either the no-customize-support or customize-support class
[3780] Fix | Delete
* to the body.
[3781] Fix | Delete
*
[3782] Fix | Delete
* This function MUST be called inside the body tag.
[3783] Fix | Delete
*
[3784] Fix | Delete
* Ideally, call this function immediately after the body tag is opened.
[3785] Fix | Delete
* This prevents a flash of unstyled content.
[3786] Fix | Delete
*
[3787] Fix | Delete
* It is also recommended that you add the "no-customize-support" class
[3788] Fix | Delete
* to the body tag by default.
[3789] Fix | Delete
*
[3790] Fix | Delete
* @since 3.4.0
[3791] Fix | Delete
* @since 4.7.0 Support for IE8 and below is explicitly removed via conditional comments.
[3792] Fix | Delete
* @since 5.5.0 IE8 and older are no longer supported.
[3793] Fix | Delete
*/
[3794] Fix | Delete
function wp_customize_support_script() {
[3795] Fix | Delete
$admin_origin = parse_url( admin_url() );
[3796] Fix | Delete
$home_origin = parse_url( home_url() );
[3797] Fix | Delete
$cross_domain = ( strtolower( $admin_origin['host'] ) !== strtolower( $home_origin['host'] ) );
[3798] Fix | Delete
ob_start();
[3799] Fix | Delete
?>
[3800] Fix | Delete
<script>
[3801] Fix | Delete
(function() {
[3802] Fix | Delete
var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');
[3803] Fix | Delete
[3804] Fix | Delete
<?php if ( $cross_domain ) : ?>
[3805] Fix | Delete
request = (function(){ var xhr = new XMLHttpRequest(); return ('withCredentials' in xhr); })();
[3806] Fix | Delete
<?php else : ?>
[3807] Fix | Delete
request = true;
[3808] Fix | Delete
<?php endif; ?>
[3809] Fix | Delete
[3810] Fix | Delete
b[c] = b[c].replace( rcs, ' ' );
[3811] Fix | Delete
// The customizer requires postMessage and CORS (if the site is cross domain).
[3812] Fix | Delete
b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;
[3813] Fix | Delete
}());
[3814] Fix | Delete
</script>
[3815] Fix | Delete
<?php
[3816] Fix | Delete
wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
[3817] Fix | Delete
}
[3818] Fix | Delete
[3819] Fix | Delete
/**
[3820] Fix | Delete
* Whether the site is being previewed in the Customizer.
[3821] Fix | Delete
*
[3822] Fix | Delete
* @since 4.0.0
[3823] Fix | Delete
*
[3824] Fix | Delete
* @global WP_Customize_Manager $wp_customize Customizer instance.
[3825] Fix | Delete
*
[3826] Fix | Delete
* @return bool True if the site is being previewed in the Customizer, false otherwise.
[3827] Fix | Delete
*/
[3828] Fix | Delete
function is_customize_preview() {
[3829] Fix | Delete
global $wp_customize;
[3830] Fix | Delete
[3831] Fix | Delete
return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
[3832] Fix | Delete
}
[3833] Fix | Delete
[3834] Fix | Delete
/**
[3835] Fix | Delete
* Makes sure that auto-draft posts get their post_date bumped or status changed
[3836] Fix | Delete
* to draft to prevent premature garbage-collection.
[3837] Fix | Delete
*
[3838] Fix | Delete
* When a changeset is updated but remains an auto-draft, ensure the post_date
[3839] Fix | Delete
* for the auto-draft posts remains the same so that it will be
[3840] Fix | Delete
* garbage-collected at the same time by `wp_delete_auto_drafts()`. Otherwise,
[3841] Fix | Delete
* if the changeset is updated to be a draft then update the posts
[3842] Fix | Delete
* to have a far-future post_date so that they will never be garbage collected
[3843] Fix | Delete
* unless the changeset post itself is deleted.
[3844] Fix | Delete
*
[3845] Fix | Delete
* When a changeset is updated to be a persistent draft or to be scheduled for
[3846] Fix | Delete
* publishing, then transition any dependent auto-drafts to a draft status so
[3847] Fix | Delete
* that they likewise will not be garbage-collected but also so that they can
[3848] Fix | Delete
* be edited in the admin before publishing since there is not yet a post/page
[3849] Fix | Delete
* editing flow in the Customizer. See #39752.
[3850] Fix | Delete
*
[3851] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/39752
[3852] Fix | Delete
*
[3853] Fix | Delete
* @since 4.8.0
[3854] Fix | Delete
* @access private
[3855] Fix | Delete
* @see wp_delete_auto_drafts()
[3856] Fix | Delete
*
[3857] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[3858] Fix | Delete
*
[3859] Fix | Delete
* @param string $new_status Transition to this post status.
[3860] Fix | Delete
* @param string $old_status Previous post status.
[3861] Fix | Delete
* @param \WP_Post $post Post data.
[3862] Fix | Delete
*/
[3863] Fix | Delete
function _wp_keep_alive_customize_changeset_dependent_auto_drafts( $new_status, $old_status, $post ) {
[3864] Fix | Delete
global $wpdb;
[3865] Fix | Delete
unset( $old_status );
[3866] Fix | Delete
[3867] Fix | Delete
// Short-circuit if not a changeset or if the changeset was published.
[3868] Fix | Delete
if ( 'customize_changeset' !== $post->post_type || 'publish' === $new_status ) {
[3869] Fix | Delete
return;
[3870] Fix | Delete
}
[3871] Fix | Delete
[3872] Fix | Delete
$data = json_decode( $post->post_content, true );
[3873] Fix | Delete
if ( empty( $data['nav_menus_created_posts']['value'] ) ) {
[3874] Fix | Delete
return;
[3875] Fix | Delete
}
[3876] Fix | Delete
[3877] Fix | Delete
/*
[3878] Fix | Delete
* Actually, in lieu of keeping alive, trash any customization drafts here if the changeset itself is
[3879] Fix | Delete
* getting trashed. This is needed because when a changeset transitions to a draft, then any of the
[3880] Fix | Delete
* dependent auto-draft post/page stubs will also get transitioned to customization drafts which
[3881] Fix | Delete
* are then visible in the WP Admin. We cannot wait for the deletion of the changeset in which
[3882] Fix | Delete
* _wp_delete_customize_changeset_dependent_auto_drafts() will be called, since they need to be
[3883] Fix | Delete
* trashed to remove from visibility immediately.
[3884] Fix | Delete
*/
[3885] Fix | Delete
if ( 'trash' === $new_status ) {
[3886] Fix | Delete
foreach ( $data['nav_menus_created_posts']['value'] as $post_id ) {
[3887] Fix | Delete
if ( ! empty( $post_id ) && 'draft' === get_post_status( $post_id ) ) {
[3888] Fix | Delete
wp_trash_post( $post_id );
[3889] Fix | Delete
}
[3890] Fix | Delete
}
[3891] Fix | Delete
return;
[3892] Fix | Delete
}
[3893] Fix | Delete
[3894] Fix | Delete
$post_args = array();
[3895] Fix | Delete
if ( 'auto-draft' === $new_status ) {
[3896] Fix | Delete
/*
[3897] Fix | Delete
* Keep the post date for the post matching the changeset
[3898] Fix | Delete
* so that it will not be garbage-collected before the changeset.
[3899] Fix | Delete
*/
[3900] Fix | Delete
$post_args['post_date'] = $post->post_date; // Note wp_delete_auto_drafts() only looks at this date.
[3901] Fix | Delete
} else {
[3902] Fix | Delete
/*
[3903] Fix | Delete
* Since the changeset no longer has an auto-draft (and it is not published)
[3904] Fix | Delete
* it is now a persistent changeset, a long-lived draft, and so any
[3905] Fix | Delete
* associated auto-draft posts should likewise transition into having a draft
[3906] Fix | Delete
* status. These drafts will be treated differently than regular drafts in
[3907] Fix | Delete
* that they will be tied to the given changeset. The publish meta box is
[3908] Fix | Delete
* replaced with a notice about how the post is part of a set of customized changes
[3909] Fix | Delete
* which will be published when the changeset is published.
[3910] Fix | Delete
*/
[3911] Fix | Delete
$post_args['post_status'] = 'draft';
[3912] Fix | Delete
}
[3913] Fix | Delete
[3914] Fix | Delete
foreach ( $data['nav_menus_created_posts']['value'] as $post_id ) {
[3915] Fix | Delete
if ( empty( $post_id ) || 'auto-draft' !== get_post_status( $post_id ) ) {
[3916] Fix | Delete
continue;
[3917] Fix | Delete
}
[3918] Fix | Delete
$wpdb->update(
[3919] Fix | Delete
$wpdb->posts,
[3920] Fix | Delete
$post_args,
[3921] Fix | Delete
array( 'ID' => $post_id )
[3922] Fix | Delete
);
[3923] Fix | Delete
clean_post_cache( $post_id );
[3924] Fix | Delete
}
[3925] Fix | Delete
}
[3926] Fix | Delete
[3927] Fix | Delete
/**
[3928] Fix | Delete
* Creates the initial theme features when the 'setup_theme' action is fired.
[3929] Fix | Delete
*
[3930] Fix | Delete
* See {@see 'setup_theme'}.
[3931] Fix | Delete
*
[3932] Fix | Delete
* @since 5.5.0
[3933] Fix | Delete
* @since 6.0.1 The `block-templates` feature was added.
[3934] Fix | Delete
*/
[3935] Fix | Delete
function create_initial_theme_features() {
[3936] Fix | Delete
register_theme_feature(
[3937] Fix | Delete
'align-wide',
[3938] Fix | Delete
array(
[3939] Fix | Delete
'description' => __( 'Whether theme opts in to wide alignment CSS class.' ),
[3940] Fix | Delete
'show_in_rest' => true,
[3941] Fix | Delete
)
[3942] Fix | Delete
);
[3943] Fix | Delete
register_theme_feature(
[3944] Fix | Delete
'automatic-feed-links',
[3945] Fix | Delete
array(
[3946] Fix | Delete
'description' => __( 'Whether posts and comments RSS feed links are added to head.' ),
[3947] Fix | Delete
'show_in_rest' => true,
[3948] Fix | Delete
)
[3949] Fix | Delete
);
[3950] Fix | Delete
register_theme_feature(
[3951] Fix | Delete
'block-templates',
[3952] Fix | Delete
array(
[3953] Fix | Delete
'description' => __( 'Whether a theme uses block-based templates.' ),
[3954] Fix | Delete
'show_in_rest' => true,
[3955] Fix | Delete
)
[3956] Fix | Delete
);
[3957] Fix | Delete
register_theme_feature(
[3958] Fix | Delete
'block-template-parts',
[3959] Fix | Delete
array(
[3960] Fix | Delete
'description' => __( 'Whether a theme uses block-based template parts.' ),
[3961] Fix | Delete
'show_in_rest' => true,
[3962] Fix | Delete
)
[3963] Fix | Delete
);
[3964] Fix | Delete
register_theme_feature(
[3965] Fix | Delete
'custom-background',
[3966] Fix | Delete
array(
[3967] Fix | Delete
'description' => __( 'Custom background if defined by the theme.' ),
[3968] Fix | Delete
'type' => 'object',
[3969] Fix | Delete
'show_in_rest' => array(
[3970] Fix | Delete
'schema' => array(
[3971] Fix | Delete
'properties' => array(
[3972] Fix | Delete
'default-image' => array(
[3973] Fix | Delete
'type' => 'string',
[3974] Fix | Delete
'format' => 'uri',
[3975] Fix | Delete
),
[3976] Fix | Delete
'default-preset' => array(
[3977] Fix | Delete
'type' => 'string',
[3978] Fix | Delete
'enum' => array(
[3979] Fix | Delete
'default',
[3980] Fix | Delete
'fill',
[3981] Fix | Delete
'fit',
[3982] Fix | Delete
'repeat',
[3983] Fix | Delete
'custom',
[3984] Fix | Delete
),
[3985] Fix | Delete
),
[3986] Fix | Delete
'default-position-x' => array(
[3987] Fix | Delete
'type' => 'string',
[3988] Fix | Delete
'enum' => array(
[3989] Fix | Delete
'left',
[3990] Fix | Delete
'center',
[3991] Fix | Delete
'right',
[3992] Fix | Delete
),
[3993] Fix | Delete
),
[3994] Fix | Delete
'default-position-y' => array(
[3995] Fix | Delete
'type' => 'string',
[3996] Fix | Delete
'enum' => array(
[3997] Fix | Delete
'left',
[3998] Fix | Delete
'center',
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function