wp/wp-admin/edit-form-advanced.php
author ymh <ymh.work@gmail.com>
Mon, 14 Oct 2019 17:39:30 +0200
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
permissions -rw-r--r--
resynchronize code repo with production
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
 * Post advanced form for inclusion in the administration panels.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
 * @package WordPress
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
 * @subpackage Administration
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
// don't load directly
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
if ( !defined('ABSPATH') )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
	die('-1');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    13
/**
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    14
 * @global string       $post_type
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    15
 * @global WP_Post_Type $post_type_object
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    16
 * @global WP_Post      $post
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    17
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    18
global $post_type, $post_type_object, $post;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    19
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    20
if ( is_multisite() ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    21
	add_action( 'admin_footer', '_admin_notice_post_locked' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    22
} else {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    23
	$check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    24
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    25
	if ( count( $check_users ) > 1 )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    26
		add_action( 'admin_footer', '_admin_notice_post_locked' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    27
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    28
	unset( $check_users );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    29
}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    30
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
wp_enqueue_script('post');
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    32
$_wp_editor_expand = $_content_editor_dfw = false;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    33
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    34
/**
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    35
 * Filters whether to enable the 'expand' functionality in the post editor.
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    36
 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    37
 * @since 4.0.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    38
 * @since 4.1.0 Added the `$post_type` parameter.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    39
 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    40
 * @param bool   $expand    Whether to enable the 'expand' functionality. Default true.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    41
 * @param string $post_type Post type.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    42
 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    43
if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    44
	 ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    45
	 apply_filters( 'wp_editor_expand', true, $post_type ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    46
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    47
	wp_enqueue_script('editor-expand');
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    48
	$_content_editor_dfw = true;
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    49
	$_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    50
}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
if ( wp_is_mobile() )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
	wp_enqueue_script( 'jquery-touch-punch' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
 * Post ID global
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
 * @name $post_ID
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
 * @var int
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
$user_ID = isset($user_ID) ? (int) $user_ID : 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
$action = isset($action) ? $action : '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    64
if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    65
	add_action( 'edit_form_after_title', '_wp_posts_page_notice' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    66
	remove_post_type_support( $post_type, 'editor' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    67
}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    68
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    69
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    70
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    71
	if ( wp_attachment_is( 'audio', $post ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    72
		$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    73
	} elseif ( wp_attachment_is( 'video', $post ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    74
		$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    75
	}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    76
}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    77
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    78
if ( $thumbnail_support ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
	add_thickbox();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
	wp_enqueue_media( array( 'post' => $post_ID ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
// Add the local autosave notice HTML
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    84
add_action( 'admin_footer', '_local_storage_notice' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    86
/*
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
 * @todo Document the $messages array(s).
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    89
$permalink = get_permalink( $post_ID );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    90
if ( ! $permalink ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    91
	$permalink = '';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    92
}
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    93
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
$messages = array();
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    95
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    96
$preview_post_link_html = $scheduled_post_link_html = $view_post_link_html = '';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    97
$preview_page_link_html = $scheduled_page_link_html = $view_page_link_html = '';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    98
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
    99
$preview_url = get_preview_post_link( $post );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   100
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   101
$viewable = is_post_type_viewable( $post_type_object );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   102
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   103
if ( $viewable ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   104
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   105
	// Preview post link.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   106
	$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   107
		esc_url( $preview_url ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   108
		__( 'Preview post' )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   109
	);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   110
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   111
	// Scheduled post preview link.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   112
	$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   113
		esc_url( $permalink ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   114
		__( 'Preview post' )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   115
	);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   116
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   117
	// View post link.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   118
	$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   119
		esc_url( $permalink ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   120
		__( 'View post' )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   121
	);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   122
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   123
	// Preview page link.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   124
	$preview_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   125
		esc_url( $preview_url ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   126
		__( 'Preview page' )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   127
	);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   128
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   129
	// Scheduled page preview link.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   130
	$scheduled_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   131
		esc_url( $permalink ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   132
		__( 'Preview page' )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   133
	);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   134
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   135
	// View page link.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   136
	$view_page_link_html = sprintf( ' <a href="%1$s">%2$s</a>',
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   137
		esc_url( $permalink ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   138
		__( 'View page' )
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   139
	);
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   140
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   141
}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   142
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   143
/* translators: Publish box date format, see https://secure.php.net/date */
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   144
$scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   145
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
$messages['post'] = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
	 0 => '', // Unused. Messages start at index 1.
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   148
	 1 => __( 'Post updated.' ) . $view_post_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   149
	 2 => __( 'Custom field updated.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   150
	 3 => __( 'Custom field deleted.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   151
	 4 => __( 'Post updated.' ),
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   152
	/* translators: %s: date and time of the revision */
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   153
	 5 => isset($_GET['revision']) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   154
	 6 => __( 'Post published.' ) . $view_post_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   155
	 7 => __( 'Post saved.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   156
	 8 => __( 'Post submitted.' ) . $preview_post_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   157
	 9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   158
	10 => __( 'Post draft updated.' ) . $preview_post_link_html,
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   159
);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   160
$messages['page'] = array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   161
	 0 => '', // Unused. Messages start at index 1.
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   162
	 1 => __( 'Page updated.' ) . $view_page_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   163
	 2 => __( 'Custom field updated.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   164
	 3 => __( 'Custom field deleted.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   165
	 4 => __( 'Page updated.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   166
	/* translators: %s: date and time of the revision */
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   167
	 5 => isset($_GET['revision']) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   168
	 6 => __( 'Page published.' ) . $view_page_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   169
	 7 => __( 'Page saved.' ),
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   170
	 8 => __( 'Page submitted.' ) . $preview_page_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   171
	 9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   172
	10 => __( 'Page draft updated.' ) . $preview_page_link_html,
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   173
);
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   174
$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   175
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   176
/**
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   177
 * Filters the post updated messages.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   178
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
 * @since 3.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
 * @param array $messages Post updated messages. For defaults @see $messages declarations above.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
$messages = apply_filters( 'post_updated_messages', $messages );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
$message = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
if ( isset($_GET['message']) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
	$_GET['message'] = absint( $_GET['message'] );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
	if ( isset($messages[$post_type][$_GET['message']]) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
		$message = $messages[$post_type][$_GET['message']];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
	elseif ( !isset($messages[$post_type]) && isset($messages['post'][$_GET['message']]) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
		$message = $messages['post'][$_GET['message']];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   192
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   193
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   194
$notice = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
$form_extra = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
if ( 'auto-draft' == $post->post_status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   197
	if ( 'edit' == $action )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   198
		$post->post_title = '';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   199
	$autosave = false;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
	$form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   201
} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
	$autosave = wp_get_post_autosave( $post_ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   205
$form_action = 'editpost';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   206
$nonce_action = 'update-post_' . $post_ID;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   207
$form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr($post_ID) . "' />";
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   208
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   209
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   210
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   211
	foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   212
		if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   213
			$notice = sprintf( __( '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 ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   214
			break;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   215
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   216
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   217
	// If this autosave isn't different from the current post, begone.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   218
	if ( ! $notice )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   219
		wp_delete_post_revision( $autosave->ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   220
	unset($autosave_field, $_autosave_field);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   221
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   222
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   223
$post_type_object = get_post_type_object($post_type);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   224
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   225
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   226
require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   227
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   228
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   229
$publish_callback_args = null;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   230
if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   231
	$revisions = wp_get_post_revisions( $post_ID );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   232
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   233
	// We should aim to show the revisions meta box only when there are revisions.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   234
	if ( count( $revisions ) > 1 ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   235
		reset( $revisions ); // Reset pointer for key()
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   236
		$publish_callback_args = array( 'revisions_count' => count( $revisions ), 'revision_id' => key( $revisions ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   237
		add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   238
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   240
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   241
if ( 'attachment' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   242
	wp_enqueue_script( 'image-edit' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   243
	wp_enqueue_style( 'imgareaselect' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   244
	add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   245
	add_action( 'edit_form_after_title', 'edit_form_image_editor' );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   246
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   247
	if ( wp_attachment_is( 'audio', $post ) ) {
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   248
		add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core' );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   249
	}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   250
} else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   251
	add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   252
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   253
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   254
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   255
	add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   256
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   257
// all taxonomies
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   258
foreach ( get_object_taxonomies( $post ) as $tax_name ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   259
	$taxonomy = get_taxonomy( $tax_name );
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   260
	if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb )
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   261
		continue;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   262
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   263
	$label = $taxonomy->labels->name;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   264
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   265
	if ( ! is_taxonomy_hierarchical( $tax_name ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   266
		$tax_meta_box_id = 'tagsdiv-' . $tax_name;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   267
	else
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   268
		$tax_meta_box_id = $tax_name . 'div';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   269
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   270
	add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   271
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   272
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   273
if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   274
	add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   275
}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   276
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   277
if ( $thumbnail_support && current_user_can( 'upload_files' ) )
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   278
	add_meta_box('postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low');
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   279
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   280
if ( post_type_supports($post_type, 'excerpt') )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   281
	add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   282
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   283
if ( post_type_supports($post_type, 'trackbacks') )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   284
	add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   285
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   286
if ( post_type_supports($post_type, 'custom-fields') )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   287
	add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   288
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   289
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   290
 * Fires in the middle of built-in meta box registration.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   291
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   292
 * @since 2.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   293
 * @deprecated 3.7.0 Use 'add_meta_boxes' instead.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   294
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   295
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   296
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   297
do_action( 'dbx_post_advanced', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   298
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   299
// Allow the Discussion meta box to show up if the post type supports comments,
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   300
// or if comments or pings are open.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   301
if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   302
	add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   303
}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   304
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   305
$stati = get_post_stati( array( 'public' => true ) );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   306
if ( empty( $stati ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   307
	$stati = array( 'publish' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   308
}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   309
$stati[] = 'private';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   310
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   311
if ( in_array( get_post_status( $post ), $stati ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   312
	// If the post type support comments, or the post has comments, allow the
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   313
	// Comments meta box.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   314
	if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   315
		add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core' );
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   316
	}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   317
}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   318
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   319
if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   320
	add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   321
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   322
if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   323
	add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   324
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   325
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   326
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   327
 * Fires after all built-in meta boxes have been added.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   328
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   329
 * @since 3.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   330
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   331
 * @param string  $post_type Post type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   332
 * @param WP_Post $post      Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   333
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   334
do_action( 'add_meta_boxes', $post_type, $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   335
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   336
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   337
 * Fires after all built-in meta boxes have been added, contextually for the given post type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   338
 *
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   339
 * The dynamic portion of the hook, `$post_type`, refers to the post type of the post.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   340
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   341
 * @since 3.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   342
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   343
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   344
 */
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   345
do_action( "add_meta_boxes_{$post_type}", $post );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   346
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   347
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   348
 * Fires after meta boxes have been added.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   349
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   350
 * Fires once for each of the default meta box contexts: normal, advanced, and side.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   351
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   352
 * @since 3.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   353
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   354
 * @param string  $post_type Post type of the post.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   355
 * @param string  $context   string  Meta box context.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   356
 * @param WP_Post $post      Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   357
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   358
do_action( 'do_meta_boxes', $post_type, 'normal', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   359
/** This action is documented in wp-admin/edit-form-advanced.php */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   360
do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   361
/** This action is documented in wp-admin/edit-form-advanced.php */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   362
do_action( 'do_meta_boxes', $post_type, 'side', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   363
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   364
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   365
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   366
if ( 'post' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   367
	$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>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   368
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   369
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   370
		'id'      => 'customize-display',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   371
		'title'   => __('Customizing This Display'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   372
		'content' => $customize_display,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   373
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   374
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   375
	$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>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   376
	$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>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   377
	$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>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   378
	$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>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   379
	$title_and_editor .= '<p>' . __( 'You can insert media files by clicking the icons above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   380
	$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>';
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   381
	$title_and_editor .= '<p>' . __( 'Keyboard users: When you&#8217;re working in the visual editor, you can use <kbd>Alt + F10</kbd> to access the toolbar.' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   382
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   383
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   384
		'id'      => 'title-post-editor',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   385
		'title'   => __('Title and Post Editor'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   386
		'content' => $title_and_editor,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   387
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   388
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   389
	get_current_screen()->set_help_sidebar(
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   390
			'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'tools.php') . '</p>' .
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   391
			'<p><strong>' . __('For more information:') . '</strong></p>' .
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   392
			'<p>' . __('<a href="https://codex.wordpress.org/Posts_Add_New_Screen">Documentation on Writing and Editing Posts</a>') . '</p>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   393
			'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   394
	);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   395
} elseif ( 'page' == $post_type ) {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   396
	$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>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   397
		'<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>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   398
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   399
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   400
		'id'      => 'about-pages',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   401
		'title'   => __('About Pages'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   402
		'content' => $about_pages,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   403
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   404
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   405
	get_current_screen()->set_help_sidebar(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   406
			'<p><strong>' . __('For more information:') . '</strong></p>' .
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   407
			'<p>' . __('<a href="https://codex.wordpress.org/Pages_Add_New_Screen">Documentation on Adding New Pages</a>') . '</p>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   408
			'<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages">Documentation on Editing Pages</a>') . '</p>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   409
			'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   410
	);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   411
} elseif ( 'attachment' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   412
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   413
		'id'      => 'overview',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   414
		'title'   => __('Overview'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   415
		'content' =>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   416
			'<p>' . __('This screen allows you to edit four fields for metadata in a file within the media library.') . '</p>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   417
			'<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>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   418
			'<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>' .
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   419
			'<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>'
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   420
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   421
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   422
	get_current_screen()->set_help_sidebar(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   423
	'<p><strong>' . __('For more information:') . '</strong></p>' .
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   424
	'<p>' . __('<a href="https://codex.wordpress.org/Media_Add_New_Screen#Edit_Media">Documentation on Edit Media</a>') . '</p>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   425
	'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   426
	);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   427
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   428
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   429
if ( 'post' == $post_type || 'page' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   430
	$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>';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   431
	$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. Please refer to the Codex to <a href="https://codex.wordpress.org/Embeds">learn more about embeds</a>.' ) . '</p>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   432
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   433
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   434
		'id'		=> 'inserting-media',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   435
		'title'		=> __( 'Inserting Media' ),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   436
		'content' 	=> $inserting_media,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   437
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   438
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   439
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   440
if ( 'post' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   441
	$publish_box = '<p>' . __('Several boxes on this screen contain settings for how your content will be published, including:') . '</p>';
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   442
	$publish_box .= '<ul><li>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   443
		__( '<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.' ) .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   444
	'</li>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   445
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   446
	if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   447
		$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. Please refer to the Codex for <a href="https://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>. Your theme could enable all or some of 10 possible formats.' ) . '</li>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   448
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   449
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   450
	if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   451
		/* translators: %s: Featured Image */
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   452
		$publish_box .= '<li>' . sprintf( __( '<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.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   453
	}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   454
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   455
	$publish_box .= '</ul>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   456
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   457
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   458
		'id'      => 'publish-box',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   459
		'title'   => __('Publish Settings'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   460
		'content' => $publish_box,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   461
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   462
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   463
	$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>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   464
	$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>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   465
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   466
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   467
		'id'      => 'discussion-settings',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   468
		'title'   => __('Discussion Settings'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   469
		'content' => $discussion_settings,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   470
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   471
} elseif ( 'page' == $post_type ) {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   472
	$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>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   473
		'<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>' .
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   474
		'<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>';
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   475
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   476
	get_current_screen()->add_help_tab( array(
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   477
		'id' => 'page-attributes',
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   478
		'title' => __('Page Attributes'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   479
		'content' => $page_attributes,
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   480
	) );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   481
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   482
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   483
require_once( ABSPATH . 'wp-admin/admin-header.php' );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   484
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   485
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   486
<div class="wrap">
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   487
<h1 class="wp-heading-inline"><?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   488
echo esc_html( $title );
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   489
?></h1>
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   490
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   491
<?php
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   492
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   493
	echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   494
}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   495
?>
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   496
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   497
<hr class="wp-header-end">
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   498
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   499
<?php if ( $notice ) : ?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   500
<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   501
<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   502
<?php if ( $message ) : ?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   503
<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   504
<?php endif; ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   505
<div id="lost-connection-notice" class="error hidden">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   506
	<p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   507
	<span class="hide-if-no-sessionstorage"><?php _e( 'We&#8217;re backing up this post in your browser, just in case.' ); ?></span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   508
	</p>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   509
</div>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   510
<form name="post" action="post.php" method="post" id="post"<?php
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   511
/**
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   512
 * Fires inside the post editor form tag.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   513
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   514
 * @since 3.0.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   515
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   516
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   517
 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   518
do_action( 'post_edit_form_tag', $post );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   519
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   520
$referer = wp_get_referer();
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   521
?>>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   522
<?php wp_nonce_field($nonce_action); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   523
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   524
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ) ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   525
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ) ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   526
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   527
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   528
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   529
<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   530
<?php if ( ! empty( $active_post_lock ) ) { ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   531
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   532
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   533
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   534
if ( 'draft' != get_post_status( $post ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   535
	wp_original_referer_field(true, 'previous');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   536
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   537
echo $form_extra;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   538
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   539
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   540
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   541
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   542
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   543
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   544
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   545
 * Fires at the beginning of the edit form.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   546
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   547
 * At this point, the required hidden fields and nonces have already been output.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   548
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   549
 * @since 3.7.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   550
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   551
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   552
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   553
do_action( 'edit_form_top', $post ); ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   554
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   555
<div id="poststuff">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   556
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   557
<div id="post-body-content">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   558
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   559
<?php if ( post_type_supports($post_type, 'title') ) { ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   560
<div id="titlediv">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   561
<div id="titlewrap">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   562
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   563
	/**
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   564
	 * Filters the title field placeholder text.
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   565
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   566
	 * @since 3.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   567
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   568
	 * @param string  $text Placeholder text. Default 'Enter title here'.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   569
	 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   570
	 */
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   571
	$title_placeholder = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   572
	?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   573
	<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   574
	<input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   575
</div>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   576
<?php
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   577
/**
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   578
 * Fires before the permalink field in the edit form.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   579
 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   580
 * @since 4.1.0
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   581
 *
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   582
 * @param WP_Post $post Post object.
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   583
 */
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   584
do_action( 'edit_form_before_permalink', $post );
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   585
?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   586
<div class="inside">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   587
<?php
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   588
if ( $viewable ) :
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   589
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   590
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   591
// As of 4.4, the Get Shortlink button is hidden by default.
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   592
if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   593
	$shortlink = wp_get_shortlink($post->ID, 'post');
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   594
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   595
	if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) ) {
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   596
		$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>';
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   597
	}
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   598
}
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   599
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   600
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   601
	$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   602
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   603
	<div id="edit-slug-box" class="hide-if-no-js">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   604
	<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   605
		if ( $has_sample_permalink )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   606
			echo $sample_permalink_html;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   607
	?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   608
	</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   609
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   610
}
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   611
endif;
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   612
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   613
</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   614
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   615
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   616
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   617
</div><!-- /titlediv -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   618
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   619
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   620
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   621
 * Fires after the title field.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   622
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   623
 * @since 3.5.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   624
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   625
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   626
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   627
do_action( 'edit_form_after_title', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   628
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   629
if ( post_type_supports($post_type, 'editor') ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   630
?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   631
<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   632
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   633
<?php wp_editor( $post->post_content, 'content', array(
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   634
	'_content_editor_dfw' => $_content_editor_dfw,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   635
	'drag_drop_upload' => true,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   636
	'tabfocus_elements' => 'content-html,save-post',
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   637
	'editor_height' => 300,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   638
	'tinymce' => array(
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   639
		'resize' => false,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   640
		'wp_autoresize_on' => $_wp_editor_expand,
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   641
		'add_unload_trigger' => false,
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   642
		'wp_keep_scroll_position' => ! $is_IE,
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   643
	),
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   644
) ); ?>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   645
<table id="post-status-info"><tbody><tr>
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   646
	<td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   647
	<td class="autosave-info">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   648
	<span class="autosave-message">&nbsp;</span>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   649
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   650
	if ( 'auto-draft' != $post->post_status ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   651
		echo '<span id="last-edit">';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   652
		if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   653
			/* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   654
			printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   655
		} else {
7
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   656
			/* translators: 1: Post edited date, 2: Post edited time */
cf61fcea0001 resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
   657
			printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   658
		}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   659
		echo '</span>';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   660
	} ?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   661
	</td>
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   662
	<td id="content-resize-handle" class="hide-if-no-js"><br /></td>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   663
</tr></tbody></table>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   664
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   665
</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   666
<?php }
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   667
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   668
 * Fires after the content editor.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   669
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   670
 * @since 3.5.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   671
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   672
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   673
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   674
do_action( 'edit_form_after_editor', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   675
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   676
</div><!-- /post-body-content -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   677
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   678
<div id="postbox-container-1" class="postbox-container">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   679
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   680
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   681
if ( 'page' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   682
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   683
	 * Fires before meta boxes with 'side' context are output for the 'page' post type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   684
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   685
	 * The submitpage box is a meta box with 'side' context, so this hook fires just before it is output.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   686
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   687
	 * @since 2.5.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   688
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   689
	 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   690
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   691
	do_action( 'submitpage_box', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   692
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   693
else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   694
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   695
	 * Fires before meta boxes with 'side' context are output for all post types other than 'page'.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   696
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   697
	 * The submitpost box is a meta box with 'side' context, so this hook fires just before it is output.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   698
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   699
	 * @since 2.5.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   700
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   701
	 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   702
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   703
	do_action( 'submitpost_box', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   704
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   705
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   706
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   707
do_meta_boxes($post_type, 'side', $post);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   708
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   709
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   710
</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   711
<div id="postbox-container-2" class="postbox-container">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   712
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   713
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   714
do_meta_boxes(null, 'normal', $post);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   715
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   716
if ( 'page' == $post_type ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   717
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   718
	 * Fires after 'normal' context meta boxes have been output for the 'page' post type.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   719
	 *
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   720
	 * @since 1.5.0
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   721
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   722
	 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   723
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   724
	do_action( 'edit_page_form', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   725
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   726
else {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   727
	/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   728
	 * Fires after 'normal' context meta boxes have been output for all post types other than 'page'.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   729
	 *
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   730
	 * @since 1.5.0
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   731
	 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   732
	 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   733
	 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   734
	do_action( 'edit_form_advanced', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   735
}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   736
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   737
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   738
do_meta_boxes(null, 'advanced', $post);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   739
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   740
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   741
</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   742
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   743
/**
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   744
 * Fires after all meta box sections have been output, before the closing #post-body div.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   745
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   746
 * @since 2.1.0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   747
 *
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   748
 * @param WP_Post $post Post object.
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   749
 */
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   750
do_action( 'dbx_post_sidebar', $post );
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   751
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   752
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   753
</div><!-- /post-body -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   754
<br class="clear" />
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   755
</div><!-- /poststuff -->
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   756
</form>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   757
</div>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   758
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   759
<?php
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   760
if ( post_type_supports( $post_type, 'comments' ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   761
	wp_comment_reply();
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   762
?>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   763
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
   764
<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   765
<script type="text/javascript">
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   766
try{document.post.title.focus();}catch(e){}
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   767
</script>
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   768
<?php endif; ?>