/wp-admin/includes/deprecated.php

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