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