wp-admin/edit-form-advanced.php


Lines:

201 to 300 of 762
);
$messages['page']       = array(
  0  => '', // Unused. Messages start at index 1.
  1  => __( 'Page updated.' ) . $view_page_link_html,
  2  => __( 'Custom field updated.' ),
  3  => __( 'Custom field deleted.' ),
  4  => __( 'Page updated.' ),
  /* translators: %s: Date and time of the revision. */
  5  => isset( $_GET['revision'] ) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
  6  => __( 'Page published.' ) . $view_page_link_html,
  7  => __( 'Page saved.' ),
  8  => __( 'Page submitted.' ) . $preview_page_link_html,
  /* translators: %s: Scheduled date for the page. */
  9  => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
  10 => __( 'Page draft updated.' ) . $preview_page_link_html,
);
$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.


/**
 * Filters the post updated messages.
 *
 * @since 3.0.0
 *
 * @param array[] $messages Post updated messages. For defaults see `$messages` declarations above.
 */
$messages = apply_filters( 'post_updated_messages', $messages );

$message = false;
if ( isset( $_GET['message'] ) ) {
  $_GET['message'] = absint( $_GET['message'] );
  if ( isset( $messages[ $post_type ][ $_GET['message'] ] ) ) {
    $message = $messages[ $post_type ][ $_GET['message'] ];
  } elseif ( ! isset( $messages[ $post_type ] ) && isset( $messages['post'][ $_GET['message'] ] ) ) {
    $message = $messages['post'][ $_GET['message'] ];
  }
}

$notice     = false;
$form_extra = '';
if ( 'auto-draft' === $post->post_status ) {
  if ( 'edit' === $action ) {
    $post->post_title = '';
  }
  $autosave    = false;
  $form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
} else {
  $autosave = wp_get_post_autosave( $post->ID );
}

$form_action  = 'editpost';
$nonce_action = 'update-post_' . $post->ID;
$form_extra  .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr( $post->ID ) . "' />";

// Detect if there exists an autosave newer than the post and if that autosave is different than the post.
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
  foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
    if ( normalize_whitespace( $autosave->$autosave_field ) !== normalize_whitespace( $post->$autosave_field ) ) {
      $notice = sprintf(
        /* translators: %s: URL to view the autosave. */
        __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ),
        get_edit_post_link( $autosave->ID )
      );
      break;
    }
  }
  // If this autosave isn't different from the current post, begone.
  if ( ! $notice ) {
    wp_delete_post_revision( $autosave->ID );
  }
  unset( $autosave_field, $_autosave_field );
}

$post_type_object = get_post_type_object( $post_type );

// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
require_once ABSPATH . 'wp-admin/includes/meta-boxes.php';

register_and_do_post_meta_boxes( $post );

add_screen_option(
  'layout_columns',
  array(
    'max'     => 2,
    'default' => 2,
  )
);

if ( 'post' === $post_type ) {
  $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>';

  get_current_screen()->add_help_tab(
    array(
      'id'      => 'customize-display',
      'title'   => __( 'Customizing This Display' ),
      'content' => $customize_display,
    )
  );

  $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>';

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      API Letters: ,,,