[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

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 an allowed option key name.
 163   *                             Default allowed 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  function wp_tiny_mce( $teeny = false, $settings = false ) {
 759      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 760  
 761      static $num = 1;
 762  
 763      if ( ! class_exists( '_WP_Editors', false ) )
 764          require_once  ABSPATH . WPINC . '/class-wp-editor.php';
 765  
 766      $editor_id = 'content' . $num++;
 767  
 768      $set = array(
 769          'teeny' => $teeny,
 770          'tinymce' => $settings ? $settings : true,
 771          'quicktags' => false
 772      );
 773  
 774      $set = _WP_Editors::parse_settings($editor_id, $set);
 775      _WP_Editors::editor_settings($editor_id, $set);
 776  }
 777  
 778  /**
 779   * Preloads TinyMCE dialogs.
 780   *
 781   * @deprecated 3.3.0 Use wp_editor()
 782   * @see wp_editor()
 783   */
 784  function wp_preload_dialogs() {
 785      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 786  }
 787  
 788  /**
 789   * Prints TinyMCE editor JS.
 790   *
 791   * @deprecated 3.3.0 Use wp_editor()
 792   * @see wp_editor()
 793   */
 794  function wp_print_editor_js() {
 795      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 796  }
 797  
 798  /**
 799   * Handles quicktags.
 800   *
 801   * @deprecated 3.3.0 Use wp_editor()
 802   * @see wp_editor()
 803   */
 804  function wp_quicktags() {
 805      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );
 806  }
 807  
 808  /**
 809   * Returns the screen layout options.
 810   *
 811   * @since 2.8.0
 812   * @deprecated 3.3.0 WP_Screen::render_screen_layout()
 813   * @see WP_Screen::render_screen_layout()
 814   */
 815  function screen_layout( $screen ) {
 816      _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_screen_layout()' );
 817  
 818      $current_screen = get_current_screen();
 819  
 820      if ( ! $current_screen )
 821          return '';
 822  
 823      ob_start();
 824      $current_screen->render_screen_layout();
 825      return ob_get_clean();
 826  }
 827  
 828  /**
 829   * Returns the screen's per-page options.
 830   *
 831   * @since 2.8.0
 832   * @deprecated 3.3.0 Use WP_Screen::render_per_page_options()
 833   * @see WP_Screen::render_per_page_options()
 834   */
 835  function screen_options( $screen ) {
 836      _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_per_page_options()' );
 837  
 838      $current_screen = get_current_screen();
 839  
 840      if ( ! $current_screen )
 841          return '';
 842  
 843      ob_start();
 844      $current_screen->render_per_page_options();
 845      return ob_get_clean();
 846  }
 847  
 848  /**
 849   * Renders the screen's help.
 850   *
 851   * @since 2.7.0
 852   * @deprecated 3.3.0 Use WP_Screen::render_screen_meta()
 853   * @see WP_Screen::render_screen_meta()
 854   */
 855  function screen_meta( $screen ) {
 856      $current_screen = get_current_screen();
 857      $current_screen->render_screen_meta();
 858  }
 859  
 860  /**
 861   * Favorite actions were deprecated in version 3.2. Use the admin bar instead.
 862   *
 863   * @since 2.7.0
 864   * @deprecated 3.2.0 Use WP_Admin_Bar
 865   * @see WP_Admin_Bar
 866   */
 867  function favorite_actions() {
 868      _deprecated_function( __FUNCTION__, '3.2.0', 'WP_Admin_Bar' );
 869  }
 870  
 871  /**
 872   * Handles uploading an image.
 873   *
 874   * @deprecated 3.3.0 Use wp_media_upload_handler()
 875   * @see wp_media_upload_handler()
 876   *
 877   * @return null|string
 878   */
 879  function media_upload_image() {
 880      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 881      return wp_media_upload_handler();
 882  }
 883  
 884  /**
 885   * Handles uploading an audio file.
 886   *
 887   * @deprecated 3.3.0 Use wp_media_upload_handler()
 888   * @see wp_media_upload_handler()
 889   *
 890   * @return null|string
 891   */
 892  function media_upload_audio() {
 893      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 894      return wp_media_upload_handler();
 895  }
 896  
 897  /**
 898   * Handles uploading a video file.
 899   *
 900   * @deprecated 3.3.0 Use wp_media_upload_handler()
 901   * @see wp_media_upload_handler()
 902   *
 903   * @return null|string
 904   */
 905  function media_upload_video() {
 906      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 907      return wp_media_upload_handler();
 908  }
 909  
 910  /**
 911   * Handles uploading a generic file.
 912   *
 913   * @deprecated 3.3.0 Use wp_media_upload_handler()
 914   * @see wp_media_upload_handler()
 915   *
 916   * @return null|string
 917   */
 918  function media_upload_file() {
 919      _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' );
 920      return wp_media_upload_handler();
 921  }
 922  
 923  /**
 924   * Handles retrieving the insert-from-URL form for an image.
 925   *
 926   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 927   * @see wp_media_insert_url_form()
 928   *
 929   * @return string
 930   */
 931  function type_url_form_image() {
 932      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('image')" );
 933      return wp_media_insert_url_form( 'image' );
 934  }
 935  
 936  /**
 937   * Handles retrieving the insert-from-URL form for an audio file.
 938   *
 939   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 940   * @see wp_media_insert_url_form()
 941   *
 942   * @return string
 943   */
 944  function type_url_form_audio() {
 945      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('audio')" );
 946      return wp_media_insert_url_form( 'audio' );
 947  }
 948  
 949  /**
 950   * Handles retrieving the insert-from-URL form for a video file.
 951   *
 952   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 953   * @see wp_media_insert_url_form()
 954   *
 955   * @return string
 956   */
 957  function type_url_form_video() {
 958      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('video')" );
 959      return wp_media_insert_url_form( 'video' );
 960  }
 961  
 962  /**
 963   * Handles retrieving the insert-from-URL form for a generic file.
 964   *
 965   * @deprecated 3.3.0 Use wp_media_insert_url_form()
 966   * @see wp_media_insert_url_form()
 967   *
 968   * @return string
 969   */
 970  function type_url_form_file() {
 971      _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('file')" );
 972      return wp_media_insert_url_form( 'file' );
 973  }
 974  
 975  /**
 976   * Add contextual help text for a page.
 977   *
 978   * Creates an 'Overview' help tab.
 979   *
 980   * @since 2.7.0
 981   * @deprecated 3.3.0 Use WP_Screen::add_help_tab()
 982   * @see WP_Screen::add_help_tab()
 983   *
 984   * @param string    $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
 985   * @param string    $help   The content of an 'Overview' help tab.
 986   */
 987  function add_contextual_help( $screen, $help ) {
 988      _deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' );
 989  
 990      if ( is_string( $screen ) )
 991          $screen = convert_to_screen( $screen );
 992  
 993      WP_Screen::add_old_compat_help( $screen, $help );
 994  }
 995  
 996  /**
 997   * Get the allowed themes for the current site.
 998   *
 999   * @since 3.0.0
1000   * @deprecated 3.4.0 Use wp_get_themes()
1001   * @see wp_get_themes()
1002   *
1003   * @return WP_Theme[] Array of WP_Theme objects keyed by their name.
1004   */
1005  function get_allowed_themes() {
1006      _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" );
1007  
1008      $themes = wp_get_themes( array( 'allowed' => true ) );
1009  
1010      $wp_themes = array();
1011      foreach ( $themes as $theme ) {
1012          $wp_themes[ $theme->get('Name') ] = $theme;
1013      }
1014  
1015      return $wp_themes;
1016  }
1017  
1018  /**
1019   * Retrieves a list of broken themes.
1020   *
1021   * @since 1.5.0
1022   * @deprecated 3.4.0 Use wp_get_themes()
1023   * @see wp_get_themes()
1024   *
1025   * @return array
1026   */
1027  function get_broken_themes() {
1028      _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'errors' => true )" );
1029  
1030      $themes = wp_get_themes( array( 'errors' => true ) );
1031      $broken = array();
1032      foreach ( $themes as $theme ) {
1033          $name = $theme->get('Name');
1034          $broken[ $name ] = array(
1035              'Name' => $name,
1036              'Title' => $name,
1037              'Description' => $theme->errors()->get_error_message(),
1038          );
1039      }
1040      return $broken;
1041  }
1042  
1043  /**
1044   * Retrieves information on the current active theme.
1045   *
1046   * @since 2.0.0
1047   * @deprecated 3.4.0 Use wp_get_theme()
1048   * @see wp_get_theme()
1049   *
1050   * @return WP_Theme
1051   */
1052  function current_theme_info() {
1053      _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );
1054  
1055      return wp_get_theme();
1056  }
1057  
1058  /**
1059   * This was once used to display an 'Insert into Post' button.
1060   *
1061   * Now it is deprecated and stubbed.
1062   *
1063   * @deprecated 3.5.0
1064   */
1065  function _insert_into_post_button( $type ) {
1066      _deprecated_function( __FUNCTION__, '3.5.0' );
1067  }
1068  
1069  /**
1070   * This was once used to display a media button.
1071   *
1072   * Now it is deprecated and stubbed.
1073   *
1074   * @deprecated 3.5.0
1075   */
1076  function _media_button($title, $icon, $type, $id) {
1077      _deprecated_function( __FUNCTION__, '3.5.0' );
1078  }
1079  
1080  /**
1081   * Gets an existing post and format it for editing.
1082   *
1083   * @since 2.0.0
1084   * @deprecated 3.5.0 Use get_post()
1085   * @see get_post()
1086   *
1087   * @param int $id
1088   * @return WP_Post
1089   */
1090  function get_post_to_edit( $id ) {
1091      _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' );
1092  
1093      return get_post( $id, OBJECT, 'edit' );
1094  }
1095  
1096  /**
1097   * Gets the default page information to use.
1098   *
1099   * @since 2.5.0
1100   * @deprecated 3.5.0 Use get_default_post_to_edit()
1101   * @see get_default_post_to_edit()
1102   *
1103   * @return WP_Post Post object containing all the default post data as attributes
1104   */
1105  function get_default_page_to_edit() {
1106      _deprecated_function( __FUNCTION__, '3.5.0', "get_default_post_to_edit( 'page' )" );
1107  
1108      $page = get_default_post_to_edit();
1109      $page->post_type = 'page';
1110      return $page;
1111  }
1112  
1113  /**
1114   * This was once used to create a thumbnail from an Image given a maximum side size.
1115   *
1116   * @since 1.2.0
1117   * @deprecated 3.5.0 Use image_resize()
1118   * @see image_resize()
1119   *
1120   * @param mixed $file Filename of the original image, Or attachment ID.
1121   * @param int $max_side Maximum length of a single side for the thumbnail.
1122   * @param mixed $deprecated Never used.
1123   * @return string Thumbnail path on success, Error string on failure.
1124   */
1125  function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
1126      _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' );
1127      return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
1128  }
1129  
1130  /**
1131   * This was once used to display a meta box for the nav menu theme locations.
1132   *
1133   * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen.
1134   *
1135   * @since 3.0.0
1136   * @deprecated 3.6.0
1137   */
1138  function wp_nav_menu_locations_meta_box() {
1139      _deprecated_function( __FUNCTION__, '3.6.0' );
1140  }
1141  
1142  /**
1143   * This was once used to kick-off the Core Updater.
1144   *
1145   * Deprecated in favor of instantating a Core_Upgrader instance directly,
1146   * and calling the 'upgrade' method.
1147   *
1148   * @since 2.7.0
1149   * @deprecated 3.7.0 Use Core_Upgrader
1150   * @see Core_Upgrader
1151   */
1152  function wp_update_core($current, $feedback = '') {
1153      _deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' );
1154  
1155      if ( !empty($feedback) )
1156          add_filter('update_feedback', $feedback);
1157  
1158      require  ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1159      $upgrader = new Core_Upgrader();
1160      return $upgrader->upgrade($current);
1161  
1162  }
1163  
1164  /**
1165   * This was once used to kick-off the Plugin Updater.
1166   *
1167   * Deprecated in favor of instantating a Plugin_Upgrader instance directly,
1168   * and calling the 'upgrade' method.
1169   * Unused since 2.8.0.
1170   *
1171   * @since 2.5.0
1172   * @deprecated 3.7.0 Use Plugin_Upgrader
1173   * @see Plugin_Upgrader
1174   */
1175  function wp_update_plugin($plugin, $feedback = '') {
1176      _deprecated_function( __FUNCTION__, '3.7.0', 'new Plugin_Upgrader();' );
1177  
1178      if ( !empty($feedback) )
1179          add_filter('update_feedback', $feedback);
1180  
1181      require  ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1182      $upgrader = new Plugin_Upgrader();
1183      return $upgrader->upgrade($plugin);
1184  }
1185  
1186  /**
1187   * This was once used to kick-off the Theme Updater.
1188   *
1189   * Deprecated in favor of instantiating a Theme_Upgrader instance directly,
1190   * and calling the 'upgrade' method.
1191   * Unused since 2.8.0.
1192   *
1193   * @since 2.7.0
1194   * @deprecated 3.7.0 Use Theme_Upgrader
1195   * @see Theme_Upgrader
1196   */
1197  function wp_update_theme($theme, $feedback = '') {
1198      _deprecated_function( __FUNCTION__, '3.7.0', 'new Theme_Upgrader();' );
1199  
1200      if ( !empty($feedback) )
1201          add_filter('update_feedback', $feedback);
1202  
1203      require  ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
1204      $upgrader = new Theme_Upgrader();
1205      return $upgrader->upgrade($theme);
1206  }
1207  
1208  /**
1209   * This was once used to display attachment links. Now it is deprecated and stubbed.
1210   *
1211   * @since 2.0.0
1212   * @deprecated 3.7.0
1213   *
1214   * @param int|bool $id
1215   */
1216  function the_attachment_links( $id = false ) {
1217      _deprecated_function( __FUNCTION__, '3.7.0' );
1218  }
1219  
1220  /**
1221   * Displays a screen icon.
1222   *
1223   * @since 2.7.0
1224   * @deprecated 3.8.0
1225   */
1226  function screen_icon() {
1227      _deprecated_function( __FUNCTION__, '3.8.0' );
1228      echo get_screen_icon();
1229  }
1230  
1231  /**
1232   * Retrieves the screen icon (no longer used in 3.8+).
1233   *
1234   * @since 3.2.0
1235   * @deprecated 3.8.0
1236   *
1237   * @return string An HTML comment explaining that icons are no longer used.
1238   */
1239  function get_screen_icon() {
1240      _deprecated_function( __FUNCTION__, '3.8.0' );
1241      return '<!-- Screen icons are no longer used as of WordPress 3.8. -->';
1242  }
1243  
1244  /**
1245   * Deprecated dashboard widget controls.
1246   *
1247   * @since 2.5.0
1248   * @deprecated 3.8.0
1249   */
1250  function wp_dashboard_incoming_links_output() {}
1251  
1252  /**
1253   * Deprecated dashboard secondary output.
1254   *
1255   * @deprecated 3.8.0
1256   */
1257  function wp_dashboard_secondary_output() {}
1258  
1259  /**
1260   * Deprecated dashboard widget controls.
1261   *
1262   * @since 2.7.0
1263   * @deprecated 3.8.0
1264   */
1265  function wp_dashboard_incoming_links() {}
1266  
1267  /**
1268   * Deprecated dashboard incoming links control.
1269   *
1270   * @deprecated 3.8.0
1271   */
1272  function wp_dashboard_incoming_links_control() {}
1273  
1274  /**
1275   * Deprecated dashboard plugins control.
1276   *
1277   * @deprecated 3.8.0
1278   */
1279  function wp_dashboard_plugins() {}
1280  
1281  /**
1282   * Deprecated dashboard primary control.
1283   *
1284   * @deprecated 3.8.0
1285   */
1286  function wp_dashboard_primary_control() {}
1287  
1288  /**
1289   * Deprecated dashboard recent comments control.
1290   *
1291   * @deprecated 3.8.0
1292   */
1293  function wp_dashboard_recent_comments_control() {}
1294  
1295  /**
1296   * Deprecated dashboard secondary section.
1297   *
1298   * @deprecated 3.8.0
1299   */
1300  function wp_dashboard_secondary() {}
1301  
1302  /**
1303   * Deprecated dashboard secondary control.
1304   *
1305   * @deprecated 3.8.0
1306   */
1307  function wp_dashboard_secondary_control() {}
1308  
1309  /**
1310   * Display plugins text for the WordPress news widget.
1311   *
1312   * @since 2.5.0
1313   * @deprecated 4.8.0
1314   *
1315   * @param string $rss  The RSS feed URL.
1316   * @param array  $args Array of arguments for this RSS feed.
1317   */
1318  function wp_dashboard_plugins_output( $rss, $args = array() ) {
1319      _deprecated_function( __FUNCTION__, '4.8.0' );
1320  
1321      // Plugin feeds plus link to install them.
1322      $popular = fetch_feed( $args['url']['popular'] );
1323  
1324      if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
1325          $plugin_slugs = array_keys( get_plugins() );
1326          set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
1327      }
1328  
1329      echo '<ul>';
1330  
1331      foreach ( array( $popular ) as $feed ) {
1332          if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() )
1333              continue;
1334  
1335          $items = $feed->get_items(0, 5);
1336  
1337          // Pick a random, non-installed plugin.
1338          while ( true ) {
1339              // Abort this foreach loop iteration if there's no plugins left of this type.
1340              if ( 0 === count($items) )
1341                  continue 2;
1342  
1343              $item_key = array_rand($items);
1344              $item = $items[$item_key];
1345  
1346              list($link, $frag) = explode( '#', $item->get_link() );
1347  
1348              $link = esc_url($link);
1349              if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) )
1350                  $slug = $matches[1];
1351              else {
1352                  unset( $items[$item_key] );
1353                  continue;
1354              }
1355  
1356              // Is this random plugin's slug already installed? If so, try again.
1357              reset( $plugin_slugs );
1358              foreach ( $plugin_slugs as $plugin_slug ) {
1359                  if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) {
1360                      unset( $items[$item_key] );
1361                      continue 2;
1362                  }
1363              }
1364  
1365              // If we get to this point, then the random plugin isn't installed and we can stop the while().
1366              break;
1367          }
1368  
1369          // Eliminate some common badly formed plugin descriptions.
1370          while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
1371              unset($items[$item_key]);
1372  
1373          if ( !isset($items[$item_key]) )
1374              continue;
1375  
1376          $raw_title = $item->get_title();
1377  
1378          $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';
1379          echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) .
1380              '&nbsp;<a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' .
1381              /* translators: %s: Plugin name. */
1382              esc_attr( sprintf( _x( 'Install %s', 'plugin' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>';
1383  
1384          $feed->__destruct();
1385          unset( $feed );
1386      }
1387  
1388      echo '</ul>';
1389  }
1390  
1391  /**
1392   * This was once used to move child posts to a new parent.
1393   *
1394   * @since 2.3.0
1395   * @deprecated 3.9.0
1396   * @access private
1397   *
1398   * @param int $old_ID
1399   * @param int $new_ID
1400   */
1401  function _relocate_children( $old_ID, $new_ID ) {
1402      _deprecated_function( __FUNCTION__, '3.9.0' );
1403  }
1404  
1405  /**
1406   * Add a top-level menu page in the 'objects' section.
1407   *
1408   * This function takes a capability which will be used to determine whether
1409   * or not a page is included in the menu.
1410   *
1411   * The function which is hooked in to handle the output of the page must check
1412   * that the user has the required capability as well.
1413   *
1414   * @since 2.7.0
1415   *
1416   * @deprecated 4.5.0 Use add_menu_page()
1417   * @see add_menu_page()
1418   * @global int $_wp_last_object_menu
1419   *
1420   * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
1421   * @param string   $menu_title The text to be used for the menu.
1422   * @param string   $capability The capability required for this menu to be displayed to the user.
1423   * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
1424   * @param callable $function   The function to be called to output the content for this page.
1425   * @param string   $icon_url   The url to the icon to be used for this menu.
1426   * @return string The resulting page's hook_suffix.
1427   */
1428  function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
1429      _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
1430  
1431      global $_wp_last_object_menu;
1432  
1433      $_wp_last_object_menu++;
1434  
1435      return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu);
1436  }
1437  
1438  /**
1439   * Add a top-level menu page in the 'utility' section.
1440   *
1441   * This function takes a capability which will be used to determine whether
1442   * or not a page is included in the menu.
1443   *
1444   * The function which is hooked in to handle the output of the page must check
1445   * that the user has the required capability as well.
1446   *
1447   * @since 2.7.0
1448   *
1449   * @deprecated 4.5.0 Use add_menu_page()
1450   * @see add_menu_page()
1451   * @global int $_wp_last_utility_menu
1452   *
1453   * @param string   $page_title The text to be displayed in the title tags of the page when the menu is selected.
1454   * @param string   $menu_title The text to be used for the menu.
1455   * @param string   $capability The capability required for this menu to be displayed to the user.
1456   * @param string   $menu_slug  The slug name to refer to this menu by (should be unique for this menu).
1457   * @param callable $function   The function to be called to output the content for this page.
1458   * @param string   $icon_url   The url to the icon to be used for this menu.
1459   * @return string The resulting page's hook_suffix.
1460   */
1461  function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') {
1462      _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' );
1463  
1464      global $_wp_last_utility_menu;
1465  
1466      $_wp_last_utility_menu++;
1467  
1468      return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu);
1469  }
1470  
1471  /**
1472   * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers,
1473   * as they disregard the autocomplete setting on the editor textarea. That can break the editor
1474   * when the user navigates to it with the browser's Back button. See #28037
1475   *
1476   * Replaced with wp_page_reload_on_back_button_js() that also fixes this problem.
1477   *
1478   * @since 4.0.0
1479   * @deprecated 4.6.0
1480   *
1481   * @link https://core.trac.wordpress.org/ticket/35852
1482   *
1483   * @global bool $is_safari
1484   * @global bool $is_chrome
1485   */
1486  function post_form_autocomplete_off() {
1487      global $is_safari, $is_chrome;
1488  
1489      _deprecated_function( __FUNCTION__, '4.6.0' );
1490  
1491      if ( $is_safari || $is_chrome ) {
1492          echo ' autocomplete="off"';
1493      }
1494  }
1495  
1496  /**
1497   * Display JavaScript on the page.
1498   *
1499   * @since 3.5.0
1500   * @deprecated 4.9.0
1501   */
1502  function options_permalink_add_js() {
1503      ?>
1504      <script type="text/javascript">
1505          jQuery(document).ready(function() {
1506              jQuery('.permalink-structure input:radio').change(function() {
1507                  if ( 'custom' == this.value )
1508                      return;
1509                  jQuery('#permalink_structure').val( this.value );
1510              });
1511              jQuery( '#permalink_structure' ).on( 'click input', function() {
1512                  jQuery( '#custom_selection' ).prop( 'checked', true );
1513              });
1514          });
1515      </script>
1516      <?php
1517  }
1518  
1519  /**
1520   * Previous class for list table for privacy data export requests.
1521   *
1522   * @since 4.9.6
1523   * @deprecated 5.3.0
1524   */
1525  class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Data_Export_Requests_List_Table {
1526  	function __construct( $args ) {
1527          _deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Export_Requests_List_Table' );
1528  
1529          if ( ! isset( $args['screen'] ) || $args['screen'] === 'export_personal_data' ) {
1530              $args['screen'] = 'export-personal-data';
1531          }
1532  
1533          parent::__construct( $args );
1534      }
1535  }
1536  
1537  /**
1538   * Previous class for list table for privacy data erasure requests.
1539   *
1540   * @since 4.9.6
1541   * @deprecated 5.3.0
1542   */
1543  class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Data_Removal_Requests_List_Table {
1544  	function __construct( $args ) {
1545          _deprecated_function( __CLASS__, '5.3.0', 'WP_Privacy_Data_Removal_Requests_List_Table' );
1546  
1547          if ( ! isset( $args['screen'] ) || $args['screen'] === 'remove_personal_data' ) {
1548              $args['screen'] = 'erase-personal-data';
1549          }
1550  
1551          parent::__construct( $args );
1552      }
1553  }
1554  
1555  /**
1556   * Was used to add options for the privacy requests screens before they were separate files.
1557   *
1558   * @since 4.9.8
1559   * @access private
1560   * @deprecated 5.3.0
1561   */
1562  function _wp_privacy_requests_screen_options() {
1563      _deprecated_function( __FUNCTION__, '5.3.0' );
1564  }


Generated : Wed Oct 28 08:20:01 2020 Cross-referenced by PHPXref