/*
* Get all available templates for the post/page attributes meta-box.
* The "Default template" array element should only be added if the array is
* not empty so we do not trigger the template select element without any options
* besides the default value.
*/
$available_templates =
wp_get_theme()->
get_page_templates( get_post( $post->ID
) );
$available_templates = !
empty( $available_templates ) ?
array_replace( array
( /** This filter is documented in wp-admin/includes/meta-boxes.php */
'' =>
apply_filters( 'default_page_template_title',
__( 'Default template'
), 'rest-api'
),
),
$available_templates) :
$available_templates;
// Lock settings.
$user_id =
wp_check_post_lock( $post->ID
);
if ( $user_id ) { $locked = false;
/** This filter is documented in wp-admin/includes/post.php */
if ( apply_filters( 'show_post_locked_dialog', true,
$post,
$user_id ) ) {