-
+ BFCC62DCF123697333D4706045F926642E46868A8B2B49349C19E3EEF4C461DC54EB304ED70A300C728DDF07AFF409AA88586DB6FCD74EC3AC020D24F80A91BD
mp-wp/wp-admin/includes/user.php
(0 . 0)(1 . 737)
46839 <?php
46840 /**
46841 * WordPress user administration API.
46842 *
46843 * @package WordPress
46844 * @subpackage Administration
46845 */
46846
46847 /**
46848 * Creates a new user from the "Users" form using $_POST information.
46849 *
46850 * {@internal Missing Long Description}}
46851 *
46852 * @since unknown
46853 *
46854 * @param int $user_id Optional. User ID.
46855 * @return null|WP_Error|int Null when adding user, WP_Error or User ID integer when no parameters.
46856 */
46857 function add_user() {
46858 if ( func_num_args() ) { // The hackiest hack that ever did hack
46859 global $current_user, $wp_roles;
46860 $user_id = (int) func_get_arg( 0 );
46861
46862 if ( isset( $_POST['role'] ) ) {
46863 if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ) ) {
46864 $user = new WP_User( $user_id );
46865 $user->set_role( $_POST['role'] );
46866 }
46867 }
46868 } else {
46869 add_action( 'user_register', 'add_user' ); // See above
46870 return edit_user();
46871 }
46872 }
46873
46874 /**
46875 * {@internal Missing Short Description}}
46876 *
46877 * {@internal Missing Long Description}}
46878 *
46879 * @since unknown
46880 *
46881 * @param int $user_id Optional. User ID.
46882 * @return unknown
46883 */
46884 function edit_user( $user_id = 0 ) {
46885 global $current_user, $wp_roles, $wpdb;
46886 if ( $user_id != 0 ) {
46887 $update = true;
46888 $user->ID = (int) $user_id;
46889 $userdata = get_userdata( $user_id );
46890 $user->user_login = $wpdb->escape( $userdata->user_login );
46891 } else {
46892 $update = false;
46893 $user = '';
46894 }
46895
46896 if ( isset( $_POST['user_login'] ))
46897 $user->user_login = wp_specialchars( trim( $_POST['user_login'] ));
46898
46899 $pass1 = $pass2 = '';
46900 if ( isset( $_POST['pass1'] ))
46901 $pass1 = $_POST['pass1'];
46902 if ( isset( $_POST['pass2'] ))
46903 $pass2 = $_POST['pass2'];
46904
46905 if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) {
46906 if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ))
46907 $user->role = $_POST['role'];
46908 }
46909
46910 if ( isset( $_POST['email'] ))
46911 $user->user_email = wp_specialchars( trim( $_POST['email'] ));
46912 if ( isset( $_POST['url'] ) ) {
46913 $user->user_url = clean_url( trim( $_POST['url'] ));
46914 $user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
46915 }
46916 if ( isset( $_POST['first_name'] ))
46917 $user->first_name = wp_specialchars( trim( $_POST['first_name'] ));
46918 if ( isset( $_POST['last_name'] ))
46919 $user->last_name = wp_specialchars( trim( $_POST['last_name'] ));
46920 if ( isset( $_POST['nickname'] ))
46921 $user->nickname = wp_specialchars( trim( $_POST['nickname'] ));
46922 if ( isset( $_POST['display_name'] ))
46923 $user->display_name = wp_specialchars( trim( $_POST['display_name'] ));
46924 if ( isset( $_POST['description'] ))
46925 $user->description = trim( $_POST['description'] );
46926 if ( isset( $_POST['jabber'] ))
46927 $user->jabber = wp_specialchars( trim( $_POST['jabber'] ));
46928 if ( isset( $_POST['aim'] ))
46929 $user->aim = wp_specialchars( trim( $_POST['aim'] ));
46930 if ( isset( $_POST['yim'] ))
46931 $user->yim = wp_specialchars( trim( $_POST['yim'] ));
46932 if ( !$update )
46933 $user->rich_editing = 'true'; // Default to true for new users.
46934 else if ( isset( $_POST['rich_editing'] ) )
46935 $user->rich_editing = $_POST['rich_editing'];
46936 else
46937 $user->rich_editing = 'true';
46938
46939 $user->comment_shortcuts = isset( $_POST['comment_shortcuts'] )? $_POST['comment_shortcuts'] : '';
46940
46941 $user->use_ssl = 0;
46942 if ( !empty($_POST['use_ssl']) )
46943 $user->use_ssl = 1;
46944
46945 if ( !$update )
46946 $user->admin_color = 'fresh'; // Default to fresh for new users.
46947 else if ( isset( $_POST['admin_color'] ) )
46948 $user->admin_color = $_POST['admin_color'];
46949 else
46950 $user->admin_color = 'fresh';
46951
46952 $errors = new WP_Error();
46953
46954 /* checking that username has been typed */
46955 if ( $user->user_login == '' )
46956 $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ));
46957
46958 /* checking the password has been typed twice */
46959 do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));
46960
46961 if ( $update ) {
46962 if ( empty($pass1) && !empty($pass2) )
46963 $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) );
46964 elseif ( !empty($pass1) && empty($pass2) )
46965 $errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) );
46966 } else {
46967 if ( empty($pass1) )
46968 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) );
46969 elseif ( empty($pass2) )
46970 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) );
46971 }
46972
46973 /* Check for "\" in password */
46974 if( strpos( " ".$pass1, "\\" ) )
46975 $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
46976
46977 /* checking the password has been typed twice the same */
46978 if ( $pass1 != $pass2 )
46979 $errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );
46980
46981 if (!empty ( $pass1 ))
46982 $user->user_pass = $pass1;
46983
46984 if ( !$update && !validate_username( $user->user_login ) )
46985 $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid. Please enter a valid username.' ));
46986
46987 if (!$update && username_exists( $user->user_login ))
46988 $errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ));
46989
46990 /* checking e-mail address */
46991 if ( empty ( $user->user_email ) ) {
46992 $errors->add( 'user_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );
46993 } else
46994 if (!is_email( $user->user_email ) ) {
46995 $errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) );
46996 }
46997
46998 if ( $errors->get_error_codes() )
46999 return $errors;
47000
47001 if ( $update ) {
47002 $user_id = wp_update_user( get_object_vars( $user ));
47003 } else {
47004 $user_id = wp_insert_user( get_object_vars( $user ));
47005 wp_new_user_notification( $user_id );
47006 }
47007 return $user_id;
47008 }
47009
47010 /**
47011 * {@internal Missing Short Description}}
47012 *
47013 * {@internal Missing Long Description}}
47014 *
47015 * @since unknown
47016 *
47017 * @return array List of user IDs.
47018 */
47019 function get_author_user_ids() {
47020 global $wpdb;
47021 $level_key = $wpdb->prefix . 'user_level';
47022 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
47023 }
47024
47025 /**
47026 * {@internal Missing Short Description}}
47027 *
47028 * {@internal Missing Long Description}}
47029 *
47030 * @since unknown
47031 *
47032 * @param int $user_id User ID.
47033 * @return array|bool List of editable authors. False if no editable users.
47034 */
47035 function get_editable_authors( $user_id ) {
47036 global $wpdb;
47037
47038 $editable = get_editable_user_ids( $user_id );
47039
47040 if( !$editable ) {
47041 return false;
47042 } else {
47043 $editable = join(',', $editable);
47044 $authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
47045 }
47046
47047 return apply_filters('get_editable_authors', $authors);
47048 }
47049
47050 /**
47051 * {@internal Missing Short Description}}
47052 *
47053 * {@internal Missing Long Description}}
47054 *
47055 * @since unknown
47056 *
47057 * @param int $user_id User ID.
47058 * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
47059 * @return unknown
47060 */
47061 function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
47062 global $wpdb;
47063
47064 $user = new WP_User( $user_id );
47065
47066 if ( ! $user->has_cap("edit_others_{$post_type}s") ) {
47067 if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false )
47068 return array($user->id);
47069 else
47070 return false;
47071 }
47072
47073 $level_key = $wpdb->prefix . 'user_level';
47074
47075 $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
47076 if ( $exclude_zeros )
47077 $query .= " AND meta_value != '0'";
47078
47079 return $wpdb->get_col( $query );
47080 }
47081
47082 /**
47083 * {@internal Missing Short Description}}
47084 *
47085 * {@internal Missing Long Description}}
47086 *
47087 * @since unknown
47088 *
47089 * @return unknown
47090 */
47091 function get_nonauthor_user_ids() {
47092 global $wpdb;
47093 $level_key = $wpdb->prefix . 'user_level';
47094
47095 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
47096 }
47097
47098 /**
47099 * Retrieve editable posts from other users.
47100 *
47101 * @since unknown
47102 *
47103 * @param int $user_id User ID to not retrieve posts from.
47104 * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
47105 * @return array List of posts from others.
47106 */
47107 function get_others_unpublished_posts($user_id, $type='any') {
47108 global $wpdb;
47109
47110 $editable = get_editable_user_ids( $user_id );
47111
47112 if ( in_array($type, array('draft', 'pending')) )
47113 $type_sql = " post_status = '$type' ";
47114 else
47115 $type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";
47116
47117 $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';
47118
47119 if( !$editable ) {
47120 $other_unpubs = '';
47121 } else {
47122 $editable = join(',', $editable);
47123 $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) );
47124 }
47125
47126 return apply_filters('get_others_drafts', $other_unpubs);
47127 }
47128
47129 /**
47130 * Retrieve drafts from other users.
47131 *
47132 * @since unknown
47133 *
47134 * @param int $user_id User ID.
47135 * @return array List of drafts from other users.
47136 */
47137 function get_others_drafts($user_id) {
47138 return get_others_unpublished_posts($user_id, 'draft');
47139 }
47140
47141 /**
47142 * Retrieve pending review posts from other users.
47143 *
47144 * @since unknown
47145 *
47146 * @param int $user_id User ID.
47147 * @return array List of posts with pending review post type from other users.
47148 */
47149 function get_others_pending($user_id) {
47150 return get_others_unpublished_posts($user_id, 'pending');
47151 }
47152
47153 /**
47154 * Retrieve user data and filter it.
47155 *
47156 * @since unknown
47157 *
47158 * @param int $user_id User ID.
47159 * @return object WP_User object with user data.
47160 */
47161 function get_user_to_edit( $user_id ) {
47162 $user = new WP_User( $user_id );
47163 $user->user_login = attribute_escape($user->user_login);
47164 $user->user_email = attribute_escape($user->user_email);
47165 $user->user_url = clean_url($user->user_url);
47166 $user->first_name = attribute_escape($user->first_name);
47167 $user->last_name = attribute_escape($user->last_name);
47168 $user->display_name = attribute_escape($user->display_name);
47169 $user->nickname = attribute_escape($user->nickname);
47170 $user->aim = isset( $user->aim ) && !empty( $user->aim ) ? attribute_escape($user->aim) : '';
47171 $user->yim = isset( $user->yim ) && !empty( $user->yim ) ? attribute_escape($user->yim) : '';
47172 $user->jabber = isset( $user->jabber ) && !empty( $user->jabber ) ? attribute_escape($user->jabber) : '';
47173 $user->description = isset( $user->description ) && !empty( $user->description ) ? wp_specialchars($user->description) : '';
47174
47175 return $user;
47176 }
47177
47178 /**
47179 * Retrieve the user's drafts.
47180 *
47181 * @since unknown
47182 *
47183 * @param int $user_id User ID.
47184 * @return array
47185 */
47186 function get_users_drafts( $user_id ) {
47187 global $wpdb;
47188 $query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id);
47189 $query = apply_filters('get_users_drafts', $query);
47190 return $wpdb->get_results( $query );
47191 }
47192
47193 /**
47194 * Remove user and optionally reassign posts and links to another user.
47195 *
47196 * If the $reassign parameter is not assigned to an User ID, then all posts will
47197 * be deleted of that user. The action 'delete_user' that is passed the User ID
47198 * being deleted will be run after the posts are either reassigned or deleted.
47199 * The user meta will also be deleted that are for that User ID.
47200 *
47201 * @since unknown
47202 *
47203 * @param int $id User ID.
47204 * @param int $reassign Optional. Reassign posts and links to new User ID.
47205 * @return bool True when finished.
47206 */
47207 function wp_delete_user($id, $reassign = 'novalue') {
47208 global $wpdb;
47209
47210 $id = (int) $id;
47211
47212 if ($reassign == 'novalue') {
47213 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
47214
47215 if ($post_ids) {
47216 foreach ($post_ids as $post_id)
47217 wp_delete_post($post_id);
47218 }
47219
47220 // Clean links
47221 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) );
47222 } else {
47223 $reassign = (int) $reassign;
47224 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) );
47225 $wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $id) );
47226 }
47227
47228 // FINALLY, delete user
47229 do_action('delete_user', $id);
47230
47231 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
47232 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
47233
47234 wp_cache_delete($id, 'users');
47235 wp_cache_delete($user->user_login, 'userlogins');
47236 wp_cache_delete($user->user_email, 'useremail');
47237
47238 return true;
47239 }
47240
47241 /**
47242 * Remove all capabilities from user.
47243 *
47244 * @since unknown
47245 *
47246 * @param int $id User ID.
47247 */
47248 function wp_revoke_user($id) {
47249 $id = (int) $id;
47250
47251 $user = new WP_User($id);
47252 $user->remove_all_caps();
47253 }
47254
47255 if ( !class_exists('WP_User_Search') ) :
47256 /**
47257 * WordPress User Search class.
47258 *
47259 * @since unknown
47260 * @author Mark Jaquith
47261 */
47262 class WP_User_Search {
47263
47264 /**
47265 * {@internal Missing Description}}
47266 *
47267 * @since unknown
47268 * @access private
47269 * @var unknown_type
47270 */
47271 var $results;
47272
47273 /**
47274 * {@internal Missing Description}}
47275 *
47276 * @since unknown
47277 * @access private
47278 * @var unknown_type
47279 */
47280 var $search_term;
47281
47282 /**
47283 * Page number.
47284 *
47285 * @since unknown
47286 * @access private
47287 * @var int
47288 */
47289 var $page;
47290
47291 /**
47292 * Role name that users have.
47293 *
47294 * @since unknown
47295 * @access private
47296 * @var string
47297 */
47298 var $role;
47299
47300 /**
47301 * Raw page number.
47302 *
47303 * @since unknown
47304 * @access private
47305 * @var int|bool
47306 */
47307 var $raw_page;
47308
47309 /**
47310 * Amount of users to display per page.
47311 *
47312 * @since unknown
47313 * @access public
47314 * @var int
47315 */
47316 var $users_per_page = 50;
47317
47318 /**
47319 * {@internal Missing Description}}
47320 *
47321 * @since unknown
47322 * @access private
47323 * @var unknown_type
47324 */
47325 var $first_user;
47326
47327 /**
47328 * {@internal Missing Description}}
47329 *
47330 * @since unknown
47331 * @access private
47332 * @var int
47333 */
47334 var $last_user;
47335
47336 /**
47337 * {@internal Missing Description}}
47338 *
47339 * @since unknown
47340 * @access private
47341 * @var unknown_type
47342 */
47343 var $query_limit;
47344
47345 /**
47346 * {@internal Missing Description}}
47347 *
47348 * @since unknown
47349 * @access private
47350 * @var unknown_type
47351 */
47352 var $query_sort;
47353
47354 /**
47355 * {@internal Missing Description}}
47356 *
47357 * @since unknown
47358 * @access private
47359 * @var unknown_type
47360 */
47361 var $query_from_where;
47362
47363 /**
47364 * {@internal Missing Description}}
47365 *
47366 * @since unknown
47367 * @access private
47368 * @var int
47369 */
47370 var $total_users_for_query = 0;
47371
47372 /**
47373 * {@internal Missing Description}}
47374 *
47375 * @since unknown
47376 * @access private
47377 * @var bool
47378 */
47379 var $too_many_total_users = false;
47380
47381 /**
47382 * {@internal Missing Description}}
47383 *
47384 * @since unknown
47385 * @access private
47386 * @var unknown_type
47387 */
47388 var $search_errors;
47389
47390 /**
47391 * {@internal Missing Description}}
47392 *
47393 * @since unknown
47394 * @access private
47395 * @var unknown_type
47396 */
47397 var $paging_text;
47398
47399 /**
47400 * PHP4 Constructor - Sets up the object properties.
47401 *
47402 * @since unknown
47403 *
47404 * @param string $search_term Search terms string.
47405 * @param int $page Optional. Page ID.
47406 * @param string $role Role name.
47407 * @return WP_User_Search
47408 */
47409 function WP_User_Search ($search_term = '', $page = '', $role = '') {
47410 $this->search_term = $search_term;
47411 $this->raw_page = ( '' == $page ) ? false : (int) $page;
47412 $this->page = (int) ( '' == $page ) ? 1 : $page;
47413 $this->role = $role;
47414
47415 $this->prepare_query();
47416 $this->query();
47417 $this->prepare_vars_for_template_usage();
47418 $this->do_paging();
47419 }
47420
47421 /**
47422 * {@internal Missing Short Description}}
47423 *
47424 * {@internal Missing Long Description}}
47425 *
47426 * @since unknown
47427 * @access public
47428 */
47429 function prepare_query() {
47430 global $wpdb;
47431 $this->first_user = ($this->page - 1) * $this->users_per_page;
47432 $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
47433 $this->query_sort = ' ORDER BY user_login';
47434 $search_sql = '';
47435 if ( $this->search_term ) {
47436 $searches = array();
47437 $search_sql = 'AND (';
47438 foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
47439 $searches[] = $col . " LIKE '%$this->search_term%'";
47440 $search_sql .= implode(' OR ', $searches);
47441 $search_sql .= ')';
47442 }
47443
47444 $this->query_from_where = "FROM $wpdb->users";
47445 if ( $this->role )
47446 $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
47447 else
47448 $this->query_from_where .= " WHERE 1=1";
47449 $this->query_from_where .= " $search_sql";
47450
47451 }
47452
47453 /**
47454 * {@internal Missing Short Description}}
47455 *
47456 * {@internal Missing Long Description}}
47457 *
47458 * @since unknown
47459 * @access public
47460 */
47461 function query() {
47462 global $wpdb;
47463 $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit);
47464
47465 if ( $this->results )
47466 $this->total_users_for_query = $wpdb->get_var('SELECT COUNT(ID) ' . $this->query_from_where); // no limit
47467 else
47468 $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!'));
47469 }
47470
47471 /**
47472 * {@internal Missing Short Description}}
47473 *
47474 * {@internal Missing Long Description}}
47475 *
47476 * @since unknown
47477 * @access public
47478 */
47479 function prepare_vars_for_template_usage() {
47480 $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
47481 }
47482
47483 /**
47484 * {@internal Missing Short Description}}
47485 *
47486 * {@internal Missing Long Description}}
47487 *
47488 * @since unknown
47489 * @access public
47490 */
47491 function do_paging() {
47492 if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
47493 $args = array();
47494 if( ! empty($this->search_term) )
47495 $args['usersearch'] = urlencode($this->search_term);
47496 if( ! empty($this->role) )
47497 $args['role'] = urlencode($this->role);
47498
47499 $this->paging_text = paginate_links( array(
47500 'total' => ceil($this->total_users_for_query / $this->users_per_page),
47501 'current' => $this->page,
47502 'base' => 'users.php?%_%',
47503 'format' => 'userspage=%#%',
47504 'add_args' => $args
47505 ) );
47506 if ( $this->paging_text ) {
47507 $this->paging_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
47508 number_format_i18n( ( $this->page - 1 ) * $this->users_per_page + 1 ),
47509 number_format_i18n( min( $this->page * $this->users_per_page, $this->total_users_for_query ) ),
47510 number_format_i18n( $this->total_users_for_query ),
47511 $this->paging_text
47512 );
47513 }
47514 }
47515 }
47516
47517 /**
47518 * {@internal Missing Short Description}}
47519 *
47520 * {@internal Missing Long Description}}
47521 *
47522 * @since unknown
47523 * @access public
47524 *
47525 * @return unknown
47526 */
47527 function get_results() {
47528 return (array) $this->results;
47529 }
47530
47531 /**
47532 * Displaying paging text.
47533 *
47534 * @see do_paging() Builds paging text.
47535 *
47536 * @since unknown
47537 * @access public
47538 */
47539 function page_links() {
47540 echo $this->paging_text;
47541 }
47542
47543 /**
47544 * Whether paging is enabled.
47545 *
47546 * @see do_paging() Builds paging text.
47547 *
47548 * @since unknown
47549 * @access public
47550 *
47551 * @return bool
47552 */
47553 function results_are_paged() {
47554 if ( $this->paging_text )
47555 return true;
47556 return false;
47557 }
47558
47559 /**
47560 * Whether there are search terms.
47561 *
47562 * @since unknown
47563 * @access public
47564 *
47565 * @return bool
47566 */
47567 function is_search() {
47568 if ( $this->search_term )
47569 return true;
47570 return false;
47571 }
47572 }
47573 endif;
47574
47575 ?>