[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> deprecated.php (source)

   1  <?php
   2  /**
   3   * Deprecated admin functions from past WordPress versions. You shouldn't use these
   4   * functions and look for the alternatives instead. The functions will be removed
   5   * in a later version.
   6   *
   7   * @package WordPress
   8   * @subpackage Deprecated
   9   */
  10  
  11  /*
  12   * Deprecated functions come here to die.
  13   */
  14  
  15  /**
  16   * @since 2.1.0
  17   * @deprecated 2.1.0 Use wp_editor()
  18   * @see wp_editor()
  19   */
  20  function tinymce_include() {
  21      _deprecated_function( __FUNCTION__, '2.1.0', 'wp_editor()' );
  22  
  23      wp_tiny_mce();
  24  }
  25  
  26  /**
  27   * Unused Admin function.
  28   *
  29   * @since 2.0.0
  30   * @deprecated 2.5.0
  31   *
  32   */
  33  function documentation_link() {
  34      _deprecated_function( __FUNCTION__, '2.5.0' );
  35  }
  36  
  37  /**
  38   * Calculates the new dimensions for a downsampled image.
  39   *
  40   * @since 2.0.0
  41   * @deprecated 3.0.0 Use wp_constrain_dimensions()
  42   * @see wp_constrain_dimensions()
  43   *
  44   * @param int $width Current width of the image
  45   * @param int $height Current height of the image
  46   * @param int $wmax Maximum wanted width
  47   * @param int $hmax Maximum wanted height
  48   * @return array Shrunk dimensions (width, height).
  49   */
  50  function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
  51      _deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' );
  52      return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
  53  }
  54  
  55  /**
  56   * Calculated the new dimensions for a downsampled image.
  57   *
  58   * @since 2.0.0
  59   * @deprecated 3.5.0 Use wp_constrain_dimensions()
  60   * @see wp_constrain_dimensions()
  61   *
  62   * @param int $width Current width of the image
  63   * @param int $height Current height of the image
  64   * @return array Shrunk dimensions (width, height).
  65   */
  66  function get_udims( $width, $height ) {
  67      _deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' );
  68      return wp_constrain_dimensions( $width, $height, 128, 96 );
  69  }
  70  
  71  /**
  72   * Legacy function used to generate the categories checklist control.
  73   *
  74   * @since 0.71
  75   * @deprecated 2.6.0 Use wp_category_checklist()
  76   * @see wp_category_checklist()
  77   *
  78   * @param int $default       Unused.
  79   * @param int $parent        Unused.
  80   * @param array $popular_ids Unused.
  81   */
  82  function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
  83      _deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' );
  84      global $post_ID;
  85      wp_category_checklist( $post_ID );
  86  }
  87  
  88  /**
  89   * Legacy function used to generate a link categories checklist control.
  90   *
  91   * @since 2.1.0
  92   * @deprecated 2.6.0 Use wp_link_category_checklist()
  93   * @see wp_link_category_checklist()
  94   *
  95   * @param int $default Unused.
  96   */
  97  function dropdown_link_categories( $default = 0 ) {
  98      _deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' );
  99      global $link_id;
 100      wp_link_category_checklist( $link_id );
 101  }
 102  
 103  /**
 104   * Get the real filesystem path to a file to edit within the admin.
 105   *
 106   * @since 1.5.0
 107   * @deprecated 2.9.0
 108   * @uses WP_CONTENT_DIR Full filesystem path to the wp-content directory.
 109   *
 110   * @param string $file Filesystem path relative to the wp-content directory.
 111   * @return string Full filesystem path to edit.
 112   */
 113  function get_real_file_to_edit( $file ) {
 114      _deprecated_function( __FUNCTION__, '2.9.0' );
 115  
 116      return WP_CONTENT_DIR . $file;
 117  }
 118  
 119  /**
 120   * Legacy function used for generating a categories drop-down control.
 121   *
 122   * @since 1.2.0
 123   * @deprecated 3.0.0 Use wp_dropdown_categories()
 124   * @see wp_dropdown_categories()
 125   *
 126   * @param int $currentcat    Optional. ID of the current category. Default 0.
 127   * @param int $currentparent Optional. Current parent category ID. Default 0.
 128   * @param int $parent        Optional. Parent ID to retrieve categories for. Default 0.
 129   * @param int $level         Optional. Number of levels deep to display. Default 0.
 130   * @param array $categories  Optional. Categories to include in the control. Default 0.
 131   * @return bool|null False if no categories were found.
 132   */
 133  function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
 134      _deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' );
 135      if (!$categories )
 136          $categories = get_categories( array('hide_empty' => 0) );
 137  
 138      if ( $categories ) {
 139          foreach ( $categories as $category ) {
 140              if ( $currentcat != $category->term_id && $parent == $category->parent) {
 141                  $pad = str_repeat( '&#8211; ', $level );
 142                  $category->name = esc_html( $category->name );
 143                  echo "\n\t<option value='$category->term_id'";
 144                  if ( $currentparent == $category->term_id )
 145                      echo " selected='selected'";
 146                  echo ">$pad$category->name</option>";
 147                  wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
 148              }
 149          }
 150      } else {
 151          return false;
 152      }
 153  }
 154  
 155  /**
 156   * Register a setting and its sanitization callback
 157   *
 158   * @since 2.7.0
 159   * @deprecated 3.0.0 Use register_setting()
 160   * @see register_setting()
 161   *
 162   * @param string $option_group A settings group name. Should correspond to a whitelisted option key name.
 163   *     Default whitelisted option key names include "general," "discussion," and "reading," among others.
 164   * @param string $option_name The name of an option to sanitize and save.
 165   * @param callable $sanitize_callback A callback function that sanitizes the option's value.
 166   */
 167  function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
 168      _deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' );
 169      register_setting( $option_group, $option_name, $sanitize_callback );
 170  }
 171  
 172  /**
 173   * Unregister a setting
 174   *
 175   * @since 2.7.0
 176   * @deprecated 3.0.0 Use unregister_setting()
 177   * @see unregister_setting()
 178   *
 179   * @param string $option_group
 180   * @param string $option_name
 181   * @param callable $sanitize_callback
 182   */
 183  function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) {
 184      _deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' );
 185      unregister_setting( $option_group, $option_name, $sanitize_callback );
 186  }
 187  
 188  /**
 189   * Determines the language to use for CodePress syntax highlighting.
 190   *
 191   * @since 2.8.0
 192   * @deprecated 3.0.0
 193   *
 194   * @param string $filename
 195  **/
 196  function codepress_get_lang( $filename ) {
 197      _deprecated_function( __FUNCTION__, '3.0.0' );
 198  }
 199  
 200  /**
 201   * Adds JavaScript required to make CodePress work on the theme/plugin editors.
 202   *
 203   * @since 2.8.0
 204   * @deprecated 3.0.0
 205  **/
 206  function codepress_footer_js() {
 207      _deprecated_function( __FUNCTION__, '3.0.0' );
 208  }
 209  
 210  /**
 211   * Determine whether to use CodePress.
 212   *
 213   * @since 2.8.0
 214   * @deprecated 3.0.0
 215  **/
 216  function use_codepress() {
 217      _deprecated_function( __FUNCTION__, '3.0.0' );
 218  }
 219  
 220  /**
 221   * Get all user IDs.
 222   *
 223   * @deprecated 3.1.0 Use get_users()
 224   *
 225   * @global wpdb $wpdb WordPress database abstraction object.
 226   *
 227   * @return array List of user IDs.
 228   */
 229  function get_author_user_ids() {
 230      _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
 231  
 232      global $wpdb;
 233      if ( !is_multisite() )
 234          $level_key = $wpdb->get_blog_prefix() . 'user_level';
 235      else
 236          $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
 237  
 238      return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
 239  }
 240  
 241  /**
 242   * Gets author users who can edit posts.
 243   *
 244   * @deprecated 3.1.0 Use get_users()
 245   *
 246   * @global wpdb $wpdb WordPress database abstraction object.
 247   *
 248   * @param int $user_id User ID.
 249   * @return array|bool List of editable authors. False if no editable users.
 250   */
 251  function get_editable_authors( $user_id ) {
 252      _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
 253  
 254      global $wpdb;
 255  
 256      $editable = get_editable_user_ids( $user_id );
 257  
 258      if ( !$editable ) {
 259          return false;
 260      } else {
 261          $editable = join(',', $editable);
 262          $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
 263      }
 264  
 265      return apply_filters('get_editable_authors', $authors);
 266  }
 267  
 268  /**
 269   * Gets the IDs of any users who can edit posts.
 270   *
 271   * @deprecated 3.1.0 Use get_users()
 272   *
 273   * @global wpdb $wpdb WordPress database abstraction object.
 274   *
 275   * @param int  $user_id       User ID.
 276   * @param bool $exclude_zeros Optional. Whether to exclude zeroes. Default true.
 277   * @return array Array of editable user IDs, empty array otherwise.
 278   */
 279  function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
 280      _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
 281  
 282      global $wpdb;
 283  
 284      if ( ! $user = get_userdata( $user_id ) )
 285          return array();
 286      $post_type_obj = get_post_type_object($post_type);
 287  
 288      if ( ! $user->has_cap($post_type_obj->cap->edit_others_posts) ) {
 289          if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
 290              return array($user->ID);
 291          else
 292              return array();
 293      }
 294  
 295      if ( !is_multisite() )
 296          $level_key = $wpdb->get_blog_prefix() . 'user_level';
 297      else
 298          $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
 299  
 300      $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
 301      if ( $exclude_zeros )
 302          $query .= " AND meta_value != '0'";
 303  
 304      return $wpdb->get_col( $query );
 305  }
 306  
 307  /**
 308   * Gets all users who are not authors.
 309   *
 310   * @deprecated 3.1.0 Use get_users()
 311   *
 312   * @global wpdb $wpdb WordPress database abstraction object.
 313   */
 314  function get_nonauthor_user_ids() {
 315      _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
 316  
 317      global $wpdb;
 318  
 319      if ( !is_multisite() )
 320          $level_key = $wpdb->get_blog_prefix() . 'user_level';
 321      else
 322          $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
 323  
 324      return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
 325  }
 326  
 327  if ( ! class_exists( 'WP_User_Search', false ) ) :
 328  /**
 329   * WordPress User Search class.
 330   *
 331   * @since 2.1.0
 332   * @deprecated 3.1.0 Use WP_User_Query
 333   */
 334  class WP_User_Search {
 335  
 336      /**
 337       * {@internal Missing Description}}
 338       *
 339       * @since 2.1.0
 340       * @access private
 341       * @var mixed
 342       */
 343      var $results;
 344  
 345      /**
 346       * {@internal Missing Description}}
 347       *
 348       * @since 2.1.0
 349       * @access private
 350       * @var string
 351       */
 352      var $search_term;
 353  
 354      /**
 355       * Page number.
 356       *
 357       * @since 2.1.0
 358       * @access private
 359       * @var int
 360       */
 361      var $page;
 362  
 363      /**
 364       * Role name that users have.
 365       *
 366       * @since 2.5.0
 367       * @access private
 368       * @var string
 369       */
 370      var $role;
 371  
 372      /**
 373       * Raw page number.
 374       *
 375       * @since 2.1.0
 376       * @access private
 377       * @var int|bool
 378       */
 379      var $raw_page;
 380  
 381      /**
 382       * Amount of users to display per page.
 383       *
 384       * @since 2.1.0
 385       * @access public
 386       * @var int
 387       */
 388      var $users_per_page = 50;
 389  
 390      /**
 391       * {@internal Missing Description}}
 392       *
 393       * @since 2.1.0
 394       * @access private
 395       * @var int
 396       */
 397      var $first_user;
 398  
 399      /**
 400       * {@internal Missing Description}}
 401       *
 402       * @since 2.1.0
 403       * @access private
 404       * @var int
 405       */
 406      var $last_user;
 407  
 408      /**
 409       * {@internal Missing Description}}
 410       *
 411       * @since 2.1.0
 412       * @access private
 413       * @var string
 414       */
 415      var $query_limit;
 416  
 417      /**
 418       * {@internal Missing Description}}
 419       *
 420       * @since 3.0.0
 421       * @access private
 422       * @var string
 423       */
 424      var $query_orderby;
 425  
 426      /**
 427       * {@internal Missing Description}}
 428       *
 429       * @since 3.0.0
 430       * @access private
 431       * @var string
 432       */
 433      var $query_from;
 434  
 435      /**
 436       * {@internal Missing Description}}
 437       *
 438       * @since 3.0.0
 439       * @access private
 440       * @var string
 441       */
 442      var $query_where;
 443  
 444      /**
 445       * {@internal Missing Description}}
 446       *
 447       * @since 2.1.0
 448       * @access private
 449       * @var int
 450       */
 451      var $total_users_for_query = 0;
 452  
 453      /**
 454       * {@internal Missing Description}}
 455       *
 456       * @since 2.1.0
 457       * @access private
 458       * @var bool
 459       */
 460      var $too_many_total_users = false;
 461  
 462      /**
 463       * {@internal Missing Description}}
 464       *
 465       * @since 2.1.0
 466       * @access private
 467       * @var WP_Error
 468       */
 469      var $search_errors;
 470  
 471      /**
 472       * {@internal Missing Description}}
 473       *
 474       * @since 2.7.0
 475       * @access private
 476       * @var string
 477       */
 478      var $paging_text;
 479  
 480      /**
 481       * PHP5 Constructor - Sets up the object properties.
 482       *
 483       * @since 2.1.0
 484       *
 485       * @param string $search_term Search terms string.
 486       * @param int $page Optional. Page ID.
 487       * @param string $role Role name.
 488       * @return WP_User_Search
 489       */
 490  	function __construct( $search_term = '', $page = '', $role = '' ) {
 491          _deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' );
 492  
 493          $this->search_term = wp_unslash( $search_term );
 494          $this->raw_page = ( '' == $page ) ? false : (int) $page;
 495          $this->page = (int) ( '' == $page ) ? 1 : $page;
 496          $this->role = $role;
 497  
 498          $this->prepare_query();
 499          $this->query();
 500          $this->do_paging();
 501      }
 502  
 503      /**
 504       * PHP4 Constructor - Sets up the object properties.
 505       *
 506       * @since 2.1.0
 507       *
 508       * @param string $search_term Search terms string.
 509       * @param int $page Optional. Page ID.
 510       * @param string $role Role name.
 511       * @return WP_User_Search
 512       */
 513  	public function WP_User_Search( $search_term = '', $page = '', $role = '' ) {
 514          self::__construct( $search_term, $page, $role );
 515      }
 516  
 517      /**
 518       * Prepares the user search query (legacy).
 519       *
 520       * @since 2.1.0
 521       * @access public
 522       */
 523  	public function prepare_query() {
 524          global $wpdb;
 525          $this->first_user = ($this->page - 1) * $this->users_per_page;
 526  
 527          $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
 528          $this->query_orderby = ' ORDER BY user_login';
 529  
 530          $search_sql = '';
 531          if ( $this->search_term ) {
 532              $searches = array();
 533              $search_sql = 'AND (';
 534              foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
 535                  $searches[] = $wpdb->prepare( $col . ' LIKE %s', '%' . like_escape($this->search_term) . '%' );
 536              $search_sql .= implode(' OR ', $searches);
 537              $search_sql .= ')';
 538          }
 539  
 540          $this->query_from = " FROM $wpdb->users";
 541          $this->query_where = " WHERE 1=1 $search_sql";
 542  
 543          if ( $this->role ) {
 544              $this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
 545              $this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
 546          } elseif ( is_multisite() ) {
 547              $level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
 548              $this->query_from .= ", $wpdb->usermeta";
 549              $this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
 550          }
 551  
 552          do_action_ref_array( 'pre_user_search', array( &$this ) );
 553      }
 554  
 555      /**
 556       * Executes the user search query.
 557       *
 558       * @since 2.1.0
 559       * @access public
 560       */
 561  	public function query() {
 562          global $wpdb;
 563  
 564          $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
 565  
 566          if ( $this->results )
 567              $this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit
 568          else
 569              $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
 570      }
 571  
 572      /**
 573       * Prepares variables for use in templates.
 574       *
 575       * @since 2.1.0
 576       * @access public
 577       */
 578  	function prepare_vars_for_template_usage() {}
 579  
 580      /**
 581       * Handles paging for the user search query.
 582       *
 583       * @since 2.1.0
 584       * @access public
 585       */
 586  	public function do_paging() {
 587          if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
 588              $args = array();
 589              if ( ! empty($this->search_term) )
 590                  $args['usersearch'] = urlencode($this->search_term);
 591              if ( ! empty($this->role) )
 592                  $args['role'] = urlencode($this->role);
 593  
 594              $this->paging_text = paginate_links( array(
 595                  'total' => ceil($this->total_users_for_query / $this->users_per_page),
 596                  'current' => $this->page,
 597                  'base' => 'users.php?%_%',
 598                  'format' => 'userspage=%#%',
 599                  'add_args' => $args
 600              ) );
 601              if ( $this->paging_text ) {
 602                  $this->paging_text = sprintf(
 603                      /* translators: 1: Starting number of users on the current page, 2: Ending number of users, 3: Total number of users. */
 604                      '<span class="displaying-num">' . __( 'Displaying %1$s&#8211;%2$s of %3$s' ) . '</span>%s',
 605                      number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
 606                      number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
 607                      number_format_i18n( $this->total_users_for_query ),
 608                      $this->paging_text
 609                  );
 610              }
 611          }
 612      }
 613  
 614      /**
 615       * Retrieves the user search query results.
 616       *
 617       * @since 2.1.0
 618       * @access public
 619       *
 620       * @return array
 621       */
 622  	public function get_results() {
 623          return (array) $this->results;
 624      }
 625  
 626      /**
 627       * Displaying paging text.
 628       *
 629       * @see do_paging() Builds paging text.
 630       *
 631       * @since 2.1.0
 632       * @access public
 633       */
 634  	function page_links() {
 635          echo $this->paging_text;
 636      }
 637  
 638      /**
 639       * Whether paging is enabled.
 640       *
 641       * @see do_paging() Builds paging text.
 642       *
 643       * @since 2.1.0
 644       * @access public
 645       *
 646       * @return bool
 647       */
 648  	function results_are_paged() {
 649          if ( $this->paging_text )
 650              return true;
 651          return false;
 652      }
 653  
 654      /**
 655       * Whether there are search terms.
 656       *
 657       * @since 2.1.0
 658       * @access public
 659       *
 660       * @return bool
 661       */
 662  	function is_search() {
 663          if ( $this->search_term )
 664              return true;
 665          return false;
 666      }
 667  }
 668  endif;
 669  
 670  /**
 671   * Retrieves editable posts from other users.
 672   *
 673   * @since 2.3.0
 674   * @deprecated 3.1.0 Use get_posts()
 675   * @see get_posts()
 676   *
 677   * @global wpdb $wpdb WordPress database abstraction object.
 678   *
 679   * @param int    $user_id User ID to not retrieve posts from.
 680   * @param string $type    Optional. Post type to retrieve. Accepts 'draft', 'pending' or 'any' (all).
 681   *                        Default 'any'.
 682   * @return array List of posts from others.
 683   */
 684  function get_others_unpublished_posts( $user_id, $type = 'any' ) {
 685      _deprecated_function( __FUNCTION__, '3.1.0' );
 686  
 687      global $wpdb;
 688  
 689      $editable = get_editable_user_ids( $user_id );
 690  
 691      if ( in_array($type, array('draft', 'pending')) )
 692          $type_sql = " post_status = '$type' ";
 693      else
 694          $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
 695  
 696      $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
 697  
 698      if ( !$editable ) {
 699          $other_unpubs = '';
 700      } else {
 701          $editable = join(',', $editable);
 702          $other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
 703      }
 704  
 705      return apply_filters('get_others_drafts', $other_unpubs);
 706  }
 707  
 708  /**
 709   * Retrieve drafts from other users.
 710   *
 711   * @deprecated 3.1.0 Use get_posts()
 712   * @see get_posts()
 713   *
 714   * @param int $user_id User ID.
 715   * @return array List of drafts from other users.
 716   */
 717  function get_others_drafts($user_id) {
 718      _deprecated_function( __FUNCTION__, '3.1.0' );
 719  
 720      return get_others_unpublished_posts($user_id, 'draft');
 721  }
 722  
 723  /**
 724   * Retrieve pending review posts from other users.
 725   *
 726   * @deprecated 3.1.0 Use get_posts()
 727   * @see get_posts()
 728   *
 729   * @param int $user_id User ID.
 730   * @return array List of posts with pending review post type from other users.
 731   */
 732  function get_others_pending($user_id) {
 733      _deprecated_function( __FUNCTION__, '3.1.0' );
 734  
 735      return get_others_unpublished_posts($user_id, 'pending');
 736  }
 737  
 738  /**
 739   * Output the QuickPress dashboard widget.
 740   *
 741   * @since 3.0.0
 742   * @deprecated 3.2.0 Use wp_dashboard_quick_press()
 743   * @see wp_dashboard_quick_press()
 744   */
 745  function wp_dashboard_quick_press_output() {
 746      _deprecated_function( __FUNCTION__, '3.2.0', 'wp_dashboard_quick_press()' );
 747      wp_dashboard_quick_press();
 748  }
 749  
 750  /**
 751   * Outputs the TinyMCE editor.
 752   *
 753   * @since 2.7.0
 754   * @deprecated 3.3.0 Use wp_editor()
 755   * @see wp_editor()
 756   *
 757   * @staticvar int $num
 758   */
 759  function wp_tiny_mce( $teeny = false, $settings = false ) {
 760      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 761  
 762      static $num = 1;
 763  
 764      if ( ! class_exists( '_WP_Editors', false ) )
 765          require_once ( ABSPATH . WPINC . '/class-wp-editor.php' );
 766  
 767      $editor_id = 'content' . $num++;
 768  
 769      $set = array(
 770          'teeny' => $teeny,
 771          'tinymce' => $settings ? $settings : true,
 772          'quicktags' => false
 773      );
 774  
 775      $set = _WP_Editors::parse_settings($editor_id, $set);
 776      _WP_Editors::editor_settings($editor_id, $set);
 777  }
 778  
 779  /**
 780   * Preloads TinyMCE dialogs.
 781   *
 782   * @deprecated 3.3.0 Use wp_editor()
 783   * @see wp_editor()
 784   */
 785  function wp_preload_dialogs() {
 786      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 787  }
 788  
 789  /**
 790   * Prints TinyMCE editor JS.
 791   *
 792   * @deprecated 3.3.0 Use wp_editor()
 793   * @see wp_editor()
 794   */
 795  function wp_print_editor_js() {
 796      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 797  }
 798  
 799  /**
 800   * Handles quicktags.
 801   *
 802   * @deprecated 3.3.0 Use wp_editor()
 803   * @see wp_editor()
 804   */
 805  function wp_quicktags() {
 806      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 807  }
 808  
 809  /**
 810   * Returns the screen layout options.
 811   *
 812   * @since 2.8.0
 813   * @deprecated 3.3.0 WP_Screen::render_screen_layout()
 814   * @see WP_Screen::render_screen_layout()
 815   */
 816  function screen_layout( $screen ) {
 817      _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_screen_layout()' );
 818  
 819      $current_screen = get_current_screen();
 820  
 821      if ( ! $current_screen )
 822          return '';
 823  
 824      ob_start();
 825      $current_screen->render_screen_layout();
 826      return ob_get_clean();
 827  }
 828  
 829  /**
 830   * Returns the screen's per-page options.
 831   *
 832   * @since 2.8.0
 833   * @deprecated 3.3.0 Use WP_Screen::render_per_page_options()
 834   * @see WP_Screen::render_per_page_options()
 835   */
 836  function screen_options( $screen ) {
 837      _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_per_page_options()' );
 838  
 839      $current_screen = get_current_screen();
 840  
 841      if ( ! $current_screen )
 842          return '';
 843  
 844      ob_start();
 845      $current_screen->render_per_page_options();
 846      return ob_get_clean();
 847  }
 848  
 849  /**
 850   * Renders the screen's help.
 851   *
 852   * @since 2.7.0
 853   * @deprecated 3.3.0 Use WP_Screen::render_screen_meta()
 854   * @see WP_Screen::render_screen_meta()
 855   */
 856  function screen_meta( $screen ) {
 857      $current_screen = get_current_screen();
 858      $current_screen->render_screen_meta();
 859  }
 860  
 861  /**
 862   * Favorite actions were deprecated in version 3.2. Use the admin bar instead.
 863   *
 864   * @since 2.7.0
 865   * @deprecated 3.2.0 Use WP_Admin_Bar
 866   * @see WP_Admin_Bar
 867   */
 868  function favorite_actions() {
 869      _deprecated_function( __FUNCTION__, '3.2.0', 'WP_Admin_Bar' );
 870  }
 871  
 872  /**
 873   * Handles uploading an image.
 874   *
 875   * @deprecated 3.3.0 Use wp_media_upload_handler()
 876   * @see wp_media_upload_handler()
 877   *
 878   * @return null|string
 879   */
 880  function media_upload_image() {
 881      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 882      return wp_media_upload_handler();
 883  }
 884  
 885  /**
 886   * Handles uploading an audio file.
 887   *
 888   * @deprecated 3.3.0 Use wp_media_upload_handler()
 889   * @see wp_media_upload_handler()
 890   *
 891   * @return null|string
 892   */
 893  function media_upload_audio() {
 894      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 895      return wp_media_upload_handler();
 896  }
 897  
 898  /**
 899   * Handles uploading a video file.
 900   *
 901   * @deprecated 3.3.0 Use wp_media_upload_handler()
 902   * @see wp_media_upload_handler()
 903   *
 904   * @return null|string
 905   */
 906  function media_upload_video() {
 907      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 908      return wp_media_upload_handler();
 909  }
 910  
 911  /**
 912   * Handles uploading a generic file.
 913   *
 914   * @deprecated 3.3.0 Use wp_media_upload_handler()
 915   * @see wp_media_upload_handler()
 916   *
 917   * @return null|string
 918   */
 919  function media_upload_file() {
 920      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 921      return wp_media_upload_handler();
 922  }
 923  
 924  /**
 925   * Handles retrieving the insert-from-URL form for an image.
 926   *
 927   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 928   * @see wp_media_insert_url_form()
 929   *
 930   * @return string
 931   */
 932  function type_url_form_image() {
 933      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('image')" );
 934      return wp_media_insert_url_form( 'image' );
 935  }
 936  
 937  /**
 938   * Handles retrieving the insert-from-URL form for an audio file.
 939   *
 940   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 941   * @see wp_media_insert_url_form()
 942   *
 943   * @return string
 944   */
 945  function type_url_form_audio() {
 946      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('audio')" );
 947      return wp_media_insert_url_form( 'audio' );
 948  }
 949  
 950  /**
 951   * Handles retrieving the insert-from-URL form for a video file.
 952   *
 953   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 954   * @see wp_media_insert_url_form()
 955   *
 956   * @return string
 957   */
 958  function type_url_form_video() {
 959      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('video')" );
 960      return wp_media_insert_url_form( 'video' );
 961  }
 962  
 963  /**
 964   * Handles retrieving the insert-from-URL form for a generic file.
 965   *
 966   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 967   * @see wp_media_insert_url_form()
 968   *
 969   * @return string
 970   */
 971  function type_url_form_file() {
 972      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('file')" );
 973      return wp_media_insert_url_form( 'file' );
 974  }
 975  
 976  /**
 977   * Add contextual help text for a page.
 978   *
 979   * Creates an 'Overview' help tab.
 980   *
 981   * @since 2.7.0
 982   * @deprecated 3.3.0 Use WP_Screen::add_help_tab()
 983   * @see WP_Screen::add_help_tab()
 984   *
 985   * @param string    $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
 986   * @param string    $help   The content of an 'Overview' help tab.
 987   */
 988  function add_contextual_help( $screen, $help ) {
 989      _deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' );
 990  
 991      if ( is_string( $screen ) )
 992          $screen = convert_to_screen( $screen );
 993  
 994      WP_Screen::add_old_compat_help( $screen, $help );
 995  }
 996  
 997  /**
 998   * Get the allowed themes for the current site.
 999   *
1000   * @since 3.0.0
1001   * @deprecated 3.4.0 Use wp_get_themes()
1002   * @see wp_get_themes()
1003   *
1004   * @return array $themes Array of allowed themes.
1005   */
1006  function get_allowed_themes() {
1007      _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" );
1008  
1009      $themes = wp_get_themes( array( 'allowed' => true ) );
1010  
1011      $wp_themes = array();
1012      foreach ( $themes as $theme ) {
1013          $wp_themes[ $theme->get('Name') ] = $theme;
1014      }
1015  
1016      return $wp_themes;
1017  }
1018  
1019  /**
1020   * Retrieves a list of broken themes.
1021   *
1022   * @since 1.5.0
1023   * @deprecated 3.4.0 Use wp_get_themes()
1024   * @see wp_get_themes()
1025   *
1026   * @return array
1027   */
1028  function get_broken_themes() {
1029      _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" );
1030  
1031      $themes = wp_get_themes( array( 'errors' => true ) );
1032      $broken = array();
1033      foreach ( $themes as $theme ) {
1034          $name = $theme->get('Name');
1035          $broken[ $name ] = array(
1036              'Name' => $name,
1037              'Title' => $name,
1038              'Description' => $theme->errors()->get_error_message(),
1039          );
1040      }
1041      return $broken;
1042  }
1043  
1044  /**
1045   * Retrieves information on the current active theme.
1046   *
1047   * @since 2.0.0
1048   * @deprecated 3.4.0 Use wp_get_theme()
1049   * @see wp_get_theme()
1050   *
1051   * @return WP_Theme
1052   */
1053  function current_theme_info() {
1054      _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
1055  
1056      return wp_get_theme();
1057  }
1058  
1059  /**
1060   * This was once used to display an 'Insert into Post' button.
1061   *
1062   * Now it is deprecated and stubbed.
1063   *
1064   * @deprecated 3.5.0
1065   */
1066  function _insert_into_post_button( $type ) {
1067      _deprecated_function( __FUNCTION__, '3.5.0' );
1068  }
1069  
1070  /**
1071   * This was once used to display a media button.
1072   *
1073   * Now it is deprecated and stubbed.
1074   *
1075   * @deprecated 3.5.0
1076   */
1077  function _media_button($title, $icon, $type, $id) {
1078      _deprecated_function( __FUNCTION__, '3.5.0' );
1079  }
1080  
1081  /**
1082   * Gets an existing post and format it for editing.
1083   *
1084   * @since 2.0.0
1085   * @deprecated 3.5.0 Use get_post()
1086   * @see get_post()
1087   *
1088   * @param int $id
1089   * @return object
1090   */
1091  function get_post_to_edit( $id ) {
1092      _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );
1093  
1094      return get_post( $id, OBJECT, 'edit' );
1095  }
1096  
1097  /**
1098   * Gets the default page information to use.
1099   *
1100   * @since 2.5.0
1101   * @deprecated 3.5.0 Use get_default_post_to_edit()
1102   * @see get_default_post_to_edit()
1103   *
1104   * @return WP_Post Post object containing all the default post data as attributes
1105   */
1106  function get_default_page_to_edit() {
1107      _deprecated_function( __FUNCTION__, '3.5.0', "get_default_post_to_edit( 'page' )" );
1108  
1109      $page = get_default_post_to_edit();
1110      $page->post_type = 'page';
1111      return $page;
1112  }
1113  
1114  /**
1115   * This was once used to create a thumbnail from an Image given a maximum side size.
1116   *
1117   * @since 1.2.0
1118   * @deprecated 3.5.0 Use image_resize()
1119   * @see image_resize()
1120   *
1121   * @param mixed $file Filename of the original image, Or attachment id.
1122   * @param int $max_side Maximum length of a single side for the thumbnail.
1123   * @param mixed $deprecated Never used.
1124   * @return string Thumbnail path on success, Error string on failure.
1125   */
1126  function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
1127      _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );
1128      return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
1129  }
1130  
1131  /**
1132   * This was once used to display a meta box for the nav menu theme locations.
1133   *
1134   * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
1135   *
1136   * @since 3.0.0
1137   * @deprecated 3.6.0
1138   */
1139  function wp_nav_menu_locations_meta_box() {
1140      _deprecated_function( __FUNCTION__, '3.6.0' );
1141  }
1142  
1143  /**
1144   * This was once used to kick-off the Core Updater.
1145   *
1146   * Deprecated in favor of instantating a Core_Upgrader instance directly,
1147   * and calling the 'upgrade' method.
1148   *
1149   * @since 2.7.0
1150   * @deprecated 3.7.0 Use Core_Upgrader
1151   * @see Core_Upgrader
1152   */
1153  function wp_update_core($current, $feedback = '') {
1154      _deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' );
1155  
1156      if ( !empty($feedback) )
1157          add_filter('update_feedback', $feedback);
1158  
1159      include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1160      $upgrader = new Core_Upgrader();
1161      return $upgrader->upgrade($current);
1162  
1163  }
1164  
1165  /**
1166   * This was once used to kick-off the Plugin Updater.
1167   *
1168   * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
1169   * and calling the 'upgrade' method.
1170   * Unused since 2.8.0.
1171   *
1172   * @since 2.5.0
1173   * @deprecated 3.7.0 Use Plugin_Upgrader
1174   * @see Plugin_Upgrader
1175   */
1176  function wp_update_plugin($plugin, $feedback = '') {
1177      _deprecated_function( __FUNCTION__, '3.7.0', 'new Plugin_Upgrader();' );
1178  
1179      if ( !empty($feedback) )
1180          add_filter('update_feedback', $feedback);
1181  
1182      include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1183      $upgrader = new Plugin_Upgrader();
1184      return $upgrader->upgrade($plugin);
1185  }
1186  
1187  /**
1188   * This was once used to kick-off the Theme Updater.
1189   *
1190   * Deprecated in favor of instantiating a Theme_Upgrader instance directly,
1191   * and calling the 'upgrade' method.
1192   * Unused since 2.8.0.
1193   *
1194   * @since 2.7.0
1195   * @deprecated 3.7.0 Use Theme_Upgrader
1196   * @see Theme_Upgrader
1197   */
1198  function wp_update_theme($theme, $feedback = '') {
1199      _deprecated_function( __FUNCTION__, '3.7.0', 'new Theme_Upgrader();' );
1200  
1201      if ( !empty($feedback) )
1202          add_filter('update_feedback', $feedback);
1203  
1204      include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
1205      $upgrader = new Theme_Upgrader();
1206      return $upgrader->upgrade($theme);
1207  }
1208  
1209  /**
1210   * This was once used to display attachment links. Now it is deprecated and stubbed.
1211   *
1212   * @since 2.0.0
1213   * @deprecated 3.7.0
1214   *
1215   * @param int|bool $id
1216   */
1217  function the_attachment_links( $id = false ) {
1218      _deprecated_function( __FUNCTION__, '3.7.0' );
1219  }
1220  
1221  /**
1222   * Displays a screen icon.
1223   *
1224   * @since 2.7.0
1225   * @deprecated 3.8.0
1226   */
1227  function screen_icon() {
1228      _deprecated_function( __FUNCTION__, '3.8.0' );
1229      echo get_screen_icon();
1230  }
1231  
1232  /**
1233   * Retrieves the screen icon (no longer used in 3.8+).
1234   *
1235   * @since 3.2.0
1236   * @deprecated 3.8.0
1237   *
1238   * @return string An HTML comment explaining that icons are no longer used.
1239   */
1240  function get_screen_icon() {
1241      _deprecated_function( __FUNCTION__, '3.8.0' );
1242      return '<!-- Screen icons are no longer used as of WordPress 3.8. -->';
1243  }
1244  
1245  /**
1246   * Deprecated dashboard widget controls.
1247   *
1248   * @since 2.5.0
1249   * @deprecated 3.8.0
1250   */
1251  function wp_dashboard_incoming_links_output() {}
1252  
1253  /**
1254   * Deprecated dashboard secondary output.
1255   *
1256   * @deprecated 3.8.0
1257   */
1258  function wp_dashboard_secondary_output() {}
1259  
1260  /**
1261   * Deprecated dashboard widget controls.
1262   *
1263   * @since 2.7.0
1264   * @deprecated 3.8.0
1265   */
1266  function wp_dashboard_incoming_links() {}
1267  
1268  /**
1269   * Deprecated dashboard incoming links control.
1270   *
1271   * @deprecated 3.8.0
1272   */
1273  function wp_dashboard_incoming_links_control() {}
1274  
1275  /**
1276   * Deprecated dashboard plugins control.
1277   *
1278   * @deprecated 3.8.0
1279   */
1280  function wp_dashboard_plugins() {}
1281  
1282  /**
1283   * Deprecated dashboard primary control.
1284   *
1285   * @deprecated 3.8.0
1286   */
1287  function wp_dashboard_primary_control() {}
1288  
1289  /**
1290   * Deprecated dashboard recent comments control.
1291   *
1292   * @deprecated 3.8.0
1293   */
1294  function wp_dashboard_recent_comments_control() {}
1295  
1296  /**
1297   * Deprecated dashboard secondary section.
1298   *
1299   * @deprecated 3.8.0
1300   */
1301  function wp_dashboard_secondary() {}
1302  
1303  /**
1304   * Deprecated dashboard secondary control.
1305   *
1306   * @deprecated 3.8.0
1307   */
1308  function wp_dashboard_secondary_control() {}
1309  
1310  /**
1311   * Display plugins text for the WordPress news widget.
1312   *
1313   * @since 2.5.0
1314   * @deprecated 4.8.0
1315   *
1316   * @param string $rss  The RSS feed URL.
1317   * @param array  $args Array of arguments for this RSS feed.
1318   */
1319  function wp_dashboard_plugins_output( $rss, $args = array() ) {
1320      _deprecated_function( __FUNCTION__, '4.8.0' );
1321  
1322      // Plugin feeds plus link to install them
1323      $popular = fetch_feed( $args['url']['popular'] );
1324  
1325      if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
1326          $plugin_slugs = array_keys( get_plugins() );
1327          set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
1328      }
1329  
1330      echo '<ul>';
1331  
1332      foreach ( array( $popular ) as $feed ) {
1333          if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )
1334              continue;
1335  
1336          $items = $feed->get_items(0, 5);
1337  
1338          // Pick a random, non-installed plugin
1339          while ( true ) {
1340              // Abort this foreach loop iteration if there's no plugins left of this type
1341              if ( 0 == count($items) )
1342                  continue 2;
1343  
1344              $item_key = array_rand($items);
1345              $item = $items[$item_key];
1346  
1347              list($link, $frag) = explode( '#', $item->get_link() );
1348  
1349              $link = esc_url($link);
1350              if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
1351                  $slug = $matches[1];
1352              else {
1353                  unset( $items[$item_key] );
1354                  continue;
1355              }
1356  
1357              // Is this random plugin's slug already installed? If so, try again.
1358              reset( $plugin_slugs );
1359              foreach ( $plugin_slugs as $plugin_slug ) {
1360                  if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
1361                      unset( $items[$item_key] );
1362                      continue 2;
1363                  }
1364              }
1365  
1366              // If we get to this point, then the random plugin isn't installed and we can stop the while().
1367              break;
1368          }
1369  
1370          // Eliminate some common badly formed plugin descriptions
1371          while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
1372              unset($items[$item_key]);
1373  
1374          if ( !isset($items[$item_key]) )
1375              continue;
1376  
1377          $raw_title = $item->get_title();
1378  
1379          $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&amp;TB_iframe=true&amp;width=600&amp;height=800';
1380          echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
1381              '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
1382              /* translators: %s: Plugin name. */
1383              esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
1384  
1385          $feed->__destruct();
1386          unset( $feed );
1387      }
1388  
1389      echo '</ul>';
1390  }
1391  
1392  /**
1393   * This was once used to move child posts to a new parent.
1394   *
1395   * @since 2.3.0
1396   * @deprecated 3.9.0
1397   * @access private
1398   *
1399   * @param int $old_ID
1400   * @param int $new_ID
1401   */
1402  function _relocate_children( $old_ID, $new_ID ) {
1403      _deprecated_function( __FUNCTION__, '3.9.0' );
1404  }
1405  
1406  /**
1407   * Add a top-level menu page in the 'objects' section.
1408   *
1409   * This function takes a capability which will be used to determine whether
1410   * or not a page is included in the menu.
1411   *
1412   * The function which is hooked in to handle the output of the page must check
1413   * that the user has the required capability as well.
1414   *
1415   * @since 2.7.0
1416   *
1417   * @deprecated 4.5.0 Use add_menu_page()
1418   * @see add_menu_page()
1419   * @global int $_wp_last_object_menu
1420   *
1421   * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
1422   * @param string   $menu_title The text to be used for the menu.
1423   * @param string   $capability The capability required for this menu to be displayed to the user.
1424   * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
1425   * @param callable $function   The function to be called to output the content for this page.
1426   * @param string   $icon_url   The url to the icon to be used for this menu.
1427   * @return string The resulting page's hook_suffix.
1428   */
1429  function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
1430      _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
1431  
1432      global $_wp_last_object_menu;
1433  
1434      $_wp_last_object_menu++;
1435  
1436      return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
1437  }
1438  
1439  /**
1440   * Add a top-level menu page in the 'utility' section.
1441   *
1442   * This function takes a capability which will be used to determine whether
1443   * or not a page is included in the menu.
1444   *
1445   * The function which is hooked in to handle the output of the page must check
1446   * that the user has the required capability as well.
1447   *
1448   * @since 2.7.0
1449   *
1450   * @deprecated 4.5.0 Use add_menu_page()
1451   * @see add_menu_page()
1452   * @global int $_wp_last_utility_menu
1453   *
1454   * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
1455   * @param string   $menu_title The text to be used for the menu.
1456   * @param string   $capability The capability required for this menu to be displayed to the user.
1457   * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
1458   * @param callable $function   The function to be called to output the content for this page.
1459   * @param string   $icon_url   The url to the icon to be used for this menu.
1460   * @return string The resulting page's hook_suffix.
1461   */
1462  function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
1463      _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
1464  
1465      global $_wp_last_utility_menu;
1466  
1467      $_wp_last_utility_menu++;
1468  
1469      return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
1470  }
1471  
1472  /**
1473   * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
1474   * as they disregard the autocomplete setting on the editor textarea. That can break the editor
1475   * when the user navigates to it with the browser's Back button. See #28037
1476   *
1477   * Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.
1478   *
1479   * @since 4.0.0
1480   * @deprecated 4.6.0
1481   *
1482   * @link https://core.trac.wordpress.org/ticket/35852
1483   *
1484   * @global bool $is_safari
1485   * @global bool $is_chrome
1486   */
1487  function post_form_autocomplete_off() {
1488      global $is_safari, $is_chrome;
1489  
1490      _deprecated_function( __FUNCTION__, '4.6.0' );
1491  
1492      if ( $is_safari || $is_chrome ) {
1493          echo ' autocomplete="off"';
1494      }
1495  }
1496  
1497  /**
1498   * Display JavaScript on the page.
1499   *
1500   * @since 3.5.0
1501   * @deprecated 4.9.0
1502   */
1503  function options_permalink_add_js() {
1504      ?>
1505      <script type="text/javascript">
1506          jQuery(document).ready(function() {
1507              jQuery('.permalink-structure input:radio').change(function() {
1508                  if ( 'custom' == this.value )
1509                      return;
1510                  jQuery('#permalink_structure').val( this.value );
1511              });
1512              jQuery( '#permalink_structure' ).on( 'click input', function() {
1513                  jQuery( '#custom_selection' ).prop( 'checked', true );
1514              });
1515          });
1516      </script>
1517      <?php
1518  }
1519  
1520  /**
1521   * Previous class for list table for privacy data export requests.
1522   *
1523   * @since 4.9.6
1524   * @deprecated 5.3.0
1525   */
1526  class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Data_Export_Requests_List_Table {
1527  	function __construct( $args ) {
1528          _deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Export_Requests_List_Table' );
1529  
1530          if ( ! isset( $args['screen'] ) || $args['screen'] === 'export_personal_data' ) {
1531              $args['screen'] = 'export-personal-data';
1532          }
1533  
1534          parent::__construct( $args );    
1535      }
1536  }
1537  
1538  /**
1539   * Previous class for list table for privacy data erasure requests.
1540   *
1541   * @since 4.9.6
1542   * @deprecated 5.3.0
1543   */
1544  class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Data_Removal_Requests_List_Table {
1545  	function __construct( $args ) {
1546          _deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Removal_Requests_List_Table' );
1547  
1548          if ( ! isset( $args['screen'] ) || $args['screen'] === 'remove_personal_data' ) {
1549              $args['screen'] = 'erase-personal-data';
1550          }
1551  
1552          parent::__construct( $args );
1553      }
1554  }
1555  
1556  /**
1557   * Was used to add options for the privacy requests screens before they were separate files.
1558   *
1559   * @since 4.9.8
1560   * @access private
1561   * @deprecated 5.3.0
1562   */
1563  function _wp_privacy_requests_screen_options() {
1564      _deprecated_function( __FUNCTION__, '5.3.0' );
1565  }


Generated: Wed Sep 18 01:00:03 2019 Cross-referenced by PHPXref 0.7.1