30 * @since 2.0.0 |
29 * @since 2.0.0 |
31 * @deprecated 2.5.0 |
30 * @deprecated 2.5.0 |
32 * |
31 * |
33 */ |
32 */ |
34 function documentation_link() { |
33 function documentation_link() { |
35 _deprecated_function( __FUNCTION__, '2.5' ); |
34 _deprecated_function( __FUNCTION__, '2.5.0' ); |
36 } |
35 } |
37 |
36 |
38 /** |
37 /** |
39 * Calculates the new dimensions for a downsampled image. |
38 * Calculates the new dimensions for a downsampled image. |
40 * |
39 * |
41 * @since 2.0.0 |
40 * @since 2.0.0 |
42 * @deprecated 3.0.0 |
41 * @deprecated 3.0.0 Use wp_constrain_dimensions() |
43 * @deprecated Use wp_constrain_dimensions() |
|
44 * @see wp_constrain_dimensions() |
42 * @see wp_constrain_dimensions() |
45 * |
43 * |
46 * @param int $width Current width of the image |
44 * @param int $width Current width of the image |
47 * @param int $height Current height of the image |
45 * @param int $height Current height of the image |
48 * @param int $wmax Maximum wanted width |
46 * @param int $wmax Maximum wanted width |
49 * @param int $hmax Maximum wanted height |
47 * @param int $hmax Maximum wanted height |
50 * @return array Shrunk dimensions (width, height). |
48 * @return array Shrunk dimensions (width, height). |
51 */ |
49 */ |
52 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { |
50 function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) { |
53 _deprecated_function( __FUNCTION__, '3.0', 'wp_constrain_dimensions()' ); |
51 _deprecated_function( __FUNCTION__, '3.0.0', 'wp_constrain_dimensions()' ); |
54 return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); |
52 return wp_constrain_dimensions( $width, $height, $wmax, $hmax ); |
55 } |
53 } |
56 |
54 |
57 /** |
55 /** |
58 * Calculated the new dimensions for a downsampled image. |
56 * Calculated the new dimensions for a downsampled image. |
59 * |
57 * |
60 * @since 2.0.0 |
58 * @since 2.0.0 |
61 * @deprecated 3.5.0 |
59 * @deprecated 3.5.0 Use wp_constrain_dimensions() |
62 * @deprecated Use wp_constrain_dimensions() |
|
63 * @see wp_constrain_dimensions() |
60 * @see wp_constrain_dimensions() |
64 * |
61 * |
65 * @param int $width Current width of the image |
62 * @param int $width Current width of the image |
66 * @param int $height Current height of the image |
63 * @param int $height Current height of the image |
67 * @return array Shrunk dimensions (width, height). |
64 * @return array Shrunk dimensions (width, height). |
68 */ |
65 */ |
69 function get_udims( $width, $height ) { |
66 function get_udims( $width, $height ) { |
70 _deprecated_function( __FUNCTION__, '3.5', 'wp_constrain_dimensions()' ); |
67 _deprecated_function( __FUNCTION__, '3.5.0', 'wp_constrain_dimensions()' ); |
71 return wp_constrain_dimensions( $width, $height, 128, 96 ); |
68 return wp_constrain_dimensions( $width, $height, 128, 96 ); |
72 } |
69 } |
73 |
70 |
74 /** |
71 /** |
75 * {@internal Missing Short Description}} |
72 * Legacy function used to generate the categories checklist control. |
76 * |
73 * |
77 * @since 0.71 |
74 * @since 0.71 |
78 * @deprecated 2.6.0 |
75 * @deprecated 2.6.0 Use wp_category_checklist() |
79 * @deprecated Use wp_category_checklist() |
|
80 * @see wp_category_checklist() |
76 * @see wp_category_checklist() |
81 * |
77 * |
82 * @param int $default |
78 * @param int $default Unused. |
83 * @param int $parent |
79 * @param int $parent Unused. |
84 * @param array $popular_ids |
80 * @param array $popular_ids Unused. |
85 */ |
81 */ |
86 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { |
82 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { |
87 _deprecated_function( __FUNCTION__, '2.6', 'wp_category_checklist()' ); |
83 _deprecated_function( __FUNCTION__, '2.6.0', 'wp_category_checklist()' ); |
88 global $post_ID; |
84 global $post_ID; |
89 wp_category_checklist( $post_ID ); |
85 wp_category_checklist( $post_ID ); |
90 } |
86 } |
91 |
87 |
92 /** |
88 /** |
93 * {@internal Missing Short Description}} |
89 * Legacy function used to generate a link categories checklist control. |
94 * |
90 * |
95 * @since 2.1.0 |
91 * @since 2.1.0 |
96 * @deprecated 2.6.0 |
92 * @deprecated 2.6.0 Use wp_link_category_checklist() |
97 * @deprecated Use wp_link_category_checklist() |
|
98 * @see wp_link_category_checklist() |
93 * @see wp_link_category_checklist() |
99 * |
94 * |
100 * @param int $default |
95 * @param int $default Unused. |
101 */ |
96 */ |
102 function dropdown_link_categories( $default = 0 ) { |
97 function dropdown_link_categories( $default = 0 ) { |
103 _deprecated_function( __FUNCTION__, '2.6', 'wp_link_category_checklist()' ); |
98 _deprecated_function( __FUNCTION__, '2.6.0', 'wp_link_category_checklist()' ); |
104 global $link_id; |
99 global $link_id; |
105 wp_link_category_checklist( $link_id ); |
100 wp_link_category_checklist( $link_id ); |
106 } |
101 } |
107 |
102 |
108 /** |
103 /** |
114 * |
109 * |
115 * @param string $file Filesystem path relative to the wp-content directory. |
110 * @param string $file Filesystem path relative to the wp-content directory. |
116 * @return string Full filesystem path to edit. |
111 * @return string Full filesystem path to edit. |
117 */ |
112 */ |
118 function get_real_file_to_edit( $file ) { |
113 function get_real_file_to_edit( $file ) { |
119 _deprecated_function( __FUNCTION__, '2.9' ); |
114 _deprecated_function( __FUNCTION__, '2.9.0' ); |
120 |
115 |
121 return WP_CONTENT_DIR . $file; |
116 return WP_CONTENT_DIR . $file; |
122 } |
117 } |
123 |
118 |
124 /** |
119 /** |
125 * {@internal Missing Short Description}} |
120 * Legacy function used for generating a categories drop-down control. |
126 * |
121 * |
127 * @since 1.2.0 |
122 * @since 1.2.0 |
128 * @deprecated 3.0.0 |
123 * @deprecated 3.0.0 Use wp_dropdown_categories() |
129 * @deprecated Use wp_dropdown_categories() |
|
130 * @see wp_dropdown_categories() |
124 * @see wp_dropdown_categories() |
131 * |
125 * |
132 * @param int $currentcat |
126 * @param int $currentcat Optional. ID of the current category. Default 0. |
133 * @param int $currentparent |
127 * @param int $currentparent Optional. Current parent category ID. Default 0. |
134 * @param int $parent |
128 * @param int $parent Optional. Parent ID to retrieve categories for. Default 0. |
135 * @param int $level |
129 * @param int $level Optional. Number of levels deep to display. Default 0. |
136 * @param array $categories |
130 * @param array $categories Optional. Categories to include in the control. Default 0. |
137 * @return bool|null |
131 * @return bool|null False if no categories were found. |
138 */ |
132 */ |
139 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) { |
133 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) { |
140 _deprecated_function( __FUNCTION__, '3.0', 'wp_dropdown_categories()' ); |
134 _deprecated_function( __FUNCTION__, '3.0.0', 'wp_dropdown_categories()' ); |
141 if (!$categories ) |
135 if (!$categories ) |
142 $categories = get_categories( array('hide_empty' => 0) ); |
136 $categories = get_categories( array('hide_empty' => 0) ); |
143 |
137 |
144 if ( $categories ) { |
138 if ( $categories ) { |
145 foreach ( $categories as $category ) { |
139 foreach ( $categories as $category ) { |
160 |
154 |
161 /** |
155 /** |
162 * Register a setting and its sanitization callback |
156 * Register a setting and its sanitization callback |
163 * |
157 * |
164 * @since 2.7.0 |
158 * @since 2.7.0 |
165 * @deprecated 3.0.0 |
159 * @deprecated 3.0.0 Use register_setting() |
166 * @deprecated Use register_setting() |
|
167 * @see register_setting() |
160 * @see register_setting() |
168 * |
161 * |
169 * @param string $option_group A settings group name. Should correspond to a whitelisted option key name. |
162 * @param string $option_group A settings group name. Should correspond to a whitelisted option key name. |
170 * Default whitelisted option key names include "general," "discussion," and "reading," among others. |
163 * Default whitelisted option key names include "general," "discussion," and "reading," among others. |
171 * @param string $option_name The name of an option to sanitize and save. |
164 * @param string $option_name The name of an option to sanitize and save. |
172 * @param callable $sanitize_callback A callback function that sanitizes the option's value. |
165 * @param callable $sanitize_callback A callback function that sanitizes the option's value. |
173 */ |
166 */ |
174 function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) { |
167 function add_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) { |
175 _deprecated_function( __FUNCTION__, '3.0', 'register_setting()' ); |
168 _deprecated_function( __FUNCTION__, '3.0.0', 'register_setting()' ); |
176 register_setting( $option_group, $option_name, $sanitize_callback ); |
169 register_setting( $option_group, $option_name, $sanitize_callback ); |
177 } |
170 } |
178 |
171 |
179 /** |
172 /** |
180 * Unregister a setting |
173 * Unregister a setting |
181 * |
174 * |
182 * @since 2.7.0 |
175 * @since 2.7.0 |
183 * @deprecated 3.0.0 |
176 * @deprecated 3.0.0 Use unregister_setting() |
184 * @deprecated Use unregister_setting() |
|
185 * @see unregister_setting() |
177 * @see unregister_setting() |
186 * |
178 * |
187 * @param string $option_group |
179 * @param string $option_group |
188 * @param string $option_name |
180 * @param string $option_name |
189 * @param callable $sanitize_callback |
181 * @param callable $sanitize_callback |
190 */ |
182 */ |
191 function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) { |
183 function remove_option_update_handler( $option_group, $option_name, $sanitize_callback = '' ) { |
192 _deprecated_function( __FUNCTION__, '3.0', 'unregister_setting()' ); |
184 _deprecated_function( __FUNCTION__, '3.0.0', 'unregister_setting()' ); |
193 unregister_setting( $option_group, $option_name, $sanitize_callback ); |
185 unregister_setting( $option_group, $option_name, $sanitize_callback ); |
194 } |
186 } |
195 |
187 |
196 /** |
188 /** |
197 * Determines the language to use for CodePress syntax highlighting. |
189 * Determines the language to use for CodePress syntax highlighting. |
200 * @deprecated 3.0.0 |
192 * @deprecated 3.0.0 |
201 * |
193 * |
202 * @param string $filename |
194 * @param string $filename |
203 **/ |
195 **/ |
204 function codepress_get_lang( $filename ) { |
196 function codepress_get_lang( $filename ) { |
205 _deprecated_function( __FUNCTION__, '3.0' ); |
197 _deprecated_function( __FUNCTION__, '3.0.0' ); |
206 } |
198 } |
207 |
199 |
208 /** |
200 /** |
209 * Adds JavaScript required to make CodePress work on the theme/plugin editors. |
201 * Adds JavaScript required to make CodePress work on the theme/plugin editors. |
210 * |
202 * |
211 * @since 2.8.0 |
203 * @since 2.8.0 |
212 * @deprecated 3.0.0 |
204 * @deprecated 3.0.0 |
213 **/ |
205 **/ |
214 function codepress_footer_js() { |
206 function codepress_footer_js() { |
215 _deprecated_function( __FUNCTION__, '3.0' ); |
207 _deprecated_function( __FUNCTION__, '3.0.0' ); |
216 } |
208 } |
217 |
209 |
218 /** |
210 /** |
219 * Determine whether to use CodePress. |
211 * Determine whether to use CodePress. |
220 * |
212 * |
221 * @since 2.8.0 |
213 * @since 2.8.0 |
222 * @deprecated 3.0.0 |
214 * @deprecated 3.0.0 |
223 **/ |
215 **/ |
224 function use_codepress() { |
216 function use_codepress() { |
225 _deprecated_function( __FUNCTION__, '3.0' ); |
217 _deprecated_function( __FUNCTION__, '3.0.0' ); |
226 } |
218 } |
227 |
219 |
228 /** |
220 /** |
229 * @deprecated 3.1.0 |
221 * Get all user IDs. |
|
222 * |
|
223 * @deprecated 3.1.0 Use get_users() |
|
224 * |
|
225 * @global wpdb $wpdb WordPress database abstraction object. |
230 * |
226 * |
231 * @return array List of user IDs. |
227 * @return array List of user IDs. |
232 */ |
228 */ |
233 function get_author_user_ids() { |
229 function get_author_user_ids() { |
234 _deprecated_function( __FUNCTION__, '3.1', 'get_users()' ); |
230 _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' ); |
235 |
231 |
236 global $wpdb; |
232 global $wpdb; |
237 if ( !is_multisite() ) |
233 if ( !is_multisite() ) |
238 $level_key = $wpdb->get_blog_prefix() . 'user_level'; |
234 $level_key = $wpdb->get_blog_prefix() . 'user_level'; |
239 else |
235 else |
550 else |
568 else |
551 $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.')); |
569 $this->search_errors = new WP_Error('no_matching_users_found', __('No users found.')); |
552 } |
570 } |
553 |
571 |
554 /** |
572 /** |
555 * {@internal Missing Short Description}} |
573 * Prepares variables for use in templates. |
556 * |
|
557 * {@internal Missing Long Description}} |
|
558 * |
574 * |
559 * @since 2.1.0 |
575 * @since 2.1.0 |
560 * @access public |
576 * @access public |
561 */ |
577 */ |
562 function prepare_vars_for_template_usage() {} |
578 function prepare_vars_for_template_usage() {} |
563 |
579 |
564 /** |
580 /** |
565 * {@internal Missing Short Description}} |
581 * Handles paging for the user search query. |
566 * |
|
567 * {@internal Missing Long Description}} |
|
568 * |
582 * |
569 * @since 2.1.0 |
583 * @since 2.1.0 |
570 * @access public |
584 * @access public |
571 */ |
585 */ |
572 function do_paging() { |
586 public function do_paging() { |
573 if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results |
587 if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results |
574 $args = array(); |
588 $args = array(); |
575 if( ! empty($this->search_term) ) |
589 if ( ! empty($this->search_term) ) |
576 $args['usersearch'] = urlencode($this->search_term); |
590 $args['usersearch'] = urlencode($this->search_term); |
577 if( ! empty($this->role) ) |
591 if ( ! empty($this->role) ) |
578 $args['role'] = urlencode($this->role); |
592 $args['role'] = urlencode($this->role); |
579 |
593 |
580 $this->paging_text = paginate_links( array( |
594 $this->paging_text = paginate_links( array( |
581 'total' => ceil($this->total_users_for_query / $this->users_per_page), |
595 'total' => ceil($this->total_users_for_query / $this->users_per_page), |
582 'current' => $this->page, |
596 'current' => $this->page, |
687 } |
704 } |
688 |
705 |
689 /** |
706 /** |
690 * Retrieve drafts from other users. |
707 * Retrieve drafts from other users. |
691 * |
708 * |
692 * @deprecated 3.1.0 |
709 * @deprecated 3.1.0 Use get_posts() |
|
710 * @see get_posts() |
693 * |
711 * |
694 * @param int $user_id User ID. |
712 * @param int $user_id User ID. |
695 * @return array List of drafts from other users. |
713 * @return array List of drafts from other users. |
696 */ |
714 */ |
697 function get_others_drafts($user_id) { |
715 function get_others_drafts($user_id) { |
698 _deprecated_function( __FUNCTION__, '3.1' ); |
716 _deprecated_function( __FUNCTION__, '3.1.0' ); |
699 |
717 |
700 return get_others_unpublished_posts($user_id, 'draft'); |
718 return get_others_unpublished_posts($user_id, 'draft'); |
701 } |
719 } |
702 |
720 |
703 /** |
721 /** |
704 * Retrieve pending review posts from other users. |
722 * Retrieve pending review posts from other users. |
705 * |
723 * |
706 * @deprecated 3.1.0 |
724 * @deprecated 3.1.0 Use get_posts() |
|
725 * @see get_posts() |
707 * |
726 * |
708 * @param int $user_id User ID. |
727 * @param int $user_id User ID. |
709 * @return array List of posts with pending review post type from other users. |
728 * @return array List of posts with pending review post type from other users. |
710 */ |
729 */ |
711 function get_others_pending($user_id) { |
730 function get_others_pending($user_id) { |
712 _deprecated_function( __FUNCTION__, '3.1' ); |
731 _deprecated_function( __FUNCTION__, '3.1.0' ); |
713 |
732 |
714 return get_others_unpublished_posts($user_id, 'pending'); |
733 return get_others_unpublished_posts($user_id, 'pending'); |
715 } |
734 } |
716 |
735 |
717 /** |
736 /** |
718 * Output the QuickPress dashboard widget. |
737 * Output the QuickPress dashboard widget. |
719 * |
738 * |
720 * @since 3.0.0 |
739 * @since 3.0.0 |
721 * @deprecated 3.2.0 |
740 * @deprecated 3.2.0 Use wp_dashboard_quick_press() |
722 * @deprecated Use wp_dashboard_quick_press() |
|
723 * @see wp_dashboard_quick_press() |
741 * @see wp_dashboard_quick_press() |
724 */ |
742 */ |
725 function wp_dashboard_quick_press_output() { |
743 function wp_dashboard_quick_press_output() { |
726 _deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' ); |
744 _deprecated_function( __FUNCTION__, '3.2.0', 'wp_dashboard_quick_press()' ); |
727 wp_dashboard_quick_press(); |
745 wp_dashboard_quick_press(); |
728 } |
746 } |
729 |
747 |
730 /** |
748 /** |
|
749 * Outputs the TinyMCE editor. |
|
750 * |
731 * @since 2.7.0 |
751 * @since 2.7.0 |
732 * @deprecated 3.3.0 |
752 * @deprecated 3.3.0 Use wp_editor() |
733 * @deprecated Use wp_editor() |
|
734 * @see wp_editor() |
753 * @see wp_editor() |
|
754 * |
|
755 * @staticvar int $num |
735 */ |
756 */ |
736 function wp_tiny_mce( $teeny = false, $settings = false ) { |
757 function wp_tiny_mce( $teeny = false, $settings = false ) { |
737 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); |
758 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' ); |
738 |
759 |
739 static $num = 1; |
760 static $num = 1; |
740 |
761 |
741 if ( ! class_exists('_WP_Editors' ) ) |
762 if ( ! class_exists( '_WP_Editors', false ) ) |
742 require_once( ABSPATH . WPINC . '/class-wp-editor.php' ); |
763 require_once( ABSPATH . WPINC . '/class-wp-editor.php' ); |
743 |
764 |
744 $editor_id = 'content' . $num++; |
765 $editor_id = 'content' . $num++; |
745 |
766 |
746 $set = array( |
767 $set = array( |
752 $set = _WP_Editors::parse_settings($editor_id, $set); |
773 $set = _WP_Editors::parse_settings($editor_id, $set); |
753 _WP_Editors::editor_settings($editor_id, $set); |
774 _WP_Editors::editor_settings($editor_id, $set); |
754 } |
775 } |
755 |
776 |
756 /** |
777 /** |
757 * @deprecated 3.3.0 |
778 * Preloads TinyMCE dialogs. |
758 * @deprecated Use wp_editor() |
779 * |
|
780 * @deprecated 3.3.0 Use wp_editor() |
759 * @see wp_editor() |
781 * @see wp_editor() |
760 */ |
782 */ |
761 function wp_preload_dialogs() { |
783 function wp_preload_dialogs() { |
762 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); |
784 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' ); |
763 } |
785 } |
764 |
786 |
765 /** |
787 /** |
766 * @deprecated 3.3.0 |
788 * Prints TinyMCE editor JS. |
767 * @deprecated Use wp_editor() |
789 * |
|
790 * @deprecated 3.3.0 Use wp_editor() |
768 * @see wp_editor() |
791 * @see wp_editor() |
769 */ |
792 */ |
770 function wp_print_editor_js() { |
793 function wp_print_editor_js() { |
771 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); |
794 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' ); |
772 } |
795 } |
773 |
796 |
774 /** |
797 /** |
775 * @deprecated 3.3.0 |
798 * Handles quicktags. |
776 * @deprecated Use wp_editor() |
799 * |
|
800 * @deprecated 3.3.0 Use wp_editor() |
777 * @see wp_editor() |
801 * @see wp_editor() |
778 */ |
802 */ |
779 function wp_quicktags() { |
803 function wp_quicktags() { |
780 _deprecated_function( __FUNCTION__, '3.3', 'wp_editor()' ); |
804 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' ); |
781 } |
805 } |
782 |
806 |
783 /** |
807 /** |
784 * Returns the screen layout options. |
808 * Returns the screen layout options. |
785 * |
809 * |
786 * @since 2.8.0 |
810 * @since 2.8.0 |
787 * @deprecated 3.3.0 |
811 * @deprecated 3.3.0 WP_Screen::render_screen_layout() |
788 * @deprecated Use $current_screen->render_screen_layout() |
|
789 * @see WP_Screen::render_screen_layout() |
812 * @see WP_Screen::render_screen_layout() |
790 */ |
813 */ |
791 function screen_layout( $screen ) { |
814 function screen_layout( $screen ) { |
792 _deprecated_function( __FUNCTION__, '3.3', '$current_screen->render_screen_layout()' ); |
815 _deprecated_function( __FUNCTION__, '3.3.0', '$current_screen->render_screen_layout()' ); |
793 |
816 |
794 $current_screen = get_current_screen(); |
817 $current_screen = get_current_screen(); |
795 |
818 |
796 if ( ! $current_screen ) |
819 if ( ! $current_screen ) |
797 return ''; |
820 return ''; |
837 |
858 |
838 /** |
859 /** |
839 * Favorite actions were deprecated in version 3.2. Use the admin bar instead. |
860 * Favorite actions were deprecated in version 3.2. Use the admin bar instead. |
840 * |
861 * |
841 * @since 2.7.0 |
862 * @since 2.7.0 |
842 * @deprecated 3.2.0 |
863 * @deprecated 3.2.0 Use WP_Admin_Bar |
|
864 * @see WP_Admin_Bar |
843 */ |
865 */ |
844 function favorite_actions() { |
866 function favorite_actions() { |
845 _deprecated_function( __FUNCTION__, '3.2', 'WP_Admin_Bar' ); |
867 _deprecated_function( __FUNCTION__, '3.2.0', 'WP_Admin_Bar' ); |
846 } |
868 } |
847 |
869 |
|
870 /** |
|
871 * Handles uploading an image. |
|
872 * |
|
873 * @deprecated 3.3.0 Use wp_media_upload_handler() |
|
874 * @see wp_media_upload_handler() |
|
875 * |
|
876 * @return null|string |
|
877 */ |
848 function media_upload_image() { |
878 function media_upload_image() { |
849 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' ); |
879 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' ); |
850 return wp_media_upload_handler(); |
880 return wp_media_upload_handler(); |
851 } |
881 } |
852 |
882 |
|
883 /** |
|
884 * Handles uploading an audio file. |
|
885 * |
|
886 * @deprecated 3.3.0 Use wp_media_upload_handler() |
|
887 * @see wp_media_upload_handler() |
|
888 * |
|
889 * @return null|string |
|
890 */ |
853 function media_upload_audio() { |
891 function media_upload_audio() { |
854 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' ); |
892 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' ); |
855 return wp_media_upload_handler(); |
893 return wp_media_upload_handler(); |
856 } |
894 } |
857 |
895 |
|
896 /** |
|
897 * Handles uploading a video file. |
|
898 * |
|
899 * @deprecated 3.3.0 Use wp_media_upload_handler() |
|
900 * @see wp_media_upload_handler() |
|
901 * |
|
902 * @return null|string |
|
903 */ |
858 function media_upload_video() { |
904 function media_upload_video() { |
859 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' ); |
905 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' ); |
860 return wp_media_upload_handler(); |
906 return wp_media_upload_handler(); |
861 } |
907 } |
862 |
908 |
|
909 /** |
|
910 * Handles uploading a generic file. |
|
911 * |
|
912 * @deprecated 3.3.0 Use wp_media_upload_handler() |
|
913 * @see wp_media_upload_handler() |
|
914 * |
|
915 * @return null|string |
|
916 */ |
863 function media_upload_file() { |
917 function media_upload_file() { |
864 _deprecated_function( __FUNCTION__, '3.3', 'wp_media_upload_handler()' ); |
918 _deprecated_function( __FUNCTION__, '3.3.0', 'wp_media_upload_handler()' ); |
865 return wp_media_upload_handler(); |
919 return wp_media_upload_handler(); |
866 } |
920 } |
867 |
921 |
|
922 /** |
|
923 * Handles retrieving the insert-from-URL form for an image. |
|
924 * |
|
925 * @deprecated 3.3.0 Use wp_media_insert_url_form() |
|
926 * @see wp_media_insert_url_form() |
|
927 * |
|
928 * @return string |
|
929 */ |
868 function type_url_form_image() { |
930 function type_url_form_image() { |
869 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('image')" ); |
931 _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('image')" ); |
870 return wp_media_insert_url_form( 'image' ); |
932 return wp_media_insert_url_form( 'image' ); |
871 } |
933 } |
872 |
934 |
|
935 /** |
|
936 * Handles retrieving the insert-from-URL form for an audio file. |
|
937 * |
|
938 * @deprecated 3.3.0 Use wp_media_insert_url_form() |
|
939 * @see wp_media_insert_url_form() |
|
940 * |
|
941 * @return string |
|
942 */ |
873 function type_url_form_audio() { |
943 function type_url_form_audio() { |
874 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('audio')" ); |
944 _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('audio')" ); |
875 return wp_media_insert_url_form( 'audio' ); |
945 return wp_media_insert_url_form( 'audio' ); |
876 } |
946 } |
877 |
947 |
|
948 /** |
|
949 * Handles retrieving the insert-from-URL form for a video file. |
|
950 * |
|
951 * @deprecated 3.3.0 Use wp_media_insert_url_form() |
|
952 * @see wp_media_insert_url_form() |
|
953 * |
|
954 * @return string |
|
955 */ |
878 function type_url_form_video() { |
956 function type_url_form_video() { |
879 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('video')" ); |
957 _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('video')" ); |
880 return wp_media_insert_url_form( 'video' ); |
958 return wp_media_insert_url_form( 'video' ); |
881 } |
959 } |
882 |
960 |
|
961 /** |
|
962 * Handles retrieving the insert-from-URL form for a generic file. |
|
963 * |
|
964 * @deprecated 3.3.0 Use wp_media_insert_url_form() |
|
965 * @see wp_media_insert_url_form() |
|
966 * |
|
967 * @return string |
|
968 */ |
883 function type_url_form_file() { |
969 function type_url_form_file() { |
884 _deprecated_function( __FUNCTION__, '3.3', "wp_media_insert_url_form('file')" ); |
970 _deprecated_function( __FUNCTION__, '3.3.0', "wp_media_insert_url_form('file')" ); |
885 return wp_media_insert_url_form( 'file' ); |
971 return wp_media_insert_url_form( 'file' ); |
886 } |
972 } |
887 |
973 |
888 /** |
974 /** |
889 * Add contextual help text for a page. |
975 * Add contextual help text for a page. |
890 * |
976 * |
891 * Creates an 'Overview' help tab. |
977 * Creates an 'Overview' help tab. |
892 * |
978 * |
893 * @since 2.7.0 |
979 * @since 2.7.0 |
894 * @deprecated 3.3.0 |
980 * @deprecated 3.3.0 Use WP_Screen::add_help_tab() |
895 * @deprecated Use get_current_screen()->add_help_tab() |
981 * @see WP_Screen::add_help_tab() |
896 * @see WP_Screen |
|
897 * |
982 * |
898 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. |
983 * @param string $screen The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions. |
899 * @param string $help The content of an 'Overview' help tab. |
984 * @param string $help The content of an 'Overview' help tab. |
900 */ |
985 */ |
901 function add_contextual_help( $screen, $help ) { |
986 function add_contextual_help( $screen, $help ) { |
902 _deprecated_function( __FUNCTION__, '3.3', 'get_current_screen()->add_help_tab()' ); |
987 _deprecated_function( __FUNCTION__, '3.3.0', 'get_current_screen()->add_help_tab()' ); |
903 |
988 |
904 if ( is_string( $screen ) ) |
989 if ( is_string( $screen ) ) |
905 $screen = convert_to_screen( $screen ); |
990 $screen = convert_to_screen( $screen ); |
906 |
991 |
907 WP_Screen::add_old_compat_help( $screen, $help ); |
992 WP_Screen::add_old_compat_help( $screen, $help ); |
908 } |
993 } |
909 |
994 |
910 /** |
995 /** |
911 * Get the allowed themes for the current blog. |
996 * Get the allowed themes for the current site. |
912 * |
997 * |
913 * @since 3.0.0 |
998 * @since 3.0.0 |
914 * @deprecated 3.4.0 |
999 * @deprecated 3.4.0 Use wp_get_themes() |
915 * @deprecated Use wp_get_themes() |
|
916 * @see wp_get_themes() |
1000 * @see wp_get_themes() |
917 * |
1001 * |
918 * @return array $themes Array of allowed themes. |
1002 * @return array $themes Array of allowed themes. |
919 */ |
1003 */ |
920 function get_allowed_themes() { |
1004 function get_allowed_themes() { |
921 _deprecated_function( __FUNCTION__, '3.4', "wp_get_themes( array( 'allowed' => true ) )" ); |
1005 _deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" ); |
922 |
1006 |
923 $themes = wp_get_themes( array( 'allowed' => true ) ); |
1007 $themes = wp_get_themes( array( 'allowed' => true ) ); |
924 |
1008 |
925 $wp_themes = array(); |
1009 $wp_themes = array(); |
926 foreach ( $themes as $theme ) { |
1010 foreach ( $themes as $theme ) { |
953 } |
1038 } |
954 return $broken; |
1039 return $broken; |
955 } |
1040 } |
956 |
1041 |
957 /** |
1042 /** |
958 * {@internal Missing Short Description}} |
1043 * Retrieves information on the current active theme. |
959 * |
1044 * |
960 * @since 2.0.0 |
1045 * @since 2.0.0 |
961 * @deprecated 3.4.0 |
1046 * @deprecated 3.4.0 Use wp_get_theme() |
|
1047 * @see wp_get_theme() |
962 * |
1048 * |
963 * @return WP_Theme |
1049 * @return WP_Theme |
964 */ |
1050 */ |
965 function current_theme_info() { |
1051 function current_theme_info() { |
966 _deprecated_function( __FUNCTION__, '3.4', 'wp_get_theme()' ); |
1052 _deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' ); |
967 |
1053 |
968 return wp_get_theme(); |
1054 return wp_get_theme(); |
969 } |
1055 } |
970 |
1056 |
971 /** |
1057 /** |
972 * This was once used to display an 'Insert into Post' button. Now it is deprecated and stubbed. |
1058 * This was once used to display an 'Insert into Post' button. |
|
1059 * |
|
1060 * Now it is deprecated and stubbed. |
973 * |
1061 * |
974 * @deprecated 3.5.0 |
1062 * @deprecated 3.5.0 |
975 */ |
1063 */ |
976 function _insert_into_post_button( $type ) { |
1064 function _insert_into_post_button( $type ) { |
977 _deprecated_function( __FUNCTION__, '3.5' ); |
1065 _deprecated_function( __FUNCTION__, '3.5.0' ); |
978 } |
1066 } |
979 |
1067 |
980 /** |
1068 /** |
981 * This was once used to display a media button. Now it is deprecated and stubbed. |
1069 * This was once used to display a media button. |
|
1070 * |
|
1071 * Now it is deprecated and stubbed. |
982 * |
1072 * |
983 * @deprecated 3.5.0 |
1073 * @deprecated 3.5.0 |
984 */ |
1074 */ |
985 function _media_button($title, $icon, $type, $id) { |
1075 function _media_button($title, $icon, $type, $id) { |
986 _deprecated_function( __FUNCTION__, '3.5' ); |
1076 _deprecated_function( __FUNCTION__, '3.5.0' ); |
987 } |
1077 } |
988 |
1078 |
989 /** |
1079 /** |
990 * Get an existing post and format it for editing. |
1080 * Gets an existing post and format it for editing. |
991 * |
1081 * |
992 * @since 2.0.0 |
1082 * @since 2.0.0 |
993 * @deprecated 3.5.0 |
1083 * @deprecated 3.5.0 Use get_post() |
|
1084 * @see get_post() |
994 * |
1085 * |
995 * @param int $id |
1086 * @param int $id |
996 * @return object |
1087 * @return object |
997 */ |
1088 */ |
998 function get_post_to_edit( $id ) { |
1089 function get_post_to_edit( $id ) { |
999 _deprecated_function( __FUNCTION__, '3.5', 'get_post()' ); |
1090 _deprecated_function( __FUNCTION__, '3.5.0', 'get_post()' ); |
1000 |
1091 |
1001 return get_post( $id, OBJECT, 'edit' ); |
1092 return get_post( $id, OBJECT, 'edit' ); |
1002 } |
1093 } |
1003 |
1094 |
1004 /** |
1095 /** |
1005 * Get the default page information to use. |
1096 * Gets the default page information to use. |
1006 * |
1097 * |
1007 * @since 2.5.0 |
1098 * @since 2.5.0 |
1008 * @deprecated 3.5.0 |
1099 * @deprecated 3.5.0 Use get_default_post_to_edit() |
1009 * @deprecated Use get_default_post_to_edit() |
1100 * @see get_default_post_to_edit() |
1010 * |
1101 * |
1011 * @return WP_Post Post object containing all the default post data as attributes |
1102 * @return WP_Post Post object containing all the default post data as attributes |
1012 */ |
1103 */ |
1013 function get_default_page_to_edit() { |
1104 function get_default_page_to_edit() { |
1014 _deprecated_function( __FUNCTION__, '3.5', "get_default_post_to_edit( 'page' )" ); |
1105 _deprecated_function( __FUNCTION__, '3.5.0', "get_default_post_to_edit( 'page' )" ); |
1015 |
1106 |
1016 $page = get_default_post_to_edit(); |
1107 $page = get_default_post_to_edit(); |
1017 $page->post_type = 'page'; |
1108 $page->post_type = 'page'; |
1018 return $page; |
1109 return $page; |
1019 } |
1110 } |
1020 |
1111 |
1021 /** |
1112 /** |
1022 * This was once used to create a thumbnail from an Image given a maximum side size. |
1113 * This was once used to create a thumbnail from an Image given a maximum side size. |
1023 * |
1114 * |
1024 * @since 1.2.0 |
1115 * @since 1.2.0 |
1025 * @deprecated 3.5.0 |
1116 * @deprecated 3.5.0 Use image_resize() |
1026 * @deprecated Use image_resize() |
|
1027 * @see image_resize() |
1117 * @see image_resize() |
1028 * |
1118 * |
1029 * @param mixed $file Filename of the original image, Or attachment id. |
1119 * @param mixed $file Filename of the original image, Or attachment id. |
1030 * @param int $max_side Maximum length of a single side for the thumbnail. |
1120 * @param int $max_side Maximum length of a single side for the thumbnail. |
1031 * @param mixed $deprecated Never used. |
1121 * @param mixed $deprecated Never used. |
1032 * @return string Thumbnail path on success, Error string on failure. |
1122 * @return string Thumbnail path on success, Error string on failure. |
1033 */ |
1123 */ |
1034 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { |
1124 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { |
1035 _deprecated_function( __FUNCTION__, '3.5', 'image_resize()' ); |
1125 _deprecated_function( __FUNCTION__, '3.5.0', 'image_resize()' ); |
1036 return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) ); |
1126 return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) ); |
1037 } |
1127 } |
1038 |
1128 |
1039 /** |
1129 /** |
1040 * This was once used to display a metabox for the nav menu theme locations. |
1130 * This was once used to display a meta box for the nav menu theme locations. |
1041 * |
1131 * |
1042 * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen. |
1132 * Deprecated in favor of a 'Manage Locations' tab added to nav menus management screen. |
1043 * |
1133 * |
1044 * @since 3.0.0 |
1134 * @since 3.0.0 |
1045 * @deprecated 3.6.0 |
1135 * @deprecated 3.6.0 |
1046 */ |
1136 */ |
1047 function wp_nav_menu_locations_meta_box() { |
1137 function wp_nav_menu_locations_meta_box() { |
1048 _deprecated_function( __FUNCTION__, '3.6' ); |
1138 _deprecated_function( __FUNCTION__, '3.6.0' ); |
1049 } |
1139 } |
1050 |
1140 |
1051 /** |
1141 /** |
1052 * This was once used to kick-off the Core Updater. |
1142 * This was once used to kick-off the Core Updater. |
1053 * |
1143 * |
1054 * Deprecated in favor of instantating a Core_Upgrader instance directly, |
1144 * Deprecated in favor of instantating a Core_Upgrader instance directly, |
1055 * and calling the 'upgrade' method. |
1145 * and calling the 'upgrade' method. |
1056 * |
1146 * |
1057 * @since 2.7.0 |
1147 * @since 2.7.0 |
1058 * @deprecated 3.7.0 |
1148 * @deprecated 3.7.0 Use Core_Upgrader |
1059 * @see Core_Upgrader |
1149 * @see Core_Upgrader |
1060 */ |
1150 */ |
1061 function wp_update_core($current, $feedback = '') { |
1151 function wp_update_core($current, $feedback = '') { |
1062 _deprecated_function( __FUNCTION__, '3.7', 'new Core_Upgrader();' ); |
1152 _deprecated_function( __FUNCTION__, '3.7.0', 'new Core_Upgrader();' ); |
1063 |
1153 |
1064 if ( !empty($feedback) ) |
1154 if ( !empty($feedback) ) |
1065 add_filter('update_feedback', $feedback); |
1155 add_filter('update_feedback', $feedback); |
1066 |
1156 |
1067 include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); |
1157 include( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); |
1115 } |
1205 } |
1116 |
1206 |
1117 /** |
1207 /** |
1118 * This was once used to display attachment links. Now it is deprecated and stubbed. |
1208 * This was once used to display attachment links. Now it is deprecated and stubbed. |
1119 * |
1209 * |
1120 * {@internal Missing Short Description}} |
|
1121 * |
|
1122 * @since 2.0.0 |
1210 * @since 2.0.0 |
1123 * @deprecated 3.7.0 |
1211 * @deprecated 3.7.0 |
1124 * |
1212 * |
1125 * @param int|bool $id |
1213 * @param int|bool $id |
1126 */ |
1214 */ |
1127 function the_attachment_links( $id = false ) { |
1215 function the_attachment_links( $id = false ) { |
1128 _deprecated_function( __FUNCTION__, '3.7' ); |
1216 _deprecated_function( __FUNCTION__, '3.7.0' ); |
1129 } |
1217 } |
1130 |
1218 |
1131 /**#@+ |
1219 /** |
1132 * Displays a screen icon. |
1220 * Displays a screen icon. |
1133 * |
1221 * |
1134 * @since 2.7.0 |
1222 * @since 2.7.0 |
1135 * @since 3.8.0 Screen icons are no longer used in WordPress. This function no longer produces output. |
|
1136 * @deprecated 3.8.0 |
1223 * @deprecated 3.8.0 |
1137 */ |
1224 */ |
1138 function screen_icon() { |
1225 function screen_icon() { |
|
1226 _deprecated_function( __FUNCTION__, '3.8.0' ); |
1139 echo get_screen_icon(); |
1227 echo get_screen_icon(); |
1140 } |
1228 } |
|
1229 |
|
1230 /** |
|
1231 * Retrieves the screen icon (no longer used in 3.8+). |
|
1232 * |
|
1233 * @since 3.2.0 |
|
1234 * @deprecated 3.8.0 |
|
1235 * |
|
1236 * @return string An HTML comment explaining that icons are no longer used. |
|
1237 */ |
1141 function get_screen_icon() { |
1238 function get_screen_icon() { |
|
1239 _deprecated_function( __FUNCTION__, '3.8.0' ); |
1142 return '<!-- Screen icons are no longer used as of WordPress 3.8. -->'; |
1240 return '<!-- Screen icons are no longer used as of WordPress 3.8. -->'; |
1143 } |
1241 } |
1144 /**#@-*/ |
1242 |
1145 |
1243 /** |
1146 /**#@+ |
|
1147 * Deprecated dashboard widget controls. |
1244 * Deprecated dashboard widget controls. |
1148 * |
1245 * |
1149 * @since 2.5.0 |
1246 * @since 2.5.0 |
1150 * @deprecated 3.8.0 |
1247 * @deprecated 3.8.0 |
1151 */ |
1248 */ |
1152 function wp_dashboard_incoming_links_output() {} |
1249 function wp_dashboard_incoming_links_output() {} |
|
1250 |
|
1251 /** |
|
1252 * Deprecated dashboard secondary output. |
|
1253 * |
|
1254 * @deprecated 3.8.0 |
|
1255 */ |
1153 function wp_dashboard_secondary_output() {} |
1256 function wp_dashboard_secondary_output() {} |
1154 /**#@-*/ |
1257 |
1155 |
1258 /** |
1156 /**#@+ |
|
1157 * Deprecated dashboard widget controls. |
1259 * Deprecated dashboard widget controls. |
1158 * |
1260 * |
1159 * @since 2.7.0 |
1261 * @since 2.7.0 |
1160 * @deprecated 3.8.0 |
1262 * @deprecated 3.8.0 |
1161 */ |
1263 */ |
1162 function wp_dashboard_incoming_links() {} |
1264 function wp_dashboard_incoming_links() {} |
|
1265 |
|
1266 /** |
|
1267 * Deprecated dashboard incoming links control. |
|
1268 * |
|
1269 * @deprecated 3.8.0 |
|
1270 */ |
1163 function wp_dashboard_incoming_links_control() {} |
1271 function wp_dashboard_incoming_links_control() {} |
|
1272 |
|
1273 /** |
|
1274 * Deprecated dashboard plugins control. |
|
1275 * |
|
1276 * @deprecated 3.8.0 |
|
1277 */ |
1164 function wp_dashboard_plugins() {} |
1278 function wp_dashboard_plugins() {} |
|
1279 |
|
1280 /** |
|
1281 * Deprecated dashboard primary control. |
|
1282 * |
|
1283 * @deprecated 3.8.0 |
|
1284 */ |
1165 function wp_dashboard_primary_control() {} |
1285 function wp_dashboard_primary_control() {} |
|
1286 |
|
1287 /** |
|
1288 * Deprecated dashboard recent comments control. |
|
1289 * |
|
1290 * @deprecated 3.8.0 |
|
1291 */ |
1166 function wp_dashboard_recent_comments_control() {} |
1292 function wp_dashboard_recent_comments_control() {} |
|
1293 |
|
1294 /** |
|
1295 * Deprecated dashboard secondary section. |
|
1296 * |
|
1297 * @deprecated 3.8.0 |
|
1298 */ |
1167 function wp_dashboard_secondary() {} |
1299 function wp_dashboard_secondary() {} |
|
1300 |
|
1301 /** |
|
1302 * Deprecated dashboard secondary control. |
|
1303 * |
|
1304 * @deprecated 3.8.0 |
|
1305 */ |
1168 function wp_dashboard_secondary_control() {} |
1306 function wp_dashboard_secondary_control() {} |
1169 /**#@-*/ |
1307 |
|
1308 /** |
|
1309 * Display plugins text for the WordPress news widget. |
|
1310 * |
|
1311 * @since 2.5.0 |
|
1312 * @deprecated 4.8.0 |
|
1313 * |
|
1314 * @param string $rss The RSS feed URL. |
|
1315 * @param array $args Array of arguments for this RSS feed. |
|
1316 */ |
|
1317 function wp_dashboard_plugins_output( $rss, $args = array() ) { |
|
1318 _deprecated_function( __FUNCTION__, '4.8.0' ); |
|
1319 |
|
1320 // Plugin feeds plus link to install them |
|
1321 $popular = fetch_feed( $args['url']['popular'] ); |
|
1322 |
|
1323 if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) { |
|
1324 $plugin_slugs = array_keys( get_plugins() ); |
|
1325 set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS ); |
|
1326 } |
|
1327 |
|
1328 echo '<ul>'; |
|
1329 |
|
1330 foreach ( array( $popular ) as $feed ) { |
|
1331 if ( is_wp_error( $feed ) || ! $feed->get_item_quantity() ) |
|
1332 continue; |
|
1333 |
|
1334 $items = $feed->get_items(0, 5); |
|
1335 |
|
1336 // Pick a random, non-installed plugin |
|
1337 while ( true ) { |
|
1338 // Abort this foreach loop iteration if there's no plugins left of this type |
|
1339 if ( 0 == count($items) ) |
|
1340 continue 2; |
|
1341 |
|
1342 $item_key = array_rand($items); |
|
1343 $item = $items[$item_key]; |
|
1344 |
|
1345 list($link, $frag) = explode( '#', $item->get_link() ); |
|
1346 |
|
1347 $link = esc_url($link); |
|
1348 if ( preg_match( '|/([^/]+?)/?$|', $link, $matches ) ) |
|
1349 $slug = $matches[1]; |
|
1350 else { |
|
1351 unset( $items[$item_key] ); |
|
1352 continue; |
|
1353 } |
|
1354 |
|
1355 // Is this random plugin's slug already installed? If so, try again. |
|
1356 reset( $plugin_slugs ); |
|
1357 foreach ( $plugin_slugs as $plugin_slug ) { |
|
1358 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { |
|
1359 unset( $items[$item_key] ); |
|
1360 continue 2; |
|
1361 } |
|
1362 } |
|
1363 |
|
1364 // If we get to this point, then the random plugin isn't installed and we can stop the while(). |
|
1365 break; |
|
1366 } |
|
1367 |
|
1368 // Eliminate some common badly formed plugin descriptions |
|
1369 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) ) |
|
1370 unset($items[$item_key]); |
|
1371 |
|
1372 if ( !isset($items[$item_key]) ) |
|
1373 continue; |
|
1374 |
|
1375 $raw_title = $item->get_title(); |
|
1376 |
|
1377 $ilink = wp_nonce_url('plugin-install.php?tab=plugin-information&plugin=' . $slug, 'install-plugin_' . $slug) . '&TB_iframe=true&width=600&height=800'; |
|
1378 echo '<li class="dashboard-news-plugin"><span>' . __( 'Popular Plugin' ) . ':</span> ' . esc_html( $raw_title ) . |
|
1379 ' <a href="' . $ilink . '" class="thickbox open-plugin-details-modal" aria-label="' . |
|
1380 /* translators: %s: plugin name */ |
|
1381 esc_attr( sprintf( __( 'Install %s' ), $raw_title ) ) . '">(' . __( 'Install' ) . ')</a></li>'; |
|
1382 |
|
1383 $feed->__destruct(); |
|
1384 unset( $feed ); |
|
1385 } |
|
1386 |
|
1387 echo '</ul>'; |
|
1388 } |
1170 |
1389 |
1171 /** |
1390 /** |
1172 * This was once used to move child posts to a new parent. |
1391 * This was once used to move child posts to a new parent. |
1173 * |
1392 * |
1174 * @since 2.3.0 |
1393 * @since 2.3.0 |
1177 * |
1396 * |
1178 * @param int $old_ID |
1397 * @param int $old_ID |
1179 * @param int $new_ID |
1398 * @param int $new_ID |
1180 */ |
1399 */ |
1181 function _relocate_children( $old_ID, $new_ID ) { |
1400 function _relocate_children( $old_ID, $new_ID ) { |
1182 _deprecated_function( __FUNCTION__, '3.9' ); |
1401 _deprecated_function( __FUNCTION__, '3.9.0' ); |
1183 } |
1402 } |
|
1403 |
|
1404 /** |
|
1405 * Add a top-level menu page in the 'objects' section. |
|
1406 * |
|
1407 * This function takes a capability which will be used to determine whether |
|
1408 * or not a page is included in the menu. |
|
1409 * |
|
1410 * The function which is hooked in to handle the output of the page must check |
|
1411 * that the user has the required capability as well. |
|
1412 * |
|
1413 * @since 2.7.0 |
|
1414 * |
|
1415 * @deprecated 4.5.0 Use add_menu_page() |
|
1416 * @see add_menu_page() |
|
1417 * @global int $_wp_last_object_menu |
|
1418 * |
|
1419 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. |
|
1420 * @param string $menu_title The text to be used for the menu. |
|
1421 * @param string $capability The capability required for this menu to be displayed to the user. |
|
1422 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). |
|
1423 * @param callable $function The function to be called to output the content for this page. |
|
1424 * @param string $icon_url The url to the icon to be used for this menu. |
|
1425 * @return string The resulting page's hook_suffix. |
|
1426 */ |
|
1427 function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') { |
|
1428 _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' ); |
|
1429 |
|
1430 global $_wp_last_object_menu; |
|
1431 |
|
1432 $_wp_last_object_menu++; |
|
1433 |
|
1434 return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_object_menu); |
|
1435 } |
|
1436 |
|
1437 /** |
|
1438 * Add a top-level menu page in the 'utility' section. |
|
1439 * |
|
1440 * This function takes a capability which will be used to determine whether |
|
1441 * or not a page is included in the menu. |
|
1442 * |
|
1443 * The function which is hooked in to handle the output of the page must check |
|
1444 * that the user has the required capability as well. |
|
1445 * |
|
1446 * @since 2.7.0 |
|
1447 * |
|
1448 * @deprecated 4.5.0 Use add_menu_page() |
|
1449 * @see add_menu_page() |
|
1450 * @global int $_wp_last_utility_menu |
|
1451 * |
|
1452 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. |
|
1453 * @param string $menu_title The text to be used for the menu. |
|
1454 * @param string $capability The capability required for this menu to be displayed to the user. |
|
1455 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). |
|
1456 * @param callable $function The function to be called to output the content for this page. |
|
1457 * @param string $icon_url The url to the icon to be used for this menu. |
|
1458 * @return string The resulting page's hook_suffix. |
|
1459 */ |
|
1460 function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') { |
|
1461 _deprecated_function( __FUNCTION__, '4.5.0', 'add_menu_page()' ); |
|
1462 |
|
1463 global $_wp_last_utility_menu; |
|
1464 |
|
1465 $_wp_last_utility_menu++; |
|
1466 |
|
1467 return add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $_wp_last_utility_menu); |
|
1468 } |
|
1469 |
|
1470 /** |
|
1471 * Disables autocomplete on the 'post' form (Add/Edit Post screens) for WebKit browsers, |
|
1472 * as they disregard the autocomplete setting on the editor textarea. That can break the editor |
|
1473 * when the user navigates to it with the browser's Back button. See #28037 |
|
1474 * |
|
1475 * Replaced with wp_page_reload_on_back_button_js() that also fixes this problem. |
|
1476 * |
|
1477 * @since 4.0.0 |
|
1478 * @deprecated 4.6.0 |
|
1479 * |
|
1480 * @link https://core.trac.wordpress.org/ticket/35852 |
|
1481 * |
|
1482 * @global bool $is_safari |
|
1483 * @global bool $is_chrome |
|
1484 */ |
|
1485 function post_form_autocomplete_off() { |
|
1486 global $is_safari, $is_chrome; |
|
1487 |
|
1488 _deprecated_function( __FUNCTION__, '4.6.0' ); |
|
1489 |
|
1490 if ( $is_safari || $is_chrome ) { |
|
1491 echo ' autocomplete="off"'; |
|
1492 } |
|
1493 } |
|
1494 |
|
1495 /** |
|
1496 * Display JavaScript on the page. |
|
1497 * |
|
1498 * @since 3.5.0 |
|
1499 * @deprecated 4.9.0 |
|
1500 */ |
|
1501 function options_permalink_add_js() { |
|
1502 ?> |
|
1503 <script type="text/javascript"> |
|
1504 jQuery(document).ready(function() { |
|
1505 jQuery('.permalink-structure input:radio').change(function() { |
|
1506 if ( 'custom' == this.value ) |
|
1507 return; |
|
1508 jQuery('#permalink_structure').val( this.value ); |
|
1509 }); |
|
1510 jQuery( '#permalink_structure' ).on( 'click input', function() { |
|
1511 jQuery( '#custom_selection' ).prop( 'checked', true ); |
|
1512 }); |
|
1513 }); |
|
1514 </script> |
|
1515 <?php |
|
1516 } |