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


Generated: Sun Apr 5 01:00:03 2020 Cross-referenced by PHPXref 0.7.1