Edit File by line
/home/barbar84/public_h.../wp-admin
File: post-new.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* New Post Administration Screen.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/** Load WordPress Administration Bootstrap */
[8] Fix | Delete
require_once __DIR__ . '/admin.php';
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* @global string $post_type
[12] Fix | Delete
* @global object $post_type_object
[13] Fix | Delete
* @global WP_Post $post Global post object.
[14] Fix | Delete
*/
[15] Fix | Delete
global $post_type, $post_type_object, $post;
[16] Fix | Delete
[17] Fix | Delete
if ( ! isset( $_GET['post_type'] ) ) {
[18] Fix | Delete
$post_type = 'post';
[19] Fix | Delete
} elseif ( in_array( $_GET['post_type'], get_post_types( array( 'show_ui' => true ) ), true ) ) {
[20] Fix | Delete
$post_type = $_GET['post_type'];
[21] Fix | Delete
} else {
[22] Fix | Delete
wp_die( __( 'Invalid post type.' ) );
[23] Fix | Delete
}
[24] Fix | Delete
$post_type_object = get_post_type_object( $post_type );
[25] Fix | Delete
[26] Fix | Delete
if ( 'post' === $post_type ) {
[27] Fix | Delete
$parent_file = 'edit.php';
[28] Fix | Delete
$submenu_file = 'post-new.php';
[29] Fix | Delete
} elseif ( 'attachment' === $post_type ) {
[30] Fix | Delete
if ( wp_redirect( admin_url( 'media-new.php' ) ) ) {
[31] Fix | Delete
exit;
[32] Fix | Delete
}
[33] Fix | Delete
} else {
[34] Fix | Delete
$submenu_file = "post-new.php?post_type=$post_type";
[35] Fix | Delete
if ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {
[36] Fix | Delete
$parent_file = $post_type_object->show_in_menu;
[37] Fix | Delete
// What if there isn't a post-new.php item for this post type?
[38] Fix | Delete
if ( ! isset( $_registered_pages[ get_plugin_page_hookname( "post-new.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) {
[39] Fix | Delete
if ( isset( $_registered_pages[ get_plugin_page_hookname( "edit.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) {
[40] Fix | Delete
// Fall back to edit.php for that post type, if it exists.
[41] Fix | Delete
$submenu_file = "edit.php?post_type=$post_type";
[42] Fix | Delete
} else {
[43] Fix | Delete
// Otherwise, give up and highlight the parent.
[44] Fix | Delete
$submenu_file = $parent_file;
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
} else {
[48] Fix | Delete
$parent_file = "edit.php?post_type=$post_type";
[49] Fix | Delete
}
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
$title = $post_type_object->labels->add_new_item;
[53] Fix | Delete
[54] Fix | Delete
$editing = true;
[55] Fix | Delete
[56] Fix | Delete
if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
[57] Fix | Delete
wp_die(
[58] Fix | Delete
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
[59] Fix | Delete
'<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',
[60] Fix | Delete
403
[61] Fix | Delete
);
[62] Fix | Delete
}
[63] Fix | Delete
[64] Fix | Delete
$post = get_default_post_to_edit( $post_type, true );
[65] Fix | Delete
$post_ID = $post->ID;
[66] Fix | Delete
[67] Fix | Delete
/** This filter is documented in wp-admin/post.php */
[68] Fix | Delete
if ( apply_filters( 'replace_editor', false, $post ) !== true ) {
[69] Fix | Delete
if ( use_block_editor_for_post( $post ) ) {
[70] Fix | Delete
require ABSPATH . 'wp-admin/edit-form-blocks.php';
[71] Fix | Delete
} else {
[72] Fix | Delete
wp_enqueue_script( 'autosave' );
[73] Fix | Delete
require ABSPATH . 'wp-admin/edit-form-advanced.php';
[74] Fix | Delete
}
[75] Fix | Delete
} else {
[76] Fix | Delete
// Flag that we're not loading the block editor.
[77] Fix | Delete
$current_screen = get_current_screen();
[78] Fix | Delete
$current_screen->is_block_editor( false );
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-footer.php';
[82] Fix | Delete
[83] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function