Edit File by line
/home/barbar84/www/wp-admin
File: edit-form-advanced.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Post advanced form for inclusion in the administration panels.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Administration
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
// Don't load directly.
[8] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[9] Fix | Delete
die( '-1' );
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* @global string $post_type
[14] Fix | Delete
* @global WP_Post_Type $post_type_object
[15] Fix | Delete
* @global WP_Post $post Global post object.
[16] Fix | Delete
*/
[17] Fix | Delete
global $post_type, $post_type_object, $post;
[18] Fix | Delete
[19] Fix | Delete
// Flag that we're not loading the block editor.
[20] Fix | Delete
$current_screen = get_current_screen();
[21] Fix | Delete
$current_screen->is_block_editor( false );
[22] Fix | Delete
[23] Fix | Delete
if ( is_multisite() ) {
[24] Fix | Delete
add_action( 'admin_footer', '_admin_notice_post_locked' );
[25] Fix | Delete
} else {
[26] Fix | Delete
$check_users = get_users(
[27] Fix | Delete
array(
[28] Fix | Delete
'fields' => 'ID',
[29] Fix | Delete
'number' => 2,
[30] Fix | Delete
)
[31] Fix | Delete
);
[32] Fix | Delete
[33] Fix | Delete
if ( count( $check_users ) > 1 ) {
[34] Fix | Delete
add_action( 'admin_footer', '_admin_notice_post_locked' );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
unset( $check_users );
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
wp_enqueue_script( 'post' );
[41] Fix | Delete
[42] Fix | Delete
$_wp_editor_expand = false;
[43] Fix | Delete
$_content_editor_dfw = false;
[44] Fix | Delete
[45] Fix | Delete
if ( post_type_supports( $post_type, 'editor' )
[46] Fix | Delete
&& ! wp_is_mobile()
[47] Fix | Delete
&& ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) )
[48] Fix | Delete
) {
[49] Fix | Delete
/**
[50] Fix | Delete
* Filters whether to enable the 'expand' functionality in the post editor.
[51] Fix | Delete
*
[52] Fix | Delete
* @since 4.0.0
[53] Fix | Delete
* @since 4.1.0 Added the `$post_type` parameter.
[54] Fix | Delete
*
[55] Fix | Delete
* @param bool $expand Whether to enable the 'expand' functionality. Default true.
[56] Fix | Delete
* @param string $post_type Post type.
[57] Fix | Delete
*/
[58] Fix | Delete
if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) {
[59] Fix | Delete
wp_enqueue_script( 'editor-expand' );
[60] Fix | Delete
$_content_editor_dfw = true;
[61] Fix | Delete
$_wp_editor_expand = ( 'on' === get_user_setting( 'editor_expand', 'on' ) );
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
if ( wp_is_mobile() ) {
[66] Fix | Delete
wp_enqueue_script( 'jquery-touch-punch' );
[67] Fix | Delete
}
[68] Fix | Delete
[69] Fix | Delete
/**
[70] Fix | Delete
* Post ID global
[71] Fix | Delete
*
[72] Fix | Delete
* @name $post_ID
[73] Fix | Delete
* @var int
[74] Fix | Delete
*/
[75] Fix | Delete
$post_ID = isset( $post_ID ) ? (int) $post_ID : 0;
[76] Fix | Delete
$user_ID = isset( $user_ID ) ? (int) $user_ID : 0;
[77] Fix | Delete
$action = isset( $action ) ? $action : '';
[78] Fix | Delete
[79] Fix | Delete
if ( (int) get_option( 'page_for_posts' ) === $post_ID && empty( $post->post_content ) ) {
[80] Fix | Delete
add_action( 'edit_form_after_title', '_wp_posts_page_notice' );
[81] Fix | Delete
remove_post_type_support( $post_type, 'editor' );
[82] Fix | Delete
}
[83] Fix | Delete
[84] Fix | Delete
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
[85] Fix | Delete
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
[86] Fix | Delete
if ( wp_attachment_is( 'audio', $post ) ) {
[87] Fix | Delete
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
[88] Fix | Delete
} elseif ( wp_attachment_is( 'video', $post ) ) {
[89] Fix | Delete
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
[90] Fix | Delete
}
[91] Fix | Delete
}
[92] Fix | Delete
[93] Fix | Delete
if ( $thumbnail_support ) {
[94] Fix | Delete
add_thickbox();
[95] Fix | Delete
wp_enqueue_media( array( 'post' => $post_ID ) );
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
// Add the local autosave notice HTML.
[99] Fix | Delete
add_action( 'admin_footer', '_local_storage_notice' );
[100] Fix | Delete
[101] Fix | Delete
/*
[102] Fix | Delete
* @todo Document the $messages array(s).
[103] Fix | Delete
*/
[104] Fix | Delete
$permalink = get_permalink( $post_ID );
[105] Fix | Delete
if ( ! $permalink ) {
[106] Fix | Delete
$permalink = '';
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
$messages = array();
[110] Fix | Delete
[111] Fix | Delete
$preview_post_link_html = '';
[112] Fix | Delete
$scheduled_post_link_html = '';
[113] Fix | Delete
$view_post_link_html = '';
[114] Fix | Delete
[115] Fix | Delete
$preview_page_link_html = '';
[116] Fix | Delete
$scheduled_page_link_html = '';
[117] Fix | Delete
$view_page_link_html = '';
[118] Fix | Delete
[119] Fix | Delete
$preview_url = get_preview_post_link( $post );
[120] Fix | Delete
[121] Fix | Delete
$viewable = is_post_type_viewable( $post_type_object );
[122] Fix | Delete
[123] Fix | Delete
if ( $viewable ) {
[124] Fix | Delete
[125] Fix | Delete
// Preview post link.
[126] Fix | Delete
$preview_post_link_html = sprintf(
[127] Fix | Delete
' <a target="_blank" href="%1$s">%2$s</a>',
[128] Fix | Delete
esc_url( $preview_url ),
[129] Fix | Delete
__( 'Preview post' )
[130] Fix | Delete
);
[131] Fix | Delete
[132] Fix | Delete
// Scheduled post preview link.
[133] Fix | Delete
$scheduled_post_link_html = sprintf(
[134] Fix | Delete
' <a target="_blank" href="%1$s">%2$s</a>',
[135] Fix | Delete
esc_url( $permalink ),
[136] Fix | Delete
__( 'Preview post' )
[137] Fix | Delete
);
[138] Fix | Delete
[139] Fix | Delete
// View post link.
[140] Fix | Delete
$view_post_link_html = sprintf(
[141] Fix | Delete
' <a href="%1$s">%2$s</a>',
[142] Fix | Delete
esc_url( $permalink ),
[143] Fix | Delete
__( 'View post' )
[144] Fix | Delete
);
[145] Fix | Delete
[146] Fix | Delete
// Preview page link.
[147] Fix | Delete
$preview_page_link_html = sprintf(
[148] Fix | Delete
' <a target="_blank" href="%1$s">%2$s</a>',
[149] Fix | Delete
esc_url( $preview_url ),
[150] Fix | Delete
__( 'Preview page' )
[151] Fix | Delete
);
[152] Fix | Delete
[153] Fix | Delete
// Scheduled page preview link.
[154] Fix | Delete
$scheduled_page_link_html = sprintf(
[155] Fix | Delete
' <a target="_blank" href="%1$s">%2$s</a>',
[156] Fix | Delete
esc_url( $permalink ),
[157] Fix | Delete
__( 'Preview page' )
[158] Fix | Delete
);
[159] Fix | Delete
[160] Fix | Delete
// View page link.
[161] Fix | Delete
$view_page_link_html = sprintf(
[162] Fix | Delete
' <a href="%1$s">%2$s</a>',
[163] Fix | Delete
esc_url( $permalink ),
[164] Fix | Delete
__( 'View page' )
[165] Fix | Delete
);
[166] Fix | Delete
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
$scheduled_date = sprintf(
[170] Fix | Delete
/* translators: Publish box date string. 1: Date, 2: Time. */
[171] Fix | Delete
__( '%1$s at %2$s' ),
[172] Fix | Delete
/* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
[173] Fix | Delete
date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
[174] Fix | Delete
/* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
[175] Fix | Delete
date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
[176] Fix | Delete
);
[177] Fix | Delete
[178] Fix | Delete
$messages['post'] = array(
[179] Fix | Delete
0 => '', // Unused. Messages start at index 1.
[180] Fix | Delete
1 => __( 'Post updated.' ) . $view_post_link_html,
[181] Fix | Delete
2 => __( 'Custom field updated.' ),
[182] Fix | Delete
3 => __( 'Custom field deleted.' ),
[183] Fix | Delete
4 => __( 'Post updated.' ),
[184] Fix | Delete
/* translators: %s: Date and time of the revision. */
[185] Fix | Delete
5 => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
[186] Fix | Delete
6 => __( 'Post published.' ) . $view_post_link_html,
[187] Fix | Delete
7 => __( 'Post saved.' ),
[188] Fix | Delete
8 => __( 'Post submitted.' ) . $preview_post_link_html,
[189] Fix | Delete
/* translators: %s: Scheduled date for the post. */
[190] Fix | Delete
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
[191] Fix | Delete
10 => __( 'Post draft updated.' ) . $preview_post_link_html,
[192] Fix | Delete
);
[193] Fix | Delete
$messages['page'] = array(
[194] Fix | Delete
0 => '', // Unused. Messages start at index 1.
[195] Fix | Delete
1 => __( 'Page updated.' ) . $view_page_link_html,
[196] Fix | Delete
2 => __( 'Custom field updated.' ),
[197] Fix | Delete
3 => __( 'Custom field deleted.' ),
[198] Fix | Delete
4 => __( 'Page updated.' ),
[199] Fix | Delete
/* translators: %s: Date and time of the revision. */
[200] Fix | Delete
5 => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
[201] Fix | Delete
6 => __( 'Page published.' ) . $view_page_link_html,
[202] Fix | Delete
7 => __( 'Page saved.' ),
[203] Fix | Delete
8 => __( 'Page submitted.' ) . $preview_page_link_html,
[204] Fix | Delete
/* translators: %s: Scheduled date for the page. */
[205] Fix | Delete
9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
[206] Fix | Delete
10 => __( 'Page draft updated.' ) . $preview_page_link_html,
[207] Fix | Delete
);
[208] Fix | Delete
$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.
[209] Fix | Delete
[210] Fix | Delete
/**
[211] Fix | Delete
* Filters the post updated messages.
[212] Fix | Delete
*
[213] Fix | Delete
* @since 3.0.0
[214] Fix | Delete
*
[215] Fix | Delete
* @param array[] $messages Post updated messages. For defaults see `$messages` declarations above.
[216] Fix | Delete
*/
[217] Fix | Delete
$messages = apply_filters( 'post_updated_messages', $messages );
[218] Fix | Delete
[219] Fix | Delete
$message = false;
[220] Fix | Delete
if ( isset( $_GET['message'] ) ) {
[221] Fix | Delete
$_GET['message'] = absint( $_GET['message'] );
[222] Fix | Delete
if ( isset( $messages[ $post_type ][ $_GET['message'] ] ) ) {
[223] Fix | Delete
$message = $messages[ $post_type ][ $_GET['message'] ];
[224] Fix | Delete
} elseif ( ! isset( $messages[ $post_type ] ) && isset( $messages['post'][ $_GET['message'] ] ) ) {
[225] Fix | Delete
$message = $messages['post'][ $_GET['message'] ];
[226] Fix | Delete
}
[227] Fix | Delete
}
[228] Fix | Delete
[229] Fix | Delete
$notice = false;
[230] Fix | Delete
$form_extra = '';
[231] Fix | Delete
if ( 'auto-draft' === $post->post_status ) {
[232] Fix | Delete
if ( 'edit' === $action ) {
[233] Fix | Delete
$post->post_title = '';
[234] Fix | Delete
}
[235] Fix | Delete
$autosave = false;
[236] Fix | Delete
$form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
[237] Fix | Delete
} else {
[238] Fix | Delete
$autosave = wp_get_post_autosave( $post_ID );
[239] Fix | Delete
}
[240] Fix | Delete
[241] Fix | Delete
$form_action = 'editpost';
[242] Fix | Delete
$nonce_action = 'update-post_' . $post_ID;
[243] Fix | Delete
$form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post_ID ) . "' />";
[244] Fix | Delete
[245] Fix | Delete
// Detect if there exists an autosave newer than the post and if that autosave is different than the post.
[246] Fix | Delete
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
[247] Fix | Delete
foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
[248] Fix | Delete
if ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) {
[249] Fix | Delete
$notice = sprintf(
[250] Fix | Delete
/* translators: %s: URL to view the autosave. */
[251] Fix | Delete
__( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ),
[252] Fix | Delete
get_edit_post_link( $autosave->ID )
[253] Fix | Delete
);
[254] Fix | Delete
break;
[255] Fix | Delete
}
[256] Fix | Delete
}
[257] Fix | Delete
// If this autosave isn't different from the current post, begone.
[258] Fix | Delete
if ( ! $notice ) {
[259] Fix | Delete
wp_delete_post_revision( $autosave->ID );
[260] Fix | Delete
}
[261] Fix | Delete
unset( $autosave_field, $_autosave_field );
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
$post_type_object = get_post_type_object( $post_type );
[265] Fix | Delete
[266] Fix | Delete
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
[267] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/meta-boxes.php';
[268] Fix | Delete
[269] Fix | Delete
register_and_do_post_meta_boxes( $post );
[270] Fix | Delete
[271] Fix | Delete
add_screen_option(
[272] Fix | Delete
'layout_columns',
[273] Fix | Delete
array(
[274] Fix | Delete
'max' => 2,
[275] Fix | Delete
'default' => 2,
[276] Fix | Delete
)
[277] Fix | Delete
);
[278] Fix | Delete
[279] Fix | Delete
if ( 'post' === $post_type ) {
[280] Fix | Delete
$customize_display = '<p>' . __( 'The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.' ) . '</p>';
[281] Fix | Delete
[282] Fix | Delete
get_current_screen()->add_help_tab(
[283] Fix | Delete
array(
[284] Fix | Delete
'id' => 'customize-display',
[285] Fix | Delete
'title' => __( 'Customizing This Display' ),
[286] Fix | Delete
'content' => $customize_display,
[287] Fix | Delete
)
[288] Fix | Delete
);
[289] Fix | Delete
[290] Fix | Delete
$title_and_editor = '<p>' . __( '<strong>Title</strong> &mdash; Enter a title for your post. After you enter a title, you&#8217;ll see the permalink below, which you can edit.' ) . '</p>';
[291] Fix | Delete
$title_and_editor .= '<p>' . __( '<strong>Post editor</strong> &mdash; Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>';
[292] Fix | Delete
$title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>';
[293] Fix | Delete
$title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that &lt;p&gt; and &lt;br&gt; tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing &lt;br&gt;, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>';
[294] Fix | Delete
$title_and_editor .= '<p>' . __( 'You can insert media files by clicking the button above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';
[295] Fix | Delete
$title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>';
[296] Fix | Delete
$title_and_editor .= '<p>' . sprintf(
[297] Fix | Delete
/* translators: %s: Alt + F10 */
[298] Fix | Delete
__( 'Keyboard users: When you&#8217;re working in the visual editor, you can use %s to access the toolbar.' ),
[299] Fix | Delete
'<kbd>Alt + F10</kbd>'
[300] Fix | Delete
) . '</p>';
[301] Fix | Delete
[302] Fix | Delete
get_current_screen()->add_help_tab(
[303] Fix | Delete
array(
[304] Fix | Delete
'id' => 'title-post-editor',
[305] Fix | Delete
'title' => __( 'Title and Post Editor' ),
[306] Fix | Delete
'content' => $title_and_editor,
[307] Fix | Delete
)
[308] Fix | Delete
);
[309] Fix | Delete
[310] Fix | Delete
get_current_screen()->set_help_sidebar(
[311] Fix | Delete
'<p>' . sprintf(
[312] Fix | Delete
/* translators: %s: URL to Press This bookmarklet. */
[313] Fix | Delete
__( 'You can also create posts with the <a href="%s">Press This bookmarklet</a>.' ),
[314] Fix | Delete
'tools.php'
[315] Fix | Delete
) . '</p>' .
[316] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[317] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/wordpress-editor/">Documentation on Writing and Editing Posts</a>' ) . '</p>' .
[318] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[319] Fix | Delete
);
[320] Fix | Delete
} elseif ( 'page' === $post_type ) {
[321] Fix | Delete
$about_pages = '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.' ) . '</p>' .
[322] Fix | Delete
'<p>' . __( 'Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.' ) . '</p>';
[323] Fix | Delete
[324] Fix | Delete
get_current_screen()->add_help_tab(
[325] Fix | Delete
array(
[326] Fix | Delete
'id' => 'about-pages',
[327] Fix | Delete
'title' => __( 'About Pages' ),
[328] Fix | Delete
'content' => $about_pages,
[329] Fix | Delete
)
[330] Fix | Delete
);
[331] Fix | Delete
[332] Fix | Delete
get_current_screen()->set_help_sidebar(
[333] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[334] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/pages-add-new-screen/">Documentation on Adding New Pages</a>' ) . '</p>' .
[335] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/pages-screen/">Documentation on Editing Pages</a>' ) . '</p>' .
[336] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[337] Fix | Delete
);
[338] Fix | Delete
} elseif ( 'attachment' === $post_type ) {
[339] Fix | Delete
get_current_screen()->add_help_tab(
[340] Fix | Delete
array(
[341] Fix | Delete
'id' => 'overview',
[342] Fix | Delete
'title' => __( 'Overview' ),
[343] Fix | Delete
'content' =>
[344] Fix | Delete
'<p>' . __( 'This screen allows you to edit fields for metadata in a file within the media library.' ) . '</p>' .
[345] Fix | Delete
'<p>' . __( 'For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.' ) . '</p>' .
[346] Fix | Delete
'<p>' . __( 'Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.' ) . '</p>' .
[347] Fix | Delete
'<p>' . __( 'Remember to click Update Media to save metadata entered or changed.' ) . '</p>',
[348] Fix | Delete
)
[349] Fix | Delete
);
[350] Fix | Delete
[351] Fix | Delete
get_current_screen()->set_help_sidebar(
[352] Fix | Delete
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
[353] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/article/edit-media/">Documentation on Edit Media</a>' ) . '</p>' .
[354] Fix | Delete
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
[355] Fix | Delete
);
[356] Fix | Delete
}
[357] Fix | Delete
[358] Fix | Delete
if ( 'post' === $post_type || 'page' === $post_type ) {
[359] Fix | Delete
$inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the &#8220;Create a new gallery&#8221; button.' ) . '</p>';
[360] Fix | Delete
$inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. <a href="https://wordpress.org/support/article/embeds/">Learn more about embeds</a>.' ) . '</p>';
[361] Fix | Delete
[362] Fix | Delete
get_current_screen()->add_help_tab(
[363] Fix | Delete
array(
[364] Fix | Delete
'id' => 'inserting-media',
[365] Fix | Delete
'title' => __( 'Inserting Media' ),
[366] Fix | Delete
'content' => $inserting_media,
[367] Fix | Delete
)
[368] Fix | Delete
);
[369] Fix | Delete
}
[370] Fix | Delete
[371] Fix | Delete
if ( 'post' === $post_type ) {
[372] Fix | Delete
$publish_box = '<p>' . __( 'Several boxes on this screen contain settings for how your content will be published, including:' ) . '</p>';
[373] Fix | Delete
$publish_box .= '<ul><li>' .
[374] Fix | Delete
__( '<strong>Publish</strong> &mdash; You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) .
[375] Fix | Delete
'</li>';
[376] Fix | Delete
[377] Fix | Delete
if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
[378] Fix | Delete
$publish_box .= '<li>' . __( '<strong>Format</strong> &mdash; Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Your theme could enable all or some of 10 possible formats. <a href="https://wordpress.org/support/article/post-formats/#supported-formats">Learn more about each post format</a>.' ) . '</li>';
[379] Fix | Delete
}
[380] Fix | Delete
[381] Fix | Delete
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
[382] Fix | Delete
$publish_box .= '<li>' . sprintf(
[383] Fix | Delete
/* translators: %s: Featured image. */
[384] Fix | Delete
__( '<strong>%s</strong> &mdash; This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ),
[385] Fix | Delete
esc_html( $post_type_object->labels->featured_image )
[386] Fix | Delete
) . '</li>';
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
$publish_box .= '</ul>';
[390] Fix | Delete
[391] Fix | Delete
get_current_screen()->add_help_tab(
[392] Fix | Delete
array(
[393] Fix | Delete
'id' => 'publish-box',
[394] Fix | Delete
'title' => __( 'Publish Settings' ),
[395] Fix | Delete
'content' => $publish_box,
[396] Fix | Delete
)
[397] Fix | Delete
);
[398] Fix | Delete
[399] Fix | Delete
$discussion_settings = '<p>' . __( '<strong>Send Trackbacks</strong> &mdash; Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they&#8217;ll be notified automatically using pingbacks, and this field is unnecessary.' ) . '</p>';
[400] Fix | Delete
$discussion_settings .= '<p>' . __( '<strong>Discussion</strong> &mdash; You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.' ) . '</p>';
[401] Fix | Delete
[402] Fix | Delete
get_current_screen()->add_help_tab(
[403] Fix | Delete
array(
[404] Fix | Delete
'id' => 'discussion-settings',
[405] Fix | Delete
'title' => __( 'Discussion Settings' ),
[406] Fix | Delete
'content' => $discussion_settings,
[407] Fix | Delete
)
[408] Fix | Delete
);
[409] Fix | Delete
} elseif ( 'page' === $post_type ) {
[410] Fix | Delete
$page_attributes = '<p>' . __( '<strong>Parent</strong> &mdash; You can arrange your pages in hierarchies. For example, you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how many levels you can nest pages.' ) . '</p>' .
[411] Fix | Delete
'<p>' . __( '<strong>Template</strong> &mdash; Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them in this dropdown menu.' ) . '</p>' .
[412] Fix | Delete
'<p>' . __( '<strong>Order</strong> &mdash; Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.' ) . '</p>';
[413] Fix | Delete
[414] Fix | Delete
get_current_screen()->add_help_tab(
[415] Fix | Delete
array(
[416] Fix | Delete
'id' => 'page-attributes',
[417] Fix | Delete
'title' => __( 'Page Attributes' ),
[418] Fix | Delete
'content' => $page_attributes,
[419] Fix | Delete
)
[420] Fix | Delete
);
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
require_once ABSPATH . 'wp-admin/admin-header.php';
[424] Fix | Delete
?>
[425] Fix | Delete
[426] Fix | Delete
<div class="wrap">
[427] Fix | Delete
<h1 class="wp-heading-inline">
[428] Fix | Delete
<?php
[429] Fix | Delete
echo esc_html( $title );
[430] Fix | Delete
?>
[431] Fix | Delete
</h1>
[432] Fix | Delete
[433] Fix | Delete
<?php
[434] Fix | Delete
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {
[435] Fix | Delete
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
[436] Fix | Delete
}
[437] Fix | Delete
?>
[438] Fix | Delete
[439] Fix | Delete
<hr class="wp-header-end">
[440] Fix | Delete
[441] Fix | Delete
<?php if ( $notice ) : ?>
[442] Fix | Delete
<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice; ?></p></div>
[443] Fix | Delete
<?php endif; ?>
[444] Fix | Delete
<?php if ( $message ) : ?>
[445] Fix | Delete
<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
[446] Fix | Delete
<?php endif; ?>
[447] Fix | Delete
<div id="lost-connection-notice" class="error hidden">
[448] Fix | Delete
<p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>
[449] Fix | Delete
<span class="hide-if-no-sessionstorage"><?php _e( 'We&#8217;re backing up this post in your browser, just in case.' ); ?></span>
[450] Fix | Delete
</p>
[451] Fix | Delete
</div>
[452] Fix | Delete
<form name="post" action="post.php" method="post" id="post"
[453] Fix | Delete
<?php
[454] Fix | Delete
/**
[455] Fix | Delete
* Fires inside the post editor form tag.
[456] Fix | Delete
*
[457] Fix | Delete
* @since 3.0.0
[458] Fix | Delete
*
[459] Fix | Delete
* @param WP_Post $post Post object.
[460] Fix | Delete
*/
[461] Fix | Delete
do_action( 'post_edit_form_tag', $post );
[462] Fix | Delete
[463] Fix | Delete
$referer = wp_get_referer();
[464] Fix | Delete
?>
[465] Fix | Delete
>
[466] Fix | Delete
<?php wp_nonce_field( $nonce_action ); ?>
[467] Fix | Delete
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID; ?>" />
[468] Fix | Delete
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ); ?>" />
[469] Fix | Delete
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ); ?>" />
[470] Fix | Delete
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
[471] Fix | Delete
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
[472] Fix | Delete
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status ); ?>" />
[473] Fix | Delete
<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
[474] Fix | Delete
<?php if ( ! empty( $active_post_lock ) ) { ?>
[475] Fix | Delete
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
[476] Fix | Delete
<?php
[477] Fix | Delete
}
[478] Fix | Delete
if ( 'draft' !== get_post_status( $post ) ) {
[479] Fix | Delete
wp_original_referer_field( true, 'previous' );
[480] Fix | Delete
}
[481] Fix | Delete
[482] Fix | Delete
echo $form_extra;
[483] Fix | Delete
[484] Fix | Delete
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
[485] Fix | Delete
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
[486] Fix | Delete
?>
[487] Fix | Delete
[488] Fix | Delete
<?php
[489] Fix | Delete
/**
[490] Fix | Delete
* Fires at the beginning of the edit form.
[491] Fix | Delete
*
[492] Fix | Delete
* At this point, the required hidden fields and nonces have already been output.
[493] Fix | Delete
*
[494] Fix | Delete
* @since 3.7.0
[495] Fix | Delete
*
[496] Fix | Delete
* @param WP_Post $post Post object.
[497] Fix | Delete
*/
[498] Fix | Delete
do_action( 'edit_form_top', $post );
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function