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