This commit is contained in:
Hanson.xyz Dev
2026-01-04 17:50:08 -06:00
parent 7e45ce0756
commit acc8ac87a0
4131 changed files with 232562 additions and 250244 deletions
+11 -4
View File
@@ -768,13 +768,20 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
'post_type' => $post_type,
'post_status' => 'auto-draft',
),
false,
true,
false
);
$post = get_post( $post_id );
if ( is_wp_error( $post_id ) ) {
wp_die( $post_id->get_error_message() );
}
$post = get_post( $post_id );
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) ) {
set_post_format( $post, get_option( 'default_post_format' ) );
}
wp_after_insert_post( $post, false, null );
// Schedule auto-draft cleanup.
@@ -2186,7 +2193,7 @@ function wp_autosave( $post_data ) {
*
* @param int $post_id Optional. Post ID.
*/
function redirect_post( $post_id = '' ) {
function redirect_post( $post_id = 0 ) {
if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) ) {
$status = get_post_status( $post_id );
@@ -2442,7 +2449,7 @@ function the_block_editor_meta_boxes() {
* our editor instance.
*/
$script = 'window._wpLoadBlockEditor.then( function() {
wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' );
wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ' );
} );';
wp_add_inline_script( 'wp-edit-post', $script );