Make WordPress Core


Ignore:
Timestamp:
10/02/2008 01:03:26 AM (18 years ago)
Author:
ryan
Message:

phpdoc for wp-admin/includes from jacobsantos. see #7527

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r8944 r9053  
    11<?php
    2 
    3 // Creates a new user from the "Users" form using $_POST information.
     2/**
     3 * WordPress user administration API.
     4 *
     5 * @package WordPress
     6 * @subpackage Administration
     7 */
     8
     9/**
     10 * Creates a new user from the "Users" form using $_POST information.
     11 *
     12 * {@internal Missing Long Description}}
     13 *
     14 * @since unknown
     15 *
     16 * @param int $user_id Optional. User ID.
     17 * @return null|WP_Error|int Null when adding user, WP_Error or User ID integer when no parameters.
     18 */
    419function add_user() {
    520        if ( func_num_args() ) { // The hackiest hack that ever did hack
     
    1934}
    2035
     36/**
     37 * {@internal Missing Short Description}}
     38 *
     39 * {@internal Missing Long Description}}
     40 *
     41 * @since unknown
     42 *
     43 * @param int $user_id Optional. User ID.
     44 * @return unknown
     45 */
    2146function edit_user( $user_id = 0 ) {
    2247        global $current_user, $wp_roles, $wpdb;
     
    143168}
    144169
     170/**
     171 * {@internal Missing Short Description}}
     172 *
     173 * {@internal Missing Long Description}}
     174 *
     175 * @since unknown
     176 *
     177 * @return array List of user IDs.
     178 */
    145179function get_author_user_ids() {
    146180        global $wpdb;
     
    149183}
    150184
     185/**
     186 * {@internal Missing Short Description}}
     187 *
     188 * {@internal Missing Long Description}}
     189 *
     190 * @since unknown
     191 *
     192 * @param int $user_id User ID.
     193 * @return array|bool List of editable authors. False if no editable users.
     194 */
    151195function get_editable_authors( $user_id ) {
    152196        global $wpdb;
     
    164208}
    165209
     210/**
     211 * {@internal Missing Short Description}}
     212 *
     213 * {@internal Missing Long Description}}
     214 *
     215 * @since unknown
     216 *
     217 * @param int $user_id User ID.
     218 * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
     219 * @return unknown
     220 */
    166221function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
    167222        global $wpdb;
     
    185240}
    186241
     242/**
     243 * {@internal Missing Short Description}}
     244 *
     245 * {@internal Missing Long Description}}
     246 *
     247 * @since unknown
     248 *
     249 * @return unknown
     250 */
    187251function get_nonauthor_user_ids() {
    188252        global $wpdb;
     
    192256}
    193257
     258/**
     259 * Retrieve editable posts from other users.
     260 *
     261 * @since unknown
     262 *
     263 * @param int $user_id User ID to not retrieve posts from.
     264 * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'.
     265 * @return array List of posts from others.
     266 */
    194267function get_others_unpublished_posts($user_id, $type='any') {
    195268        global $wpdb;
     
    214287}
    215288
     289/**
     290 * Retrieve drafts from other users.
     291 *
     292 * @since unknown
     293 *
     294 * @param int $user_id User ID.
     295 * @return array List of drafts from other users.
     296 */
    216297function get_others_drafts($user_id) {
    217298        return get_others_unpublished_posts($user_id, 'draft');
    218299}
    219300
     301/**
     302 * Retrieve pending review posts from other users.
     303 *
     304 * @since unknown
     305 *
     306 * @param int $user_id User ID.
     307 * @return array List of posts with pending review post type from other users.
     308 */
    220309function get_others_pending($user_id) {
    221310        return get_others_unpublished_posts($user_id, 'pending');
    222311}
    223312
     313/**
     314 * Retrieve user data and filter it.
     315 *
     316 * @since unknown
     317 *
     318 * @param int $user_id User ID.
     319 * @return object WP_User object with user data.
     320 */
    224321function get_user_to_edit( $user_id ) {
    225322        $user = new WP_User( $user_id );
     
    239336}
    240337
     338/**
     339 * Retrieve the user's drafts.
     340 *
     341 * @since unknown
     342 *
     343 * @param int $user_id User ID.
     344 * @return array
     345 */
    241346function get_users_drafts( $user_id ) {
    242347        global $wpdb;
     
    246351}
    247352
     353/**
     354 * Remove user and optionally reassign posts and links to another user.
     355 *
     356 * If the $reassign parameter is not assigned to an User ID, then all posts will
     357 * be deleted of that user. The action 'delete_user' that is passed the User ID
     358 * being deleted will be run after the posts are either reassigned or deleted.
     359 * The user meta will also be deleted that are for that User ID.
     360 *
     361 * @since unknown
     362 *
     363 * @param int $id User ID.
     364 * @param int $reassign Optional. Reassign posts and links to new User ID.
     365 * @return bool True when finished.
     366 */
    248367function wp_delete_user($id, $reassign = 'novalue') {
    249368        global $wpdb;
     
    280399}
    281400
     401/**
     402 * Remove all capabilities from user.
     403 *
     404 * @since unknown
     405 *
     406 * @param int $id User ID.
     407 */
    282408function wp_revoke_user($id) {
    283409        $id = (int) $id;
     
    287413}
    288414
    289 // WP_User_Search class
    290 // by Mark Jaquith
    291 
    292415if ( !class_exists('WP_User_Search') ) :
     416/**
     417 * WordPress User Search class.
     418 *
     419 * @since unknown
     420 * @author Mark Jaquith
     421 */
    293422class WP_User_Search {
     423
     424        /**
     425         * {@internal Missing Description}}
     426         *
     427         * @since unknown
     428         * @access private
     429         * @var unknown_type
     430         */
    294431        var $results;
     432
     433        /**
     434         * {@internal Missing Description}}
     435         *
     436         * @since unknown
     437         * @access private
     438         * @var unknown_type
     439         */
    295440        var $search_term;
     441
     442        /**
     443         * Page number.
     444         *
     445         * @since unknown
     446         * @access private
     447         * @var int
     448         */
    296449        var $page;
     450
     451        /**
     452         * Role name that users have.
     453         *
     454         * @since unknown
     455         * @access private
     456         * @var string
     457         */
    297458        var $role;
     459
     460        /**
     461         * Raw page number.
     462         *
     463         * @since unknown
     464         * @access private
     465         * @var int|bool
     466         */
    298467        var $raw_page;
     468
     469        /**
     470         * Amount of users to display per page.
     471         *
     472         * @since unknown
     473         * @access public
     474         * @var int
     475         */
    299476        var $users_per_page = 50;
     477
     478        /**
     479         * {@internal Missing Description}}
     480         *
     481         * @since unknown
     482         * @access private
     483         * @var unknown_type
     484         */
    300485        var $first_user;
     486
     487        /**
     488         * {@internal Missing Description}}
     489         *
     490         * @since unknown
     491         * @access private
     492         * @var int
     493         */
    301494        var $last_user;
     495
     496        /**
     497         * {@internal Missing Description}}
     498         *
     499         * @since unknown
     500         * @access private
     501         * @var unknown_type
     502         */
    302503        var $query_limit;
     504
     505        /**
     506         * {@internal Missing Description}}
     507         *
     508         * @since unknown
     509         * @access private
     510         * @var unknown_type
     511         */
    303512        var $query_sort;
     513
     514        /**
     515         * {@internal Missing Description}}
     516         *
     517         * @since unknown
     518         * @access private
     519         * @var unknown_type
     520         */
    304521        var $query_from_where;
     522
     523        /**
     524         * {@internal Missing Description}}
     525         *
     526         * @since unknown
     527         * @access private
     528         * @var int
     529         */
    305530        var $total_users_for_query = 0;
     531
     532        /**
     533         * {@internal Missing Description}}
     534         *
     535         * @since unknown
     536         * @access private
     537         * @var bool
     538         */
    306539        var $too_many_total_users = false;
     540
     541        /**
     542         * {@internal Missing Description}}
     543         *
     544         * @since unknown
     545         * @access private
     546         * @var unknown_type
     547         */
    307548        var $search_errors;
     549
     550        /**
     551         * {@internal Missing Description}}
     552         *
     553         * @since unknown
     554         * @access private
     555         * @var unknown_type
     556         */
    308557        var $paging_text;
    309558
    310         function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor
     559        /**
     560         * PHP4 Constructor - Sets up the object properties.
     561         *
     562         * @since unknown
     563         *
     564         * @param string $search_term Search terms string.
     565         * @param int $page Optional. Page ID.
     566         * @param string $role Role name.
     567         * @return WP_User_Search
     568         */
     569        function WP_User_Search ($search_term = '', $page = '', $role = '') {
    311570                $this->search_term = $search_term;
    312571                $this->raw_page = ( '' == $page ) ? false : (int) $page;
     
    320579        }
    321580
     581        /**
     582         * {@internal Missing Short Description}}
     583         *
     584         * {@internal Missing Long Description}}
     585         *
     586         * @since unknown
     587         * @access public
     588         */
    322589        function prepare_query() {
    323590                global $wpdb;
     
    344611        }
    345612
     613        /**
     614         * {@internal Missing Short Description}}
     615         *
     616         * {@internal Missing Long Description}}
     617         *
     618         * @since unknown
     619         * @access public
     620         */
    346621        function query() {
    347622                global $wpdb;
     
    354629        }
    355630
     631        /**
     632         * {@internal Missing Short Description}}
     633         *
     634         * {@internal Missing Long Description}}
     635         *
     636         * @since unknown
     637         * @access public
     638         */
    356639        function prepare_vars_for_template_usage() {
    357640                $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
    358641        }
    359642
     643        /**
     644         * {@internal Missing Short Description}}
     645         *
     646         * {@internal Missing Long Description}}
     647         *
     648         * @since unknown
     649         * @access public
     650         */
    360651        function do_paging() {
    361652                if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
     
    376667        }
    377668
     669        /**
     670         * {@internal Missing Short Description}}
     671         *
     672         * {@internal Missing Long Description}}
     673         *
     674         * @since unknown
     675         * @access public
     676         *
     677         * @return unknown
     678         */
    378679        function get_results() {
    379680                return (array) $this->results;
    380681        }
    381682
     683        /**
     684         * Displaying paging text.
     685         *
     686         * @see do_paging() Builds paging text.
     687         *
     688         * @since unknown
     689         * @access public
     690         */
    382691        function page_links() {
    383692                echo $this->paging_text;
    384693        }
    385694
     695        /**
     696         * Whether paging is enabled.
     697         *
     698         * @see do_paging() Builds paging text.
     699         *
     700         * @since unknown
     701         * @access public
     702         *
     703         * @return bool
     704         */
    386705        function results_are_paged() {
    387706                if ( $this->paging_text )
     
    390709        }
    391710
     711        /**
     712         * Whether there are search terms.
     713         *
     714         * @since unknown
     715         * @access public
     716         *
     717         * @return bool
     718         */
    392719        function is_search() {
    393720                if ( $this->search_term )
Note: See TracChangeset for help on using the changeset viewer.