WordPress.org

Make WordPress Core

Ticket #7527: 7527.r8921.diff

File 7527.r8921.diff, 25.5 KB (added by jacobsantos, 10 years ago)

Skeleton and corrections to wp-admin/includes files, based off of r8921

  • image.php

     
    221221}
    222222
    223223/**
    224  * Get extended image metadata, exif or iptc as available
     224 * Get extended image metadata, exif or iptc as available.
    225225 *
    226226 * @since unknown
    227227 *
  • theme.php

     
    11<?php
     2/**
     3 * WordPress Theme Administration API
     4 *
     5 * @package WordPress
     6 * @subpackage Administration
     7 */
    28
     9/**
     10 * {@internal Missing Short Description}}
     11 *
     12 * @since unknown
     13 *
     14 * @return unknown
     15 */
    316function current_theme_info() {
    417        $themes = get_themes();
    518        $current_theme = get_current_theme();
     
    1831        return $ct;
    1932}
    2033
     34/**
     35 * {@internal Missing Short Description}}
     36 *
     37 * @since unknown
     38 *
     39 * @return unknown
     40 */
    2141function get_broken_themes() {
    2242        global $wp_broken_themes;
    2343
     
    2545        return $wp_broken_themes;
    2646}
    2747
     48/**
     49 * {@internal Missing Short Description}}
     50 *
     51 * @since unknown
     52 *
     53 * @return unknown
     54 */
    2855function get_page_templates() {
    2956        $themes = get_themes();
    3057        $theme = get_current_theme();
  • update-core.php

     
    44 *
    55 * @package WordPress
    66 * @subpackage Administration
    7  * @since 2.7
     7 * @since 2.7.0
    88 */
    99
    1010/**
    1111 * Stores files to be deleted.
    1212 *
    13  * @since 2.7
     13 * @since 2.7.0
    1414 * @global array $_old_files
    1515 * @var array
    1616 * @name $_old_files
     
    166166 * themes, then if you edit the default theme, you should rename it, so that
    167167 * your changes remain.
    168168 *
     169 * @since 2.7.0
     170 *
    169171 * @param string $from New release unzipped path.
    170172 * @param string $to Path to old WordPress installation.
    171173 * @return WP_Error|null WP_Error on failure, null on success.
  • upgrade.php

     
    11<?php
     2/**
     3 * WordPress Upgrade API
     4 *
     5 * Most of the functions are pluggable and can be overwritten
     6 *
     7 * @package WordPress
     8 * @subpackage Administration
     9 */
    210
     11/** Include user install customize script. */
    312if ( file_exists(WP_CONTENT_DIR . '/install.php') )
    413        require (WP_CONTENT_DIR . '/install.php');
     14
     15/** WordPress Administration API */
    516require_once(ABSPATH . 'wp-admin/includes/admin.php');
     17
     18/** WordPress Schema API */
    619require_once(ABSPATH . 'wp-admin/includes/schema.php');
    720
    821if ( !function_exists('wp_install') ) :
     22/**
     23 * {@internal Missing Short Description}}
     24 *
     25 * {@internal Missing Long Description}}
     26 *
     27 * @since unknown
     28 *
     29 * @param string $blog_title Blog title.
     30 * @param string $user_name User's username.
     31 * @param string $user_email User's email.
     32 * @param bool $public Whether blog is public.
     33 * @param null $deprecated Optional. Not used.
     34 * @return array Array keys 'url', 'user_id', 'password'.
     35 */
    936function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') {
    1037        global $wp_rewrite;
    1138
     
    5380endif;
    5481
    5582if ( !function_exists('wp_install_defaults') ) :
     83/**
     84 * {@internal Missing Short Description}}
     85 *
     86 * {@internal Missing Long Description}}
     87 *
     88 * @since unknown
     89 *
     90 * @param int $user_id User ID.
     91 */
    5692function wp_install_defaults($user_id) {
    5793        global $wpdb;
    5894
     
    107143endif;
    108144
    109145if ( !function_exists('wp_new_blog_notification') ) :
     146/**
     147 * {@internal Missing Short Description}}
     148 *
     149 * {@internal Missing Long Description}}
     150 *
     151 * @since unknown
     152 *
     153 * @param string $blog_title Blog title.
     154 * @param string $blog_url Blog url.
     155 * @param int $user_id User ID.
     156 * @param string $password User's Password.
     157 */
    110158function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
    111159        $user = new WP_User($user_id);
    112160        $email = $user->user_email;
     
    132180endif;
    133181
    134182if ( !function_exists('wp_upgrade') ) :
     183/**
     184 * Run WordPress Upgrade functions.
     185 *
     186 * {@internal Missing Long Description}}
     187 *
     188 * @since unknown
     189 *
     190 * @return null
     191 */
    135192function wp_upgrade() {
    136193        global $wp_current_db_version, $wp_db_version;
    137194
     
    141198        if ( $wp_db_version == $wp_current_db_version )
    142199                return;
    143200
    144         if(!is_blog_installed())
     201        if( ! is_blog_installed() )
    145202                return;
    146203
    147204        wp_check_mysql_version();
     
    152209}
    153210endif;
    154211
    155 // Functions to be called in install and upgrade scripts
     212/**
     213 * Functions to be called in install and upgrade scripts.
     214 *
     215 * {@internal Missing Long Description}}
     216 *
     217 * @since unknown
     218 */
    156219function upgrade_all() {
    157220        global $wp_current_db_version, $wp_db_version, $wp_rewrite;
    158221        $wp_current_db_version = __get_option('db_version');
     
    220283        update_option('db_version', $wp_db_version);
    221284}
    222285
     286/**
     287 * Execute changes made in WordPress 1.0.
     288 *
     289 * @since 1.0.0
     290 */
    223291function upgrade_100() {
    224292        global $wpdb;
    225293
     
    242310                }
    243311        }
    244312
    245 
    246313        $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')
    247314        WHERE option_name LIKE 'links_rating_image%'
    248315        AND option_value LIKE 'wp-links/links-images/%'");
     
    272339        endif;
    273340}
    274341
     342/**
     343 * Execute changes made in WordPress 1.0.1.
     344 *
     345 * @since 1.0.1
     346 */
    275347function upgrade_101() {
    276348        global $wpdb;
    277349
     
    285357        add_clean_index($wpdb->links , 'link_visible');
    286358}
    287359
    288 
     360/**
     361 * Execute changes made in WordPress 1.2.
     362 *
     363 * @since 1.2.0
     364 */
    289365function upgrade_110() {
    290366        global $wpdb;
    291367
     
    305381                }
    306382        }
    307383
    308 
    309384        // Get the GMT offset, we'll use that later on
    310385        $all_options = get_alloptions_110();
    311386
     
    342417
    343418}
    344419
     420/**
     421 * Execute changes made in WordPress 1.5.
     422 *
     423 * @since 1.5.0
     424 */
    345425function upgrade_130() {
    346426        global $wpdb;
    347427
     
    419499        make_site_theme();
    420500}
    421501
     502/**
     503 * Execute changes made in WordPress 2.0.
     504 *
     505 * @since 2.0.0
     506 */
    422507function upgrade_160() {
    423508        global $wpdb, $wp_current_db_version;
    424509
     
    497582        }
    498583}
    499584
     585/**
     586 * Execute changes made in WordPress 2.1.
     587 *
     588 * @since 2.1.0
     589 */
    500590function upgrade_210() {
    501591        global $wpdb, $wp_current_db_version;
    502592
     
    536626        }
    537627}
    538628
     629/**
     630 * Execute changes made in WordPress 2.3.
     631 *
     632 * @since 2.3.0
     633 */
    539634function upgrade_230() {
    540635        global $wp_current_db_version, $wpdb;
    541636
     
    706801        }
    707802}
    708803
     804/**
     805 * Remove old options from the database.
     806 *
     807 * @since 2.3.0
     808 */
    709809function upgrade_230_options_table() {
    710810        global $wpdb;
    711811        $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' );
     
    715815        $wpdb->show_errors();
    716816}
    717817
     818/**
     819 * Remove old categories, link2cat, and post2cat database tables.
     820 *
     821 * @since 2.3.0
     822 */
    718823function upgrade_230_old_tables() {
    719824        global $wpdb;
    720825        $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories');
     
    722827        $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat');
    723828}
    724829
     830/**
     831 * Upgrade old slugs made in version 2.2.
     832 *
     833 * @since 2.2.0
     834 */
    725835function upgrade_old_slugs() {
    726836        // upgrade people who were using the Redirect Old Slugs plugin
    727837        global $wpdb;
    728838        $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'");
    729839}
    730840
    731 
     841/**
     842 * Execute changes made in WordPress 2.5.0.
     843 *
     844 * @since 2.5.0
     845 */
    732846function upgrade_250() {
    733847        global $wp_current_db_version;
    734848
     
    738852
    739853}
    740854
     855/**
     856 * Execute changes made in WordPress 2.5.1.
     857 *
     858 * @since 2.5.1
     859 */
    741860function upgrade_251() {
    742861        global $wp_current_db_version;
    743862
     
    745864        update_option('secret', wp_generate_password(64));
    746865}
    747866
     867/**
     868 * Execute changes made in WordPress 2.5.2.
     869 *
     870 * @since 2.5.2
     871 */
    748872function upgrade_252() {
    749873        global $wpdb;
    750874
    751875        $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''");
    752876}
    753877
     878/**
     879 * Execute changes made in WordPress 2.6.
     880 *
     881 * @since 2.6.0
     882 */
    754883function upgrade_260() {
    755884        global $wp_current_db_version;
    756885
     
    763892        }
    764893}
    765894
     895/**
     896 * Execute changes made in WordPress 2.7.
     897 *
     898 * @since 2.7.0
     899 */
    766900function upgrade_270() {
    767901        global $wpdb, $wp_current_db_version;
    768902
     
    778912// The functions we use to actually do stuff
    779913
    780914// General
     915
     916/**
     917 * {@internal Missing Short Description}}
     918 *
     919 * {@internal Missing Long Description}}
     920 *
     921 * @since unknown
     922 *
     923 * @param string $table_name Database table name to create.
     924 * @param string $create_ddl SQL statement to create table.
     925 * @return bool If table already exists or was created by function.
     926 */
    781927function maybe_create_table($table_name, $create_ddl) {
    782928        global $wpdb;
    783929        foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
     
    796942        return false;
    797943}
    798944
     945/**
     946 * {@internal Missing Short Description}}
     947 *
     948 * {@internal Missing Long Description}}
     949 *
     950 * @since unknown
     951 *
     952 * @param string $table Database table name.
     953 * @param string $index Index name to drop.
     954 * @return bool True, when finished.
     955 */
    799956function drop_index($table, $index) {
    800957        global $wpdb;
    801958        $wpdb->hide_errors();
     
    808965        return true;
    809966}
    810967
     968/**
     969 * {@internal Missing Short Description}}
     970 *
     971 * {@internal Missing Long Description}}
     972 *
     973 * @since unknown
     974 *
     975 * @param string $table Database table name.
     976 * @param string $index Database table index column.
     977 * @return bool True, when done with execution.
     978 */
    811979function add_clean_index($table, $index) {
    812980        global $wpdb;
    813981        drop_index($table, $index);
     
    8401008        return false;
    8411009}
    8421010
    843 
    844 // get_alloptions as it was for 1.2.
     1011/**
     1012 * Retrieve all options as it was for 1.2.
     1013 *
     1014 * @since 1.2.0
     1015 *
     1016 * @return array List of options.
     1017 */
    8451018function get_alloptions_110() {
    8461019        global $wpdb;
    8471020        if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) {
     
    8571030        return $all_options;
    8581031}
    8591032
    860 // Version of get_option that is private to install/upgrade.
     1033/**
     1034 * Version of get_option that is private to install/upgrade.
     1035 *
     1036 * @since unknown
     1037 * @access private
     1038 *
     1039 * @param string $setting Option name.
     1040 * @return mixed
     1041 */
    8611042function __get_option($setting) {
    8621043        global $wpdb;
    8631044
     
    8841065                return $option;
    8851066}
    8861067
     1068/**
     1069 * {@internal Missing Short Description}}
     1070 *
     1071 * {@internal Missing Long Description}}
     1072 *
     1073 * @since unknown
     1074 *
     1075 * @param string $content
     1076 * @return string
     1077 */
    8871078function deslash($content) {
    8881079        // Note: \\\ inside a regex denotes a single backslash.
    8891080
     
    9011092        return $content;
    9021093}
    9031094
     1095/**
     1096 * {@internal Missing Short Description}}
     1097 *
     1098 * {@internal Missing Long Description}}
     1099 *
     1100 * @since unknown
     1101 *
     1102 * @param unknown_type $queries
     1103 * @param unknown_type $execute
     1104 * @return unknown
     1105 */
    9041106function dbDelta($queries, $execute = true) {
    9051107        global $wpdb;
    9061108
     
    11021304        return $for_update;
    11031305}
    11041306
     1307/**
     1308 * {@internal Missing Short Description}}
     1309 *
     1310 * {@internal Missing Long Description}}
     1311 *
     1312 * @since unknown
     1313 */
    11051314function make_db_current() {
    11061315        global $wp_queries;
    11071316
     
    11111320        echo "</ol>\n";
    11121321}
    11131322
     1323/**
     1324 * {@internal Missing Short Description}}
     1325 *
     1326 * {@internal Missing Long Description}}
     1327 *
     1328 * @since unknown
     1329 */
    11141330function make_db_current_silent() {
    11151331        global $wp_queries;
    11161332
    11171333        $alterations = dbDelta($wp_queries);
    11181334}
    11191335
     1336/**
     1337 * {@internal Missing Short Description}}
     1338 *
     1339 * {@internal Missing Long Description}}
     1340 *
     1341 * @since unknown
     1342 *
     1343 * @param unknown_type $theme_name
     1344 * @param unknown_type $template
     1345 * @return unknown
     1346 */
    11201347function make_site_theme_from_oldschool($theme_name, $template) {
    11211348        $home_path = get_home_path();
    11221349        $site_dir = WP_CONTENT_DIR . "/themes/$template";
     
    11851412        return true;
    11861413}
    11871414
     1415/**
     1416 * {@internal Missing Short Description}}
     1417 *
     1418 * {@internal Missing Long Description}}
     1419 *
     1420 * @since unknown
     1421 *
     1422 * @param unknown_type $theme_name
     1423 * @param unknown_type $template
     1424 * @return unknown
     1425 */
    11881426function make_site_theme_from_default($theme_name, $template) {
    11891427        $site_dir = WP_CONTENT_DIR . "/themes/$template";
    11901428        $default_dir = WP_CONTENT_DIR . '/themes/default';
     
    12401478}
    12411479
    12421480// Create a site theme from the default theme.
     1481/**
     1482 * {@internal Missing Short Description}}
     1483 *
     1484 * {@internal Missing Long Description}}
     1485 *
     1486 * @since unknown
     1487 *
     1488 * @return unknown
     1489 */
    12431490function make_site_theme() {
    12441491        // Name the theme after the blog.
    12451492        $theme_name = __get_option('blogname');
     
    12811528        return $template;
    12821529}
    12831530
     1531/**
     1532 * Translate user level to user role name.
     1533 *
     1534 * @since unknown
     1535 *
     1536 * @param int $level User level.
     1537 * @return string User role name.
     1538 */
    12841539function translate_level_to_role($level) {
    12851540        switch ($level) {
    12861541        case 10:
     
    13021557        }
    13031558}
    13041559
     1560/**
     1561 * {@internal Missing Short Description}}
     1562 *
     1563 * {@internal Missing Long Description}}
     1564 *
     1565 * @since unknown
     1566 */
    13051567function wp_check_mysql_version() {
    13061568        global $wpdb;
    13071569        $result = $wpdb->check_database_version();
     
    13091571                die( $result->get_error_message() );
    13101572}
    13111573
     1574/**
     1575 * {@internal Missing Short Description}}
     1576 *
     1577 * {@internal Missing Long Description}}
     1578 *
     1579 * @since unknown
     1580 */
    13121581function maybe_disable_automattic_widgets() {
    13131582        $plugins = __get_option( 'active_plugins' );
    13141583
  • user.php

     
    11<?php
     2/**
     3 * WordPress user administration API.
     4 *
     5 * @package WordPress
     6 * @subpackage Administration
     7 */
    28
    3 // Creates a new user from the "Users" form using $_POST information.
     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
    621                global $current_user, $wp_roles;
     
    1833        }
    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;
    2348        if ( $user_id != 0 ) {
     
    142167        return $user_id;
    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;
    147181        $level_key = $wpdb->prefix . 'user_level';
    148182        return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
    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;
    153197
     
    163207        return apply_filters('get_editable_authors', $authors);
    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;
    168223
     
    184239        return $wpdb->get_col( $query );
    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;
    189253        $level_key = $wpdb->prefix . 'user_level';
     
    191255        return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
    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;
    196269
     
    213286        return apply_filters('get_others_drafts', $other_unpubs);
    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 );
    226323        $user->user_login   = attribute_escape($user->user_login);
     
    233330        $user->aim          = attribute_escape($user->aim);
    234331        $user->yim          = attribute_escape($user->yim);
    235332        $user->jabber       = attribute_escape($user->jabber);
    236         $user->description  =  wp_specialchars($user->description);
     333        $user->description  = wp_specialchars($user->description);
    237334
    238335        return $user;
    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;
    243348        $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);
     
    245350        return $wpdb->get_results( $query );
    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;
    250369
     
    279398        return true;
    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;
    284410
     
    286412        $user->remove_all_caps();
    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;
    313572                $this->page = (int) ( '' == $page ) ? 1 : $page;
     
    319578                $this->do_paging();
    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;
    324591                $this->first_user = ($this->page - 1) * $this->users_per_page;
     
    343610
    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;
    348623                $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit);
     
    353628                        $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!'));
    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
    362653                        $args = array();
     
    375666                }
    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 )
    388707                        return true;
    389708                return false;
    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 )
    394721                        return true;
  • widgets.php

     
    99/**
    1010 * Display list of widgets, either all or matching search.
    1111 *
     12 * The search parameter are search terms separated by spaces.
     13 *
    1214 * @since unknown
    1315 *
    14  * @param unknown_type $show
    15  * @param unknown_type $_search Optional. Search for widgets. Should be unsanitized.
     16 * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'.
     17 * @param string $_search Optional. Search for widgets. Should be unsanitized.
    1618 */
    1719function wp_list_widgets( $show = 'all', $_search = false ) {
    1820        global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
     
    166168 *
    167169 * @since unknown
    168170 *
    169  * @param unknown_type $sidebar
     171 * @param string $sidebar
    170172 */
    171173function wp_list_widget_controls( $sidebar ) {
    172174        add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
     
    186188 *
    187189 * @since unknown
    188190 *
    189  * @param unknown_type $params
    190  * @return unknown
     191 * @param array $params
     192 * @return array
    191193 */
    192194function wp_list_widget_controls_dynamic_sidebar( $params ) {
    193195        global $wp_registered_widgets;
     
    214216 *
    215217 * @since unknown
    216218 *
    217  * @param unknown_type $sidebar_args
    218  * @return unknown
     219 * @param array $sidebar_args
     220 * @return array
    219221 */
    220222function wp_widget_control( $sidebar_args ) {
    221223        global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget;
     
    313315 *
    314316 * @since unknown
    315317 *
    316  * @param unknown_type $string
    317  * @return unknown
     318 * @param string $string
     319 * @return string
    318320 */
    319321function wp_widget_control_ob_filter( $string ) {
    320322        if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) )