equal
deleted
inserted
replaced
195 * |
195 * |
196 * @since 2.8.0 |
196 * @since 2.8.0 |
197 * @deprecated 3.0.0 |
197 * @deprecated 3.0.0 |
198 * |
198 * |
199 * @param string $filename |
199 * @param string $filename |
200 **/ |
200 */ |
201 function codepress_get_lang( $filename ) { |
201 function codepress_get_lang( $filename ) { |
202 _deprecated_function( __FUNCTION__, '3.0.0' ); |
202 _deprecated_function( __FUNCTION__, '3.0.0' ); |
203 } |
203 } |
204 |
204 |
205 /** |
205 /** |
206 * Adds JavaScript required to make CodePress work on the theme/plugin file editors. |
206 * Adds JavaScript required to make CodePress work on the theme/plugin file editors. |
207 * |
207 * |
208 * @since 2.8.0 |
208 * @since 2.8.0 |
209 * @deprecated 3.0.0 |
209 * @deprecated 3.0.0 |
210 **/ |
210 */ |
211 function codepress_footer_js() { |
211 function codepress_footer_js() { |
212 _deprecated_function( __FUNCTION__, '3.0.0' ); |
212 _deprecated_function( __FUNCTION__, '3.0.0' ); |
213 } |
213 } |
214 |
214 |
215 /** |
215 /** |
216 * Determine whether to use CodePress. |
216 * Determine whether to use CodePress. |
217 * |
217 * |
218 * @since 2.8.0 |
218 * @since 2.8.0 |
219 * @deprecated 3.0.0 |
219 * @deprecated 3.0.0 |
220 **/ |
220 */ |
221 function use_codepress() { |
221 function use_codepress() { |
222 _deprecated_function( __FUNCTION__, '3.0.0' ); |
222 _deprecated_function( __FUNCTION__, '3.0.0' ); |
223 } |
223 } |
224 |
224 |
225 /** |
225 /** |
491 * @param int $page Optional. Page ID. |
491 * @param int $page Optional. Page ID. |
492 * @param string $role Role name. |
492 * @param string $role Role name. |
493 * @return WP_User_Search |
493 * @return WP_User_Search |
494 */ |
494 */ |
495 function __construct( $search_term = '', $page = '', $role = '' ) { |
495 function __construct( $search_term = '', $page = '', $role = '' ) { |
496 _deprecated_function( __FUNCTION__, '3.1.0', 'WP_User_Query' ); |
496 _deprecated_class( 'WP_User_Search', '3.1.0', 'WP_User_Query' ); |
497 |
497 |
498 $this->search_term = wp_unslash( $search_term ); |
498 $this->search_term = wp_unslash( $search_term ); |
499 $this->raw_page = ( '' == $page ) ? false : (int) $page; |
499 $this->raw_page = ( '' == $page ) ? false : (int) $page; |
500 $this->page = ( '' == $page ) ? 1 : (int) $page; |
500 $this->page = ( '' == $page ) ? 1 : (int) $page; |
501 $this->role = $role; |
501 $this->role = $role; |
514 * @param int $page Optional. Page ID. |
514 * @param int $page Optional. Page ID. |
515 * @param string $role Role name. |
515 * @param string $role Role name. |
516 * @return WP_User_Search |
516 * @return WP_User_Search |
517 */ |
517 */ |
518 public function WP_User_Search( $search_term = '', $page = '', $role = '' ) { |
518 public function WP_User_Search( $search_term = '', $page = '', $role = '' ) { |
|
519 _deprecated_constructor( 'WP_User_Search', '3.1.0', get_class( $this ) ); |
519 self::__construct( $search_term, $page, $role ); |
520 self::__construct( $search_term, $page, $role ); |
520 } |
521 } |
521 |
522 |
522 /** |
523 /** |
523 * Prepares the user search query (legacy). |
524 * Prepares the user search query (legacy). |
524 * |
525 * |
525 * @since 2.1.0 |
526 * @since 2.1.0 |
526 * @access public |
527 * @access public |
|
528 * |
|
529 * @global wpdb $wpdb WordPress database abstraction object. |
527 */ |
530 */ |
528 public function prepare_query() { |
531 public function prepare_query() { |
529 global $wpdb; |
532 global $wpdb; |
530 $this->first_user = ($this->page - 1) * $this->users_per_page; |
533 $this->first_user = ($this->page - 1) * $this->users_per_page; |
531 |
534 |
560 /** |
563 /** |
561 * Executes the user search query. |
564 * Executes the user search query. |
562 * |
565 * |
563 * @since 2.1.0 |
566 * @since 2.1.0 |
564 * @access public |
567 * @access public |
|
568 * |
|
569 * @global wpdb $wpdb WordPress database abstraction object. |
565 */ |
570 */ |
566 public function query() { |
571 public function query() { |
567 global $wpdb; |
572 global $wpdb; |
568 |
573 |
569 $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit); |
574 $this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit); |
1145 } |
1150 } |
1146 |
1151 |
1147 /** |
1152 /** |
1148 * This was once used to kick-off the Core Updater. |
1153 * This was once used to kick-off the Core Updater. |
1149 * |
1154 * |
1150 * Deprecated in favor of instantating a Core_Upgrader instance directly, |
1155 * Deprecated in favor of instantiating a Core_Upgrader instance directly, |
1151 * and calling the 'upgrade' method. |
1156 * and calling the 'upgrade' method. |
1152 * |
1157 * |
1153 * @since 2.7.0 |
1158 * @since 2.7.0 |
1154 * @deprecated 3.7.0 Use Core_Upgrader |
1159 * @deprecated 3.7.0 Use Core_Upgrader |
1155 * @see Core_Upgrader |
1160 * @see Core_Upgrader |
1167 } |
1172 } |
1168 |
1173 |
1169 /** |
1174 /** |
1170 * This was once used to kick-off the Plugin Updater. |
1175 * This was once used to kick-off the Plugin Updater. |
1171 * |
1176 * |
1172 * Deprecated in favor of instantating a Plugin_Upgrader instance directly, |
1177 * Deprecated in favor of instantiating a Plugin_Upgrader instance directly, |
1173 * and calling the 'upgrade' method. |
1178 * and calling the 'upgrade' method. |
1174 * Unused since 2.8.0. |
1179 * Unused since 2.8.0. |
1175 * |
1180 * |
1176 * @since 2.5.0 |
1181 * @since 2.5.0 |
1177 * @deprecated 3.7.0 Use Plugin_Upgrader |
1182 * @deprecated 3.7.0 Use Plugin_Upgrader |
1359 } |
1364 } |
1360 |
1365 |
1361 // Is this random plugin's slug already installed? If so, try again. |
1366 // Is this random plugin's slug already installed? If so, try again. |
1362 reset( $plugin_slugs ); |
1367 reset( $plugin_slugs ); |
1363 foreach ( $plugin_slugs as $plugin_slug ) { |
1368 foreach ( $plugin_slugs as $plugin_slug ) { |
1364 if ( $slug == substr( $plugin_slug, 0, strlen( $slug ) ) ) { |
1369 if ( str_starts_with( $plugin_slug, $slug ) ) { |
1365 unset( $items[$item_key] ); |
1370 unset( $items[$item_key] ); |
1366 continue 2; |
1371 continue 2; |
1367 } |
1372 } |
1368 } |
1373 } |
1369 |
1374 |
1370 // If we get to this point, then the random plugin isn't installed and we can stop the while(). |
1375 // If we get to this point, then the random plugin isn't installed and we can stop the while(). |
1371 break; |
1376 break; |
1372 } |
1377 } |
1373 |
1378 |
1374 // Eliminate some common badly formed plugin descriptions. |
1379 // Eliminate some common badly formed plugin descriptions. |
1375 while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) ) |
1380 while ( ( null !== $item_key = array_rand($items) ) && str_contains( $items[$item_key]->get_description(), 'Plugin Name:' ) ) |
1376 unset($items[$item_key]); |
1381 unset($items[$item_key]); |
1377 |
1382 |
1378 if ( !isset($items[$item_key]) ) |
1383 if ( !isset($items[$item_key]) ) |
1379 continue; |
1384 continue; |
1380 |
1385 |