wp-admin/edit-form-advanced.php


Lines:

101 to 200 of 762
}

// Add the local autosave notice HTML.
add_action( 'admin_footer', '_local_storage_notice' )  <;

/*
 * @todo Document the $messages array(s).
 */
$permalink = get_permalink( $post->ID );
if ( ! $permalink ) {
  $permalink = '';
}

$messages = array();

$preview_post_link_html   = '';
$scheduled_post_link_html = '';
$view_post_link_html      = '';

$preview_page_link_html   = '';
$scheduled_page_link_html = '';
$view_page_link_html      = '';

$preview_url = get_preview_post_link( $post );

$viewable = is_post_type_viewable( $post_type_object );

if ( $viewable ) {

  // Preview post link.
  $preview_post_link_html = sprintf(
    ' <a target="_blank" href="%1$s">%2$s</a>',
    esc_url( $preview_url ),
    __( 'Preview post' )
  );

  // Scheduled post preview link.
  $scheduled_post_link_html = sprintf(
    ' <a target="_blank" href="%1$s">%2$s</a>',
    esc_url( $permalink ),
    __( 'Preview post' )
  );

  // View post link.
  $view_post_link_html = sprintf(
    ' <a href="%1$s">%2$s</a>',
    esc_url( $permalink ),
    __( 'View post' )
  );

  // Preview page link.
  $preview_page_link_html = sprintf(
    ' <a target="_blank" href="%1$s">%2$s</a>',
    esc_url( $preview_url ),
    __( 'Preview page' )
  );

  // Scheduled page preview link.
  $scheduled_page_link_html = sprintf(
    ' <a target="_blank" href="%1$s">%2$s</a>',
    esc_url( $permalink ),
    __( 'Preview page' )
  );

  // View page link.
  $view_page_link_html = sprintf(
    ' <a href="%1$s">%2$s</a>',
    esc_url( $permalink ),
    __( 'View page' )
  );

}

$scheduled_date = sprintf(
  /* translators: Publish box date string. 1: Date, 2: Time. */
  __( '%1$s at %2$s' ),
  /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */
  date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $post->post_date ) ),
  /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */
  date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $post->post_date ) )
);

$messages['post']       = array(
  0  => '', // Unused. Messages start at index 1.
  1  => __( 'Post updated.' ) . $view_post_link_html,
  2  => __( 'Custom field updated.' ),
  3  => __( 'Custom field deleted.' ),
  4  => __( 'Post updated.' ),
  /* translators: %s: Date and time of the revision. */
  5  => isset( $_GET['revision'] ) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
  6  => __( 'Post published.' ) . $view_post_link_html,
  7  => __( 'Post saved.' ),
  8  => __( 'Post submitted.' ) . $preview_post_link_html,
  /* translators: %s: Scheduled date for the post. */
  9  => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
  10 => __( 'Post draft updated.' ) . $preview_post_link_html,

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      API Letters: ,,,