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