wp-admin/edit-form-advanced.php


Lines:

1 to 100 of 762
<?php

/**
 * Post advanced form for inclusion in the administration panels.
 *
 * @package WordPress
 * @subpackage Administration
 */

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
  die( '-1' );
}


/**
 * @global string       $post_type
 * @global WP_Post_Type $post_type_object
 * @global WP_Post      $post             Global post object.
 */
global $post_type, $post_type_object, $post;

// Flag that we're not loading the block editor.
$current_screen = get_current_screen();
$current_screen->is_block_editor( false );

if ( is_multisite() ) {
  add_action( 'admin_footer', '_admin_notice_post_locked' )  <;
} else {
  $check_users = get_users(
    array(
      'fields' => 'ID',
      'number' => 2,
    )
  );

  if ( count( $check_users ) > 1 ) {
    add_action( 'admin_footer', '_admin_notice_post_locked' )  <;
  }

  unset( $check_users );
}

wp_enqueue_script( 'post' );

$_wp_editor_expand   = false;
$_content_editor_dfw = false;

if ( post_type_supports( $post_type, 'editor' )
  && ! wp_is_mobile()
  && ! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) )
) {
  
/**
 * Filters whether to enable the 'expand' functionality in the post editor.
 *
 * @since 4.0.0
 * @since 4.1.0 Added the `$post_type` parameter.
 *
 * @param bool   $expand    Whether to enable the 'expand' functionality. Default true.
 * @param string $post_type Post type.
 */
  if ( apply_filters( 'wp_editor_expand', true, $post_type ) ) {
    wp_enqueue_script( 'editor-expand' );
    $_content_editor_dfw = true;
    $_wp_editor_expand   = ( 'on' === get_user_setting( 'editor_expand', 'on' ) );
  }
}

if ( wp_is_mobile() ) {
  wp_enqueue_script( 'jquery-touch-punch' );
}


/**
 * Post ID global
 *
 * @name $post_ID
 * @var int
 */
$post_ID = isset( $post_ID ) ? (int) $post_ID : 0;
$user_ID = isset( $user_ID ) ? (int) $user_ID : 0;
$action  = isset( $action ) ? $action : '';

if ( (int) get_option( 'page_for_posts' ) === $post->ID && empty( $post->post_content ) ) {
  add_action( 'edit_form_after_title', '_wp_posts_page_notice' )  <;
  remove_post_type_support( $post_type, 'editor' );
}

$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
  if ( wp_attachment_is( 'audio', $post ) ) {
    $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
  } elseif ( wp_attachment_is( 'video', $post ) ) {
    $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
  }
}

if ( $thumbnail_support ) {
  add_thickbox();

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      API Letters: ,,,