Ticket #7527: wp-admin-includes.phpdoc.r8976.diff
File wp-admin-includes.phpdoc.r8976.diff, 28.3 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/bookmark.php
1 1 <?php 2 /** 3 * WordPress Bookmark Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 9 /** 10 * {@internal Missing Short Description}} 11 * 12 * @since unknown 13 * 14 * @return unknown 15 */ 3 16 function add_link() { 4 17 return edit_link(); 5 18 } 6 19 20 /** 21 * {@internal Missing Short Description}} 22 * 23 * @since unknown 24 * 25 * @param unknown_type $link_id 26 * @return unknown 27 */ 7 28 function edit_link( $link_id = '' ) { 8 29 if (!current_user_can( 'manage_links' )) 9 30 wp_die( __( 'Cheatin’ uh?' )); … … 24 45 } 25 46 } 26 47 48 /** 49 * {@internal Missing Short Description}} 50 * 51 * @since unknown 52 * 53 * @return unknown 54 */ 27 55 function get_default_link_to_edit() { 28 56 if ( isset( $_GET['linkurl'] ) ) 29 57 $link->link_url = clean_url( $_GET['linkurl']); … … 40 68 return $link; 41 69 } 42 70 71 /** 72 * {@internal Missing Short Description}} 73 * 74 * @since unknown 75 * 76 * @param unknown_type $link_id 77 * @return unknown 78 */ 43 79 function wp_delete_link($link_id) { 44 80 global $wpdb; 45 81 … … 56 92 return true; 57 93 } 58 94 95 /** 96 * {@internal Missing Short Description}} 97 * 98 * @since unknown 99 * 100 * @param unknown_type $link_id 101 * @return unknown 102 */ 59 103 function wp_get_link_cats($link_id = 0) { 60 104 61 105 $cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids'); … … 63 107 return array_unique($cats); 64 108 } 65 109 110 /** 111 * {@internal Missing Short Description}} 112 * 113 * @since unknown 114 * 115 * @param unknown_type $link_id 116 * @return unknown 117 */ 66 118 function get_link_to_edit( $link_id ) { 67 119 return get_bookmark( $link_id, OBJECT, 'edit' ); 68 120 } 69 121 122 /** 123 * {@internal Missing Short Description}} 124 * 125 * @since unknown 126 * 127 * @param unknown_type $linkdata 128 * @return unknown 129 */ 70 130 function wp_insert_link($linkdata, $wp_error = false) { 71 131 global $wpdb, $current_user; 72 132 … … 154 214 return $link_id; 155 215 } 156 216 217 /** 218 * {@internal Missing Short Description}} 219 * 220 * @since unknown 221 * 222 * @param unknown_type $link_id 223 * @param unknown_type $link_categories 224 */ 157 225 function wp_set_link_cats($link_id = 0, $link_categories = array()) { 158 226 // If $link_categories isn't already an array, make it one: 159 227 if (!is_array($link_categories) || 0 == count($link_categories)) … … 167 235 clean_bookmark_cache($link_id); 168 236 } // wp_set_link_cats() 169 237 238 /** 239 * {@internal Missing Short Description}} 240 * 241 * @since unknown 242 * 243 * @param unknown_type $linkdata 244 * @return unknown 245 */ 170 246 function wp_update_link($linkdata) { 171 247 $link_id = (int) $linkdata['link_id']; 172 248 … … 189 265 return wp_insert_link($linkdata); 190 266 } 191 267 192 ?> 193 No newline at end of file 268 ?> -
wp-admin/includes/image.php
221 221 } 222 222 223 223 /** 224 * Get extended image metadata, exif or iptc as available 224 * Get extended image metadata, exif or iptc as available. 225 225 * 226 226 * @since unknown 227 227 * -
wp-admin/includes/theme.php
1 1 <?php 2 /** 3 * WordPress Theme Administration API 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 9 /** 10 * {@internal Missing Short Description}} 11 * 12 * @since unknown 13 * 14 * @return unknown 15 */ 3 16 function current_theme_info() { 4 17 $themes = get_themes(); 5 18 $current_theme = get_current_theme(); … … 18 31 return $ct; 19 32 } 20 33 34 /** 35 * {@internal Missing Short Description}} 36 * 37 * @since unknown 38 * 39 * @return unknown 40 */ 21 41 function get_broken_themes() { 22 42 global $wp_broken_themes; 23 43 … … 25 45 return $wp_broken_themes; 26 46 } 27 47 48 /** 49 * {@internal Missing Short Description}} 50 * 51 * @since unknown 52 * 53 * @return unknown 54 */ 28 55 function get_page_templates() { 29 56 $themes = get_themes(); 30 57 $theme = get_current_theme(); -
wp-admin/includes/update-core.php
4 4 * 5 5 * @package WordPress 6 6 * @subpackage Administration 7 * @since 2.7 7 * @since 2.7.0 8 8 */ 9 9 10 10 /** 11 11 * Stores files to be deleted. 12 12 * 13 * @since 2.7 13 * @since 2.7.0 14 14 * @global array $_old_files 15 15 * @var array 16 16 * @name $_old_files … … 166 166 * themes, then if you edit the default theme, you should rename it, so that 167 167 * your changes remain. 168 168 * 169 * @since 2.7.0 170 * 169 171 * @param string $from New release unzipped path. 170 172 * @param string $to Path to old WordPress installation. 171 173 * @return WP_Error|null WP_Error on failure, null on success. -
wp-admin/includes/upgrade.php
1 1 <?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 */ 2 10 11 /** Include user install customize script. */ 3 12 if ( file_exists(WP_CONTENT_DIR . '/install.php') ) 4 13 require (WP_CONTENT_DIR . '/install.php'); 14 15 /** WordPress Administration API */ 5 16 require_once(ABSPATH . 'wp-admin/includes/admin.php'); 17 18 /** WordPress Schema API */ 6 19 require_once(ABSPATH . 'wp-admin/includes/schema.php'); 7 20 8 21 if ( !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 */ 9 36 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') { 10 37 global $wp_rewrite; 11 38 … … 53 80 endif; 54 81 55 82 if ( !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 */ 56 92 function wp_install_defaults($user_id) { 57 93 global $wpdb; 58 94 … … 107 143 endif; 108 144 109 145 if ( !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 */ 110 158 function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) { 111 159 $user = new WP_User($user_id); 112 160 $email = $user->user_email; … … 132 180 endif; 133 181 134 182 if ( !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 */ 135 192 function wp_upgrade() { 136 193 global $wp_current_db_version, $wp_db_version; 137 194 … … 141 198 if ( $wp_db_version == $wp_current_db_version ) 142 199 return; 143 200 144 if( !is_blog_installed())201 if( ! is_blog_installed() ) 145 202 return; 146 203 147 204 wp_check_mysql_version(); … … 152 209 } 153 210 endif; 154 211 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 */ 156 219 function upgrade_all() { 157 220 global $wp_current_db_version, $wp_db_version, $wp_rewrite; 158 221 $wp_current_db_version = __get_option('db_version'); … … 220 283 update_option('db_version', $wp_db_version); 221 284 } 222 285 286 /** 287 * Execute changes made in WordPress 1.0. 288 * 289 * @since 1.0.0 290 */ 223 291 function upgrade_100() { 224 292 global $wpdb; 225 293 … … 242 310 } 243 311 } 244 312 245 246 313 $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/') 247 314 WHERE option_name LIKE 'links_rating_image%' 248 315 AND option_value LIKE 'wp-links/links-images/%'"); … … 272 339 endif; 273 340 } 274 341 342 /** 343 * Execute changes made in WordPress 1.0.1. 344 * 345 * @since 1.0.1 346 */ 275 347 function upgrade_101() { 276 348 global $wpdb; 277 349 … … 285 357 add_clean_index($wpdb->links , 'link_visible'); 286 358 } 287 359 288 360 /** 361 * Execute changes made in WordPress 1.2. 362 * 363 * @since 1.2.0 364 */ 289 365 function upgrade_110() { 290 366 global $wpdb; 291 367 … … 305 381 } 306 382 } 307 383 308 309 384 // Get the GMT offset, we'll use that later on 310 385 $all_options = get_alloptions_110(); 311 386 … … 342 417 343 418 } 344 419 420 /** 421 * Execute changes made in WordPress 1.5. 422 * 423 * @since 1.5.0 424 */ 345 425 function upgrade_130() { 346 426 global $wpdb; 347 427 … … 419 499 make_site_theme(); 420 500 } 421 501 502 /** 503 * Execute changes made in WordPress 2.0. 504 * 505 * @since 2.0.0 506 */ 422 507 function upgrade_160() { 423 508 global $wpdb, $wp_current_db_version; 424 509 … … 497 582 } 498 583 } 499 584 585 /** 586 * Execute changes made in WordPress 2.1. 587 * 588 * @since 2.1.0 589 */ 500 590 function upgrade_210() { 501 591 global $wpdb, $wp_current_db_version; 502 592 … … 536 626 } 537 627 } 538 628 629 /** 630 * Execute changes made in WordPress 2.3. 631 * 632 * @since 2.3.0 633 */ 539 634 function upgrade_230() { 540 635 global $wp_current_db_version, $wpdb; 541 636 … … 706 801 } 707 802 } 708 803 804 /** 805 * Remove old options from the database. 806 * 807 * @since 2.3.0 808 */ 709 809 function upgrade_230_options_table() { 710 810 global $wpdb; 711 811 $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' ); … … 715 815 $wpdb->show_errors(); 716 816 } 717 817 818 /** 819 * Remove old categories, link2cat, and post2cat database tables. 820 * 821 * @since 2.3.0 822 */ 718 823 function upgrade_230_old_tables() { 719 824 global $wpdb; 720 825 $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories'); … … 722 827 $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat'); 723 828 } 724 829 830 /** 831 * Upgrade old slugs made in version 2.2. 832 * 833 * @since 2.2.0 834 */ 725 835 function upgrade_old_slugs() { 726 836 // upgrade people who were using the Redirect Old Slugs plugin 727 837 global $wpdb; 728 838 $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'"); 729 839 } 730 840 731 841 /** 842 * Execute changes made in WordPress 2.5.0. 843 * 844 * @since 2.5.0 845 */ 732 846 function upgrade_250() { 733 847 global $wp_current_db_version; 734 848 … … 738 852 739 853 } 740 854 855 /** 856 * Execute changes made in WordPress 2.5.1. 857 * 858 * @since 2.5.1 859 */ 741 860 function upgrade_251() { 742 861 global $wp_current_db_version; 743 862 … … 745 864 update_option('secret', wp_generate_password(64)); 746 865 } 747 866 867 /** 868 * Execute changes made in WordPress 2.5.2. 869 * 870 * @since 2.5.2 871 */ 748 872 function upgrade_252() { 749 873 global $wpdb; 750 874 751 875 $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); 752 876 } 753 877 878 /** 879 * Execute changes made in WordPress 2.6. 880 * 881 * @since 2.6.0 882 */ 754 883 function upgrade_260() { 755 884 global $wp_current_db_version; 756 885 … … 763 892 } 764 893 } 765 894 895 /** 896 * Execute changes made in WordPress 2.7. 897 * 898 * @since 2.7.0 899 */ 766 900 function upgrade_270() { 767 901 global $wpdb, $wp_current_db_version; 768 902 … … 778 912 // The functions we use to actually do stuff 779 913 780 914 // 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 */ 781 927 function maybe_create_table($table_name, $create_ddl) { 782 928 global $wpdb; 783 929 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { … … 796 942 return false; 797 943 } 798 944 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 */ 799 956 function drop_index($table, $index) { 800 957 global $wpdb; 801 958 $wpdb->hide_errors(); … … 808 965 return true; 809 966 } 810 967 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 */ 811 979 function add_clean_index($table, $index) { 812 980 global $wpdb; 813 981 drop_index($table, $index); … … 840 1008 return false; 841 1009 } 842 1010 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 */ 845 1018 function get_alloptions_110() { 846 1019 global $wpdb; 847 1020 if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) { … … 857 1030 return $all_options; 858 1031 } 859 1032 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 */ 861 1042 function __get_option($setting) { 862 1043 global $wpdb; 863 1044 … … 884 1065 return $option; 885 1066 } 886 1067 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 */ 887 1078 function deslash($content) { 888 1079 // Note: \\\ inside a regex denotes a single backslash. 889 1080 … … 901 1092 return $content; 902 1093 } 903 1094 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 */ 904 1106 function dbDelta($queries, $execute = true) { 905 1107 global $wpdb; 906 1108 … … 1102 1304 return $for_update; 1103 1305 } 1104 1306 1307 /** 1308 * {@internal Missing Short Description}} 1309 * 1310 * {@internal Missing Long Description}} 1311 * 1312 * @since unknown 1313 */ 1105 1314 function make_db_current() { 1106 1315 global $wp_queries; 1107 1316 … … 1111 1320 echo "</ol>\n"; 1112 1321 } 1113 1322 1323 /** 1324 * {@internal Missing Short Description}} 1325 * 1326 * {@internal Missing Long Description}} 1327 * 1328 * @since unknown 1329 */ 1114 1330 function make_db_current_silent() { 1115 1331 global $wp_queries; 1116 1332 1117 1333 $alterations = dbDelta($wp_queries); 1118 1334 } 1119 1335 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 */ 1120 1347 function make_site_theme_from_oldschool($theme_name, $template) { 1121 1348 $home_path = get_home_path(); 1122 1349 $site_dir = WP_CONTENT_DIR . "/themes/$template"; … … 1185 1412 return true; 1186 1413 } 1187 1414 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 */ 1188 1426 function make_site_theme_from_default($theme_name, $template) { 1189 1427 $site_dir = WP_CONTENT_DIR . "/themes/$template"; 1190 1428 $default_dir = WP_CONTENT_DIR . '/themes/default'; … … 1240 1478 } 1241 1479 1242 1480 // 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 */ 1243 1490 function make_site_theme() { 1244 1491 // Name the theme after the blog. 1245 1492 $theme_name = __get_option('blogname'); … … 1281 1528 return $template; 1282 1529 } 1283 1530 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 */ 1284 1539 function translate_level_to_role($level) { 1285 1540 switch ($level) { 1286 1541 case 10: … … 1302 1557 } 1303 1558 } 1304 1559 1560 /** 1561 * {@internal Missing Short Description}} 1562 * 1563 * {@internal Missing Long Description}} 1564 * 1565 * @since unknown 1566 */ 1305 1567 function wp_check_mysql_version() { 1306 1568 global $wpdb; 1307 1569 $result = $wpdb->check_database_version(); … … 1309 1571 die( $result->get_error_message() ); 1310 1572 } 1311 1573 1574 /** 1575 * {@internal Missing Short Description}} 1576 * 1577 * {@internal Missing Long Description}} 1578 * 1579 * @since unknown 1580 */ 1312 1581 function maybe_disable_automattic_widgets() { 1313 1582 $plugins = __get_option( 'active_plugins' ); 1314 1583 -
wp-admin/includes/user.php
1 1 <?php 2 /** 3 * WordPress user administration API. 4 * 5 * @package WordPress 6 * @subpackage Administration 7 */ 2 8 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 */ 4 19 function add_user() { 5 20 if ( func_num_args() ) { // The hackiest hack that ever did hack 6 21 global $current_user, $wp_roles; … … 18 33 } 19 34 } 20 35 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 */ 21 46 function edit_user( $user_id = 0 ) { 22 47 global $current_user, $wp_roles, $wpdb; 23 48 if ( $user_id != 0 ) { … … 142 167 return $user_id; 143 168 } 144 169 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 */ 145 179 function get_author_user_ids() { 146 180 global $wpdb; 147 181 $level_key = $wpdb->prefix . 'user_level'; 148 182 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) ); 149 183 } 150 184 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 */ 151 195 function get_editable_authors( $user_id ) { 152 196 global $wpdb; 153 197 … … 163 207 return apply_filters('get_editable_authors', $authors); 164 208 } 165 209 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 */ 166 221 function get_editable_user_ids( $user_id, $exclude_zeros = true ) { 167 222 global $wpdb; 168 223 … … 184 239 return $wpdb->get_col( $query ); 185 240 } 186 241 242 /** 243 * {@internal Missing Short Description}} 244 * 245 * {@internal Missing Long Description}} 246 * 247 * @since unknown 248 * 249 * @return unknown 250 */ 187 251 function get_nonauthor_user_ids() { 188 252 global $wpdb; 189 253 $level_key = $wpdb->prefix . 'user_level'; … … 191 255 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) ); 192 256 } 193 257 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 */ 194 267 function get_others_unpublished_posts($user_id, $type='any') { 195 268 global $wpdb; 196 269 … … 213 286 return apply_filters('get_others_drafts', $other_unpubs); 214 287 } 215 288 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 */ 216 297 function get_others_drafts($user_id) { 217 298 return get_others_unpublished_posts($user_id, 'draft'); 218 299 } 219 300 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 */ 220 309 function get_others_pending($user_id) { 221 310 return get_others_unpublished_posts($user_id, 'pending'); 222 311 } 223 312 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 */ 224 321 function get_user_to_edit( $user_id ) { 225 322 $user = new WP_User( $user_id ); 226 323 $user->user_login = attribute_escape($user->user_login); … … 238 335 return $user; 239 336 } 240 337 338 /** 339 * Retrieve the user's drafts. 340 * 341 * @since unknown 342 * 343 * @param int $user_id User ID. 344 * @return array 345 */ 241 346 function get_users_drafts( $user_id ) { 242 347 global $wpdb; 243 348 $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); … … 245 350 return $wpdb->get_results( $query ); 246 351 } 247 352 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 */ 248 367 function wp_delete_user($id, $reassign = 'novalue') { 249 368 global $wpdb; 250 369 … … 279 398 return true; 280 399 } 281 400 401 /** 402 * Remove all capabilities from user. 403 * 404 * @since unknown 405 * 406 * @param int $id User ID. 407 */ 282 408 function wp_revoke_user($id) { 283 409 $id = (int) $id; 284 410 … … 286 412 $user->remove_all_caps(); 287 413 } 288 414 289 // WP_User_Search class290 // by Mark Jaquith291 292 415 if ( !class_exists('WP_User_Search') ) : 416 /** 417 * WordPress User Search class. 418 * 419 * @since unknown 420 * @author Mark Jaquith 421 */ 293 422 class WP_User_Search { 423 424 /** 425 * {@internal Missing Description}} 426 * 427 * @since unknown 428 * @access private 429 * @var unknown_type 430 */ 294 431 var $results; 432 433 /** 434 * {@internal Missing Description}} 435 * 436 * @since unknown 437 * @access private 438 * @var unknown_type 439 */ 295 440 var $search_term; 441 442 /** 443 * Page number. 444 * 445 * @since unknown 446 * @access private 447 * @var int 448 */ 296 449 var $page; 450 451 /** 452 * Role name that users have. 453 * 454 * @since unknown 455 * @access private 456 * @var string 457 */ 297 458 var $role; 459 460 /** 461 * Raw page number. 462 * 463 * @since unknown 464 * @access private 465 * @var int|bool 466 */ 298 467 var $raw_page; 468 469 /** 470 * Amount of users to display per page. 471 * 472 * @since unknown 473 * @access public 474 * @var int 475 */ 299 476 var $users_per_page = 50; 477 478 /** 479 * {@internal Missing Description}} 480 * 481 * @since unknown 482 * @access private 483 * @var unknown_type 484 */ 300 485 var $first_user; 486 487 /** 488 * {@internal Missing Description}} 489 * 490 * @since unknown 491 * @access private 492 * @var int 493 */ 301 494 var $last_user; 495 496 /** 497 * {@internal Missing Description}} 498 * 499 * @since unknown 500 * @access private 501 * @var unknown_type 502 */ 302 503 var $query_limit; 504 505 /** 506 * {@internal Missing Description}} 507 * 508 * @since unknown 509 * @access private 510 * @var unknown_type 511 */ 303 512 var $query_sort; 513 514 /** 515 * {@internal Missing Description}} 516 * 517 * @since unknown 518 * @access private 519 * @var unknown_type 520 */ 304 521 var $query_from_where; 522 523 /** 524 * {@internal Missing Description}} 525 * 526 * @since unknown 527 * @access private 528 * @var int 529 */ 305 530 var $total_users_for_query = 0; 531 532 /** 533 * {@internal Missing Description}} 534 * 535 * @since unknown 536 * @access private 537 * @var bool 538 */ 306 539 var $too_many_total_users = false; 540 541 /** 542 * {@internal Missing Description}} 543 * 544 * @since unknown 545 * @access private 546 * @var unknown_type 547 */ 307 548 var $search_errors; 549 550 /** 551 * {@internal Missing Description}} 552 * 553 * @since unknown 554 * @access private 555 * @var unknown_type 556 */ 308 557 var $paging_text; 309 558 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 = '') { 311 570 $this->search_term = $search_term; 312 571 $this->raw_page = ( '' == $page ) ? false : (int) $page; 313 572 $this->page = (int) ( '' == $page ) ? 1 : $page; … … 319 578 $this->do_paging(); 320 579 } 321 580 581 /** 582 * {@internal Missing Short Description}} 583 * 584 * {@internal Missing Long Description}} 585 * 586 * @since unknown 587 * @access public 588 */ 322 589 function prepare_query() { 323 590 global $wpdb; 324 591 $this->first_user = ($this->page - 1) * $this->users_per_page; … … 343 610 344 611 } 345 612 613 /** 614 * {@internal Missing Short Description}} 615 * 616 * {@internal Missing Long Description}} 617 * 618 * @since unknown 619 * @access public 620 */ 346 621 function query() { 347 622 global $wpdb; 348 623 $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit); … … 353 628 $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); 354 629 } 355 630 631 /** 632 * {@internal Missing Short Description}} 633 * 634 * {@internal Missing Long Description}} 635 * 636 * @since unknown 637 * @access public 638 */ 356 639 function prepare_vars_for_template_usage() { 357 640 $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone 358 641 } 359 642 643 /** 644 * {@internal Missing Short Description}} 645 * 646 * {@internal Missing Long Description}} 647 * 648 * @since unknown 649 * @access public 650 */ 360 651 function do_paging() { 361 652 if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results 362 653 $args = array(); … … 375 666 } 376 667 } 377 668 669 /** 670 * {@internal Missing Short Description}} 671 * 672 * {@internal Missing Long Description}} 673 * 674 * @since unknown 675 * @access public 676 * 677 * @return unknown 678 */ 378 679 function get_results() { 379 680 return (array) $this->results; 380 681 } 381 682 683 /** 684 * Displaying paging text. 685 * 686 * @see do_paging() Builds paging text. 687 * 688 * @since unknown 689 * @access public 690 */ 382 691 function page_links() { 383 692 echo $this->paging_text; 384 693 } 385 694 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 */ 386 705 function results_are_paged() { 387 706 if ( $this->paging_text ) 388 707 return true; 389 708 return false; 390 709 } 391 710 711 /** 712 * Whether there are search terms. 713 * 714 * @since unknown 715 * @access public 716 * 717 * @return bool 718 */ 392 719 function is_search() { 393 720 if ( $this->search_term ) 394 721 return true; -
wp-admin/includes/widgets.php
9 9 /** 10 10 * Display list of widgets, either all or matching search. 11 11 * 12 * The search parameter are search terms separated by spaces. 13 * 12 14 * @since unknown 13 15 * 14 * @param unknown_type $show15 * @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. 16 18 */ 17 19 function wp_list_widgets( $show = 'all', $_search = false ) { 18 20 global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls; … … 168 170 * 169 171 * @since unknown 170 172 * 171 * @param unknown_type$sidebar173 * @param string $sidebar 172 174 */ 173 175 function wp_list_widget_controls( $sidebar ) { 174 176 add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' ); … … 188 190 * 189 191 * @since unknown 190 192 * 191 * @param unknown_type$params192 * @return unknown193 * @param array $params 194 * @return array 193 195 */ 194 196 function wp_list_widget_controls_dynamic_sidebar( $params ) { 195 197 global $wp_registered_widgets; … … 216 218 * 217 219 * @since unknown 218 220 * 219 * @param unknown_type$sidebar_args220 * @return unknown221 * @param array $sidebar_args 222 * @return array 221 223 */ 222 224 function wp_widget_control( $sidebar_args ) { 223 225 global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget; … … 322 324 * 323 325 * @since unknown 324 326 * 325 * @param unknown_type$string326 * @return unknown327 * @param string $string 328 * @return string 327 329 */ 328 330 function wp_widget_control_ob_filter( $string ) { 329 331 if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) )