From f885a9f93a4dcce6c1c3dd4114adaa4616a1f5d3 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 2 Oct 2008 01:03:26 +0000 Subject: [PATCH] phpdoc for wp-admin/includes from jacobsantos. see #7527 git-svn-id: https://develop.svn.wordpress.org/trunk@9053 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/bookmark.php | 78 ++++- wp-admin/includes/file.php | 162 ++++++++-- wp-admin/includes/image.php | 2 +- wp-admin/includes/import.php | 38 +++ wp-admin/includes/media.php | 344 +++++++++++++++++++- wp-admin/includes/misc.php | 151 ++++++++- wp-admin/includes/post.php | 243 ++++++++++++-- wp-admin/includes/schema.php | 55 +++- wp-admin/includes/taxonomy.php | 89 ++++++ wp-admin/includes/template.php | 506 ++++++++++++++++++++++++++++-- wp-admin/includes/theme.php | 27 ++ wp-admin/includes/update-core.php | 6 +- wp-admin/includes/upgrade.php | 287 ++++++++++++++++- wp-admin/includes/user.php | 337 +++++++++++++++++++- wp-admin/includes/widgets.php | 20 +- 15 files changed, 2236 insertions(+), 109 deletions(-) diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index 4201d355a3..dc61f20c38 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -1,9 +1,30 @@ link_url = clean_url( $_GET['linkurl']); @@ -40,6 +68,14 @@ function get_default_link_to_edit() { return $link; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $link_id + * @return unknown + */ function wp_delete_link($link_id) { global $wpdb; @@ -56,6 +92,14 @@ function wp_delete_link($link_id) { return true; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $link_id + * @return unknown + */ function wp_get_link_cats($link_id = 0) { $cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids'); @@ -63,10 +107,26 @@ function wp_get_link_cats($link_id = 0) { return array_unique($cats); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $link_id + * @return unknown + */ function get_link_to_edit( $link_id ) { return get_bookmark( $link_id, OBJECT, 'edit' ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $linkdata + * @return unknown + */ function wp_insert_link($linkdata, $wp_error = false) { global $wpdb, $current_user; @@ -154,6 +214,14 @@ function wp_insert_link($linkdata, $wp_error = false) { return $link_id; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $link_id + * @param unknown_type $link_categories + */ function wp_set_link_cats($link_id = 0, $link_categories = array()) { // If $link_categories isn't already an array, make it one: if (!is_array($link_categories) || 0 == count($link_categories)) @@ -167,6 +235,14 @@ function wp_set_link_cats($link_id = 0, $link_categories = array()) { clean_bookmark_cache($link_id); } // wp_set_link_cats() +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $linkdata + * @return unknown + */ function wp_update_link($linkdata) { $link_id = (int) $linkdata['link_id']; @@ -189,4 +265,4 @@ function wp_update_link($linkdata) { return wp_insert_link($linkdata); } -?> \ No newline at end of file +?> diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 9890b21668..1852713789 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -1,13 +1,20 @@ __( 'Main Index Template' ), 'style.css' => __( 'Stylesheet' ), - 'rtl.css' => __( 'RTL Stylesheet' ), - 'comments.php' => __( 'Comments' ), - 'comments-popup.php' => __( 'Popup Comments' ), - 'footer.php' => __( 'Footer' ), - 'header.php' => __( 'Header' ), + 'rtl.css' => __( 'RTL Stylesheet' ), + 'comments.php' => __( 'Comments' ), + 'comments-popup.php' => __( 'Popup Comments' ), + 'footer.php' => __( 'Footer' ), + 'header.php' => __( 'Header' ), 'sidebar.php' => __( 'Sidebar' ), 'archive.php' => __( 'Archives' ), 'category.php' => __( 'Category Template' ), @@ -27,6 +34,15 @@ $wp_file_descriptions = array ( '.htaccess' => __( '.htaccess (for rewrite rules )' ), // Deprecated files 'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' )); + +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $file + * @return unknown + */ function get_file_description( $file ) { global $wp_file_descriptions; @@ -42,6 +58,13 @@ function get_file_description( $file ) { return basename( $file ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function get_home_path() { $home = get_option( 'home' ); if ( $home != '' && $home != get_option( 'siteurl' ) ) { @@ -56,6 +79,14 @@ function get_home_path() { return $home_path; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $file + * @return unknown + */ function get_real_file_to_edit( $file ) { if ('index.php' == $file || '.htaccess' == $file ) { $real_file = get_home_path() . $file; @@ -65,8 +96,16 @@ function get_real_file_to_edit( $file ) { return $real_file; } -//$folder = Full path to folder -//$levels = Levels of folders to follow, Default: 100 (PHP Loop limit) + +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param string $folder Optional. Full path to folder + * @param int $levels Optional. Levels of folders to follow, Default: 100 (PHP Loop limit). + * @return bool|array + */ function list_files( $folder = '', $levels = 100 ) { if( empty($folder) ) return false; @@ -94,6 +133,13 @@ function list_files( $folder = '', $levels = 100 ) { return $files; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function get_temp_dir() { if ( defined('WP_TEMP_DIR') ) return trailingslashit(WP_TEMP_DIR); @@ -108,6 +154,15 @@ function get_temp_dir() { return '/tmp/'; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $filename + * @param unknown_type $dir + * @return unknown + */ function wp_tempnam($filename = '', $dir = ''){ if ( empty($dir) ) $dir = get_temp_dir(); @@ -120,6 +175,15 @@ function wp_tempnam($filename = '', $dir = ''){ return $filename; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $file + * @param unknown_type $allowed_files + * @return unknown + */ function validate_file_to_edit( $file, $allowed_files = '' ) { $file = stripslashes( $file ); @@ -140,11 +204,15 @@ function validate_file_to_edit( $file, $allowed_files = '' ) { } } -// array wp_handle_upload ( array &file [, array overrides] ) -// file: reference to a single element of $_FILES. Call the function once for each uploaded file. -// overrides: an associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). -// On success, returns an associative array of file attributes. -// On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param array $file Reference to a single element of $_FILES. Call the function once for each uploaded file. + * @param array $overrides Optional. An associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ). + * @return array On success, returns an associative array of file attributes. On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ). + */ function wp_handle_upload( &$file, $overrides = false ) { // The default error handler. if (! function_exists( 'wp_handle_upload_error' ) ) { @@ -236,7 +304,18 @@ function wp_handle_upload( &$file, $overrides = false ) { return $return; } -// Pass this function an array similar to that of a $_FILES POST array. + +/** + * {@internal Missing Short Description}} + * + * Pass this function an array similar to that of a $_FILES POST array. + * + * @since unknown + * + * @param unknown_type $file + * @param unknown_type $overrides + * @return unknown + */ function wp_handle_sideload( &$file, $overrides = false ) { // The default error handler. if (! function_exists( 'wp_handle_upload_error' ) ) { @@ -334,11 +413,14 @@ function wp_handle_sideload( &$file, $overrides = false ) { } /** -* Downloads a url to a local file using the Snoopy HTTP Class -* -* @param string $url the URL of the file to download -* @return mixed WP_Error on failure, string Filename on success. -*/ + * Downloads a url to a local file using the Snoopy HTTP Class. + * + * @since unknown + * @todo Transition over to using the new HTTP Request API (jacob). + * + * @param string $url the URL of the file to download + * @return mixed WP_Error on failure, string Filename on success. + */ function download_url( $url ) { //WARNING: The file is not automatically deleted, The script must unlink() the file. if( ! $url ) @@ -367,6 +449,15 @@ function download_url( $url ) { return $tmpfname; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $file + * @param unknown_type $to + * @return unknown + */ function unzip_file($file, $to) { global $wp_filesystem; @@ -427,6 +518,15 @@ function unzip_file($file, $to) { return true; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $from + * @param unknown_type $to + * @return unknown + */ function copy_dir($from, $to) { global $wp_filesystem; @@ -452,6 +552,14 @@ function copy_dir($from, $to) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $args + * @return unknown + */ function WP_Filesystem( $args = false ) { global $wp_filesystem; @@ -480,6 +588,14 @@ function WP_Filesystem( $args = false ) { return true; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $args + * @return unknown + */ function get_filesystem_method($args = array()) { $method = false; if( function_exists('getmyuid') && function_exists('fileowner') ){ @@ -495,6 +611,16 @@ function get_filesystem_method($args = array()) { return apply_filters('filesystem_method', $method); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $form_post + * @param unknown_type $type + * @param unknown_type $error + * @return unknown + */ function request_filesystem_credentials($form_post, $type = '', $error = false) { $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error); if ( '' !== $req_cred ) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 719729e294..2aedd43e57 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -221,7 +221,7 @@ function wp_exif_date2ts($str) { } /** - * Get extended image metadata, exif or iptc as available + * Get extended image metadata, exif or iptc as available. * * @since unknown * diff --git a/wp-admin/includes/import.php b/wp-admin/includes/import.php index 35fd141b17..ef5effa0b6 100644 --- a/wp-admin/includes/import.php +++ b/wp-admin/includes/import.php @@ -1,5 +1,18 @@ false, 'test_type' => false ); $_FILES['import']['name'] .= '.import'; diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 8c8a79c62c..0a97567c78 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1,5 +1,18 @@ __('Choose File'), // handler action suffix => tab text @@ -10,6 +23,14 @@ function media_upload_tabs() { return apply_filters('media_upload_tabs', $_default_tabs); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $tabs + * @return unknown + */ function update_gallery_tab($tabs) { global $wpdb; if ( !isset($_REQUEST['post_id']) ) { @@ -25,6 +46,11 @@ function update_gallery_tab($tabs) { } add_filter('media_upload_tabs', 'update_gallery_tab'); +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ function the_media_upload_tabs() { global $redir_tab; $tabs = media_upload_tabs(); @@ -51,6 +77,20 @@ function the_media_upload_tabs() { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $id + * @param unknown_type $alt + * @param unknown_type $title + * @param unknown_type $align + * @param unknown_type $url + * @param unknown_type $rel + * @param unknown_type $size + * @return unknown + */ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') { $html = get_image_tag($id, $alt, $title, $align, $size); @@ -65,6 +105,20 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal return $html; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $html + * @param unknown_type $id + * @param unknown_type $alt + * @param unknown_type $title + * @param unknown_type $align + * @param unknown_type $url + * @param unknown_type $size + * @return unknown + */ function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html; @@ -84,8 +138,15 @@ function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { } add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 ); +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $html + */ function media_send_to_editor($html) { - ?> +?> \n"; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $form_fields + * @param unknown_type $post + * @return unknown + */ function image_attachment_fields_to_edit($form_fields, $post) { if ( substr($post->post_mime_type, 0, 5) == 'image' ) { $form_fields['post_title']['required'] = true; @@ -624,11 +814,29 @@ function image_attachment_fields_to_edit($form_fields, $post) { add_filter('attachment_fields_to_edit', 'image_attachment_fields_to_edit', 10, 2); +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $form_fields + * @param unknown_type $post + * @return unknown + */ function media_single_attachment_fields_to_edit( $form_fields, $post ) { unset($form_fields['url'], $form_fields['align'], $form_fields['image-size']); return $form_fields; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post + * @param unknown_type $attachment + * @return unknown + */ function image_attachment_fields_to_save($post, $attachment) { if ( substr($post['post_mime_type'], 0, 5) == 'image' ) { if ( strlen(trim($post['post_title'])) == 0 ) { @@ -642,6 +850,16 @@ function image_attachment_fields_to_save($post, $attachment) { add_filter('attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2); +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $html + * @param unknown_type $attachment_id + * @param unknown_type $attachment + * @return unknown + */ function image_media_send_to_editor($html, $attachment_id, $attachment) { $post =& get_post($attachment_id); if ( substr($post->post_mime_type, 0, 5) == 'image' ) { @@ -667,6 +885,15 @@ function image_media_send_to_editor($html, $attachment_id, $attachment) { add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3); +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post + * @param unknown_type $errors + * @return unknown + */ function get_attachment_fields_to_edit($post, $errors = null) { if ( is_int($post) ) $post =& get_post($post); @@ -732,6 +959,15 @@ function get_attachment_fields_to_edit($post, $errors = null) { return $form_fields; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post_id + * @param unknown_type $errors + * @return unknown + */ function get_media_items( $post_id, $errors ) { if ( $post_id ) { $post = get_post($post_id); @@ -755,6 +991,15 @@ function get_media_items( $post_id, $errors ) { return $output; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $attachment_id + * @param unknown_type $args + * @return unknown + */ function get_media_item( $attachment_id, $args = null ) { global $redir_tab; @@ -919,6 +1164,11 @@ function get_media_item( $attachment_id, $args = null ) { return $item; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ function media_upload_header() { ?> @@ -928,6 +1178,13 @@ function media_upload_header() { @@ -1439,6 +1733,13 @@ function type_form_audio() { '; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function type_form_video() { return ' @@ -1467,6 +1768,13 @@ function type_form_video() { '; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function type_form_file() { return '
@@ -1496,6 +1804,14 @@ function type_form_file() { } // support a GET parameter for disabling the flash uploader +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $flash + * @return unknown + */ function media_upload_use_flash($flash) { if ( array_key_exists('flash', $_REQUEST) ) $flash = !empty($_REQUEST['flash']); @@ -1504,6 +1820,11 @@ function media_upload_use_flash($flash) { add_filter('flash_uploader', 'media_upload_use_flash'); +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ function media_upload_flash_bypass() { echo '

'; printf( __('You are using the Flash uploader. Problems? Try the Browser uploader instead.'), clean_url(add_query_arg('flash', 0)) ); @@ -1512,6 +1833,11 @@ function media_upload_flash_bypass() { add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ function media_upload_html_bypass() { echo '

'; if ( array_key_exists('flash', $_REQUEST) ) @@ -1528,6 +1854,14 @@ add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); add_action('post-html-upload-ui', 'media_upload_html_bypass'); // make sure the GET parameter sticks when we submit a form +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $url + * @return unknown + */ function media_upload_bypass_url($url) { if ( array_key_exists('flash', $_REQUEST) ) $url = add_query_arg('flash', intval($_REQUEST['flash'])); diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index ba7e8ff39f..f08103e950 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -1,12 +1,32 @@ get_error_data() ) @@ -171,14 +239,44 @@ function show_message($message) { } /* Whitelist functions */ + +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $option_group + * @param unknown_type $option_name + * @param unknown_type $sanitize_callback + * @return unknown + */ function register_setting($option_group, $option_name, $sanitize_callback = '') { return add_option_update_handler($option_group, $option_name, $sanitize_callback); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $option_group + * @param unknown_type $option_name + * @param unknown_type $sanitize_callback + * @return unknown + */ function unregister_setting($option_group, $option_name, $sanitize_callback = '') { return remove_option_update_handler($option_group, $option_name, $sanitize_callback); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $option_group + * @param unknown_type $option_name + * @param unknown_type $sanitize_callback + */ function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') { global $new_whitelist_options; $new_whitelist_options[ $option_group ][] = $option_name; @@ -186,6 +284,15 @@ function add_option_update_handler($option_group, $option_name, $sanitize_callba add_filter( "sanitize_option_{$option_name}", $sanitize_callback ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $option_group + * @param unknown_type $option_name + * @param unknown_type $sanitize_callback + */ function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') { global $new_whitelist_options; $pos = array_search( $option_name, $new_whitelist_options ); @@ -195,6 +302,14 @@ function remove_option_update_handler($option_group, $option_name, $sanitize_cal remove_filter( "sanitize_option_{$option_name}", $sanitize_callback ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $options + * @return unknown + */ function option_update_filter( $options ) { global $new_whitelist_options; @@ -205,6 +320,15 @@ function option_update_filter( $options ) { } add_filter( 'whitelist_options', 'option_update_filter' ); +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $new_options + * @param unknown_type $options + * @return unknown + */ function add_option_whitelist( $new_options, $options = '' ) { if( $options == '' ) { global $whitelist_options; @@ -221,6 +345,15 @@ function add_option_whitelist( $new_options, $options = '' ) { return $whitelist_options; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $del_options + * @param unknown_type $options + * @return unknown + */ function remove_option_whitelist( $del_options, $options = '' ) { if( $options == '' ) { global $whitelist_options; diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index c36c554f07..a6df0bfae8 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1,4 +1,10 @@ $updated, 'skipped' => $skipped, 'locked' => $locked ); } -// Default post information to use when populating the "Write Post" form. +/** + * Default post information to use when populating the "Write Post" form. + * + * @since unknown + * + * @return unknown + */ function get_default_post_to_edit() { if ( !empty( $_REQUEST['post_title'] ) ) $post_title = wp_specialchars( stripslashes( $_REQUEST['post_title'] )); @@ -306,13 +333,27 @@ function get_default_post_to_edit() { return $post; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function get_default_page_to_edit() { $page = get_default_post_to_edit(); $page->post_type = 'page'; return $page; } -// Get an existing post and format it for editing. +/** + * Get an existing post and format it for editing. + * + * @since unknown + * + * @param unknown_type $id + * @return unknown + */ function get_post_to_edit( $id ) { $post = get_post( $id, OBJECT, 'edit' ); @@ -323,6 +364,16 @@ function get_post_to_edit( $id ) { return $post; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $title + * @param unknown_type $content + * @param unknown_type $post_date + * @return unknown + */ function post_exists($title, $content = '', $post_date = '') { global $wpdb; @@ -338,7 +389,13 @@ function post_exists($title, $content = '', $post_date = '') { return 0; } -// Creates a new post from the "Write Post" form using $_POST information. +/** + * Creates a new post from the "Write Post" form using $_POST information. + * + * @since unknown + * + * @return unknown + */ function wp_write_post() { global $user_ID; @@ -405,6 +462,13 @@ function wp_write_post() { return $post_ID; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function write_post() { $result = wp_write_post(); if( is_wp_error( $result ) ) @@ -417,6 +481,14 @@ function write_post() { // Post Meta // +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post_ID + * @return unknown + */ function add_meta( $post_ID ) { global $wpdb; $post_ID = (int) $post_ID; @@ -451,6 +523,14 @@ function add_meta( $post_ID ) { return false; } // add_meta +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $mid + * @return unknown + */ function delete_meta( $mid ) { global $wpdb; $mid = (int) $mid; @@ -461,7 +541,13 @@ function delete_meta( $mid ) { return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) ); } -// Get a list of previously defined keys +/** + * Get a list of previously defined keys. + * + * @since unknown + * + * @return unknown + */ function get_meta_keys() { global $wpdb; @@ -474,6 +560,14 @@ function get_meta_keys() { return $keys; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $mid + * @return unknown + */ function get_post_meta_by_id( $mid ) { global $wpdb; $mid = (int) $mid; @@ -484,7 +578,16 @@ function get_post_meta_by_id( $mid ) { return $meta; } -// Some postmeta stuff +/** + * {@internal Missing Short Description}} + * + * Some postmeta stuff. + * + * @since unknown + * + * @param unknown_type $postid + * @return unknown + */ function has_meta( $postid ) { global $wpdb; @@ -494,6 +597,16 @@ function has_meta( $postid ) { } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $meta_id + * @param unknown_type $meta_key + * @param unknown_type $meta_value + * @return unknown + */ function update_meta( $meta_id, $meta_key, $meta_value ) { global $wpdb; @@ -518,7 +631,15 @@ function update_meta( $meta_id, $meta_key, $meta_value ) { // Private // -// Replace hrefs of attachment anchors with up-to-date permalinks. +/** + * Replace hrefs of attachment anchors with up-to-date permalinks. + * + * @since unknown + * @access private + * + * @param unknown_type $post_ID + * @return unknown + */ function _fix_attachment_links( $post_ID ) { $post = & get_post( $post_ID, ARRAY_A ); @@ -559,7 +680,16 @@ function _fix_attachment_links( $post_ID ) { return wp_update_post( $post); } -// Move child posts to a new parent +/** + * Move child posts to a new parent. + * + * @since unknown + * @access private + * + * @param unknown_type $old_ID + * @param unknown_type $new_ID + * @return unknown + */ function _relocate_children( $old_ID, $new_ID ) { global $wpdb; $old_ID = (int) $old_ID; @@ -567,12 +697,28 @@ function _relocate_children( $old_ID, $new_ID ) { return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_parent = %d", $new_ID, $old_ID) ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $type + * @return unknown + */ function get_available_post_statuses($type = 'post') { $stati = wp_count_posts($type); return array_keys(get_object_vars($stati)); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $q + * @return unknown + */ function wp_edit_posts_query( $q = false ) { global $wpdb; if ( false === $q ) @@ -613,6 +759,14 @@ function wp_edit_posts_query( $q = false ) { return array($post_stati, $avail_post_stati); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $type + * @return unknown + */ function get_available_post_mime_types($type = 'attachment') { global $wpdb; @@ -620,6 +774,14 @@ function get_available_post_mime_types($type = 'attachment') { return $types; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $q + * @return unknown + */ function wp_edit_attachments_query( $q = false ) { global $wpdb; if ( false === $q ) @@ -647,6 +809,15 @@ function wp_edit_attachments_query( $q = false ) { return array($post_mime_types, $avail_post_mime_types); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $id + * @param unknown_type $page + * @return unknown + */ function postbox_classes( $id, $page ) { $current_user = wp_get_current_user(); if ( $closed = get_usermeta( $current_user->ID, 'closedpostboxes_'.$page ) ) { @@ -658,6 +829,16 @@ function postbox_classes( $id, $page ) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $id + * @param unknown_type $title + * @param unknown_type $name + * @return unknown + */ function get_sample_permalink($id, $title=null, $name = null) { $post = &get_post($id); if (!$post->ID) { @@ -701,6 +882,16 @@ function get_sample_permalink($id, $title=null, $name = null) { return $permalink; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $id + * @param unknown_type $new_title + * @param unknown_type $new_slug + * @return unknown + */ function get_sample_permalink_html($id, $new_title=null, $new_slug=null) { $post = &get_post($id); list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); @@ -720,8 +911,14 @@ function get_sample_permalink_html($id, $new_title=null, $new_slug=null) { return $return; } -// false: not locked or locked by current user -// int: user ID of user with lock +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post_id + * @return bool|int False: not locked or locked by current user. Int: user ID of user with lock. + */ function wp_check_post_lock( $post_id ) { global $current_user; @@ -738,6 +935,14 @@ function wp_check_post_lock( $post_id ) { return false; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post_id + * @return unknown + */ function wp_set_post_lock( $post_id ) { global $current_user; if ( !$post = get_post( $post_id ) ) @@ -754,11 +959,11 @@ function wp_set_post_lock( $post_id ) { } /** - * wp_create_post_autosave() - creates autosave data for the specified post from $_POST data + * Creates autosave data for the specified post from $_POST data. * * @package WordPress - * @subpackage Post Revisions - * @since 2.6 + * @subpackage Post_Revisions + * @since 2.6.0 * * @uses _wp_translate_postdata() * @uses _wp_post_revision_fields() @@ -780,10 +985,10 @@ function wp_create_post_autosave( $post_id ) { } /** - * wp_teeny_mce() - adds a trimmed down version of the tinyMCE editor used on the Write -> Post screen. + * Adds a trimmed down version of the tinyMCE editor used on the Write -> Post screen. * * @package WordPress - * @since 2.6 + * @since 2.6.0 */ function wp_teeny_mce( $args = null ) { if ( !user_can_richedit() ) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index b62a4a5db5..1461dcd994 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -1,6 +1,14 @@ has_cap( 'collation' ) ) { $charset_collate .= " COLLATE $wpdb->collate"; } -$wp_queries="CREATE TABLE $wpdb->terms ( +/** Create WordPress database tables SQL */ +$wp_queries = "CREATE TABLE $wpdb->terms ( term_id bigint(20) NOT NULL auto_increment, name varchar(200) NOT NULL default '', slug varchar(200) NOT NULL default '', @@ -152,6 +161,13 @@ CREATE TABLE $wpdb->usermeta ( KEY meta_key (meta_key) ) $charset_collate;"; +/** + * Create WordPress options and set the default values. + * + * @since unknown + * @uses $wpdb + * @uses $wp_db_version + */ function populate_options() { global $wpdb, $wp_db_version; @@ -280,6 +296,11 @@ function populate_options() { endforeach; } +/** + * Execute WordPress role creation for the various WordPress versions. + * + * @since unknown (2.0.0) + */ function populate_roles() { populate_roles_160(); populate_roles_210(); @@ -289,6 +310,11 @@ function populate_roles() { populate_roles_270(); } +/** + * Create the roles for WordPress 2.0 + * + * @since 2.0.0 + */ function populate_roles_160() { // Add roles @@ -384,6 +410,11 @@ function populate_roles_160() { $role->add_cap('level_0'); } +/** + * Create and modify WordPress roles for WordPress 2.1. + * + * @since 2.1.0 + */ function populate_roles_210() { $roles = array('administrator', 'editor'); foreach ($roles as $role) { @@ -426,6 +457,11 @@ function populate_roles_210() { } } +/** + * Create and modify WordPress roles for WordPress 2.3. + * + * @since 2.3.0 + */ function populate_roles_230() { $role = get_role( 'administrator' ); @@ -434,6 +470,11 @@ function populate_roles_230() { } } +/** + * Create and modify WordPress roles for WordPress 2.5. + * + * @since 2.5.0 + */ function populate_roles_250() { $role = get_role( 'administrator' ); @@ -442,6 +483,11 @@ function populate_roles_250() { } } +/** + * Create and modify WordPress roles for WordPress 2.6. + * + * @since 2.6.0 + */ function populate_roles_260() { $role = get_role( 'administrator' ); @@ -451,6 +497,11 @@ function populate_roles_260() { } } +/** + * Create and modify WordPress roles for WordPress 2.7. + * + * @since 2.7.0 + */ function populate_roles_270() { $role = get_role( 'administrator' ); diff --git a/wp-admin/includes/taxonomy.php b/wp-admin/includes/taxonomy.php index a0b95a7af6..667ff04427 100644 --- a/wp-admin/includes/taxonomy.php +++ b/wp-admin/includes/taxonomy.php @@ -1,9 +1,23 @@ $cat_name, 'category_parent' => $parent) ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $categories + * @param unknown_type $post_id + * @return unknown + */ function wp_create_categories($categories, $post_id = '') { $cat_ids = array (); foreach ($categories as $category) { @@ -39,6 +79,14 @@ function wp_create_categories($categories, $post_id = '') { return $cat_ids; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $cat_ID + * @return unknown + */ function wp_delete_category($cat_ID) { $cat_ID = (int) $cat_ID; $default = get_option('default_category'); @@ -50,6 +98,15 @@ function wp_delete_category($cat_ID) { return wp_delete_term($cat_ID, 'category', array('default' => $default)); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $catarr + * @param unknown_type $wp_error + * @return unknown + */ function wp_insert_category($catarr, $wp_error = false) { $cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => ''); $cat_arr = wp_parse_args($cat_arr, $cat_defaults); @@ -99,6 +156,14 @@ function wp_insert_category($catarr, $wp_error = false) { return $cat_ID['term_id']; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $catarr + * @return unknown + */ function wp_update_category($catarr) { $cat_ID = (int) $catarr['cat_ID']; @@ -121,6 +186,14 @@ function wp_update_category($catarr) { // Tags // +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post_id + * @return unknown + */ function get_tags_to_edit( $post_id ) { $post_id = (int) $post_id; if ( !$post_id ) @@ -139,10 +212,26 @@ function get_tags_to_edit( $post_id ) { return $tags_to_edit; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $tag_name + * @return unknown + */ function tag_exists($tag_name) { return is_term($tag_name, 'post_tag'); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $tag_name + * @return unknown + */ function wp_create_tag($tag_name) { if ( $id = tag_exists($tag_name) ) return $id; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 5024a34511..cc95ca0858 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1,15 +1,43 @@ 0); @@ -72,6 +100,16 @@ function _cat_rows( $categories, &$count, $parent = 0, $level = 0, $page = 1, $p echo $output; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $category + * @param unknown_type $level + * @param unknown_type $name_override + * @return unknown + */ function _cat_row( $category, $level, $name_override = false ) { global $class; @@ -144,6 +182,15 @@ function _cat_row( $category, $level, $name_override = false ) { return apply_filters('cat_row', $output); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $category + * @param unknown_type $name_override + * @return unknown + */ function link_cat_row( $category, $name_override = false ) { global $class; @@ -214,11 +261,27 @@ function link_cat_row( $category, $name_override = false ) { return apply_filters( 'link_cat_row', $output ); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $checked + * @param unknown_type $current + */ function checked( $checked, $current) { if ( $checked == $current) echo ' checked="checked"'; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $selected + * @param unknown_type $current + */ function selected( $selected, $current) { if ( $selected == $current) echo ' selected="selected"'; @@ -228,12 +291,27 @@ function selected( $selected, $current) { // Category Checklists // -// Deprecated. Use wp_link_category_checklist +/** + * {@internal Missing Short Description}} + * + * @since unknown + * @deprecated Use {@link wp_link_category_checklist()} + * @see wp_link_category_checklist() + * + * @param unknown_type $default + * @param unknown_type $parent + * @param unknown_type $popular_ids + */ function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { global $post_ID; wp_category_checklist($post_ID); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ class Walker_Category_Checklist extends Walker { var $tree_type = 'category'; var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this @@ -260,6 +338,16 @@ class Walker_Category_Checklist extends Walker { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $post_id + * @param unknown_type $descendants_and_self + * @param unknown_type $selected_cats + * @param unknown_type $popular_cats + */ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) { $walker = new Walker_Category_Checklist; $descendants_and_self = (int) $descendants_and_self; @@ -301,6 +389,17 @@ function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $select echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args)); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $taxonomy + * @param unknown_type $default + * @param unknown_type $number + * @param unknown_type $echo + * @return unknown + */ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { global $post_ID; if ( $post_ID ) @@ -329,13 +428,28 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech return $popular_ids; } -// Deprecated. Use wp_link_category_checklist +/** + * {@internal Missing Short Description}} + * + * @since unknown + * @deprecated Use {@link wp_link_category_checklist()} + * @see wp_link_category_checklist() + * + * @param unknown_type $default + */ function dropdown_link_categories( $default = 0 ) { global $link_id; wp_link_category_checklist($link_id); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $link_id + */ function wp_link_category_checklist( $link_id = 0 ) { $default = 1; @@ -367,6 +481,15 @@ function wp_link_category_checklist( $link_id = 0 ) { // Returns a single tag row (see tag_rows below) // Note: this is also used in admin-ajax.php! +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $tag + * @param unknown_type $class + * @return unknown + */ function _tag_row( $tag, $class = '' ) { $count = number_format_i18n( $tag->count ); $count = ( $count > 0 ) ? "$count" : $count; @@ -422,6 +545,16 @@ function _tag_row( $tag, $class = '' ) { // Outputs appropriate rows for the Nth page of the Tag Management screen, // assuming M tags displayed at a time on the page // Returns the number of tags displayed +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + * @param unknown_type $pagesize + * @param unknown_type $searchterms + * @return unknown + */ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { // Get a page worth of tags @@ -449,6 +582,13 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { } // define the columns to display, the syntax is 'internal name' => 'display name' +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function wp_manage_posts_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; @@ -471,6 +611,13 @@ function wp_manage_posts_columns() { } // define the columns to display, the syntax is 'internal name' => 'display name' +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function wp_manage_media_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; @@ -488,6 +635,13 @@ function wp_manage_media_columns() { return $posts_columns; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function wp_manage_pages_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; @@ -516,6 +670,14 @@ function wp_manage_pages_columns() { return $posts_columns; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + * @return unknown + */ function get_column_headers($page) { switch ($page) { case 'post': @@ -590,6 +752,14 @@ function get_column_headers($page) { return $columns; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $type + * @param unknown_type $id + */ function print_column_headers( $type, $id = true ) { $columns = get_column_headers( $type ); $hidden = (array) get_user_option( "manage-$type-columns-hidden" ); @@ -626,6 +796,13 @@ function print_column_headers( $type, $id = true ) { post_type, $post->ID) ) @@ -933,6 +1124,13 @@ function get_inline_data($post) { echo ''; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $posts + */ function post_rows( $posts = array() ) { global $wp_query, $post, $mode; @@ -959,6 +1157,15 @@ function post_rows( $posts = array() ) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $a_post + * @param unknown_type $pending_comments + * @param unknown_type $mode + */ function _post_row($a_post, $pending_comments, $mode) { global $post; static $rowclass; @@ -1174,6 +1381,14 @@ function _post_row($a_post, $pending_comments, $mode) { * display one row if the page doesn't have any children * otherwise, display the row and its children in subsequent rows */ +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + * @param unknown_type $level + */ function display_page_row( $page, $level = 0 ) { global $post; static $rowclass; @@ -1329,6 +1544,16 @@ foreach ($posts_columns as $column_name=>$column_display_name) { /* * displays pages in hierarchical order with paging support */ +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $pages + * @param unknown_type $pagenum + * @param unknown_type $per_page + * @return unknown + */ function page_rows($pages, $pagenum = 1, $per_page = 20) { global $wpdb; @@ -1406,6 +1631,18 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) { * Given a top level page ID, display the nested hierarchy of sub-pages * together with paging support */ +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $children_pages + * @param unknown_type $count + * @param unknown_type $parent + * @param unknown_type $level + * @param unknown_type $pagenum + * @param unknown_type $per_page + */ function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) { if ( ! isset( $children_pages[$parent] ) ) @@ -1448,6 +1685,16 @@ function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_ unset( $children_pages[$parent] ); //required in order to keep track of orphans } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $user_object + * @param unknown_type $style + * @param unknown_type $role + * @return unknown + */ function user_row( $user_object, $style = '', $role = '' ) { global $wp_roles; @@ -1531,6 +1778,19 @@ function user_row( $user_object, $style = '', $role = '' ) { return $r; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $status + * @param unknown_type $s + * @param unknown_type $start + * @param unknown_type $num + * @param unknown_type $post + * @param unknown_type $type + * @return unknown + */ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) { global $wpdb; @@ -1583,6 +1843,16 @@ function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0 return array($comments, $total); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $comment_id + * @param unknown_type $mode + * @param unknown_type $comment_status + * @param unknown_type $checkbox + */ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true ) { global $comment, $post; $comment = get_comment( $comment_id ); @@ -1707,6 +1977,15 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true echo "\n"; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $position + * @param unknown_type $checkbox + * @param unknown_type $mode + */ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single') { global $current_user; @@ -1750,6 +2029,18 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single') 0) ); @@ -1771,6 +2062,13 @@ function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $le } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $meta + */ function list_meta( $meta ) { // Exit if no meta if (!$meta ) { @@ -1793,6 +2091,15 @@ function list_meta( $meta ) { echo "\n\t

"; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $entry + * @param unknown_type $count + * @return unknown + */ function _list_meta_row( $entry, &$count ) { static $update_nonce = false; if ( !$update_nonce ) @@ -1835,6 +2142,11 @@ function _list_meta_row( $entry, &$count ) { return $r; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ function meta_form() { global $wpdb; $limit = (int) apply_filters( 'postmeta_form_limit', 30 ); @@ -1881,6 +2193,16 @@ function meta_form() { } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $edit + * @param unknown_type $for_post + * @param unknown_type $tab_index + * @param unknown_type $multi + */ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { global $wp_locale, $post, $comment; @@ -1931,6 +2253,13 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) ); @@ -1969,6 +2308,11 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + */ function browse_happy() { $getit = __( 'WordPress recommends a better browser' ); echo ' @@ -1979,6 +2323,14 @@ function browse_happy() { if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) add_action( 'in_admin_footer', 'browse_happy' ); +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $id + * @return unknown + */ function the_attachment_links( $id = false ) { $id = (int) $id; $post = & get_post( $id ); @@ -2022,6 +2374,13 @@ function the_attachment_links( $id = false ) { 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); $log = log( $bytes, 1024 ); @@ -2056,6 +2431,13 @@ function wp_convert_bytes_to_hr( $bytes ) { return $size . $units[$power]; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @return unknown + */ function wp_max_upload_size() { $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) ); $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) ); @@ -2063,6 +2445,13 @@ function wp_max_upload_size() { return $bytes; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $action + */ function wp_import_upload_form( $action ) { $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() ); $size = wp_convert_bytes_to_hr( $bytes ); @@ -2082,6 +2471,11 @@ function wp_import_upload_form( $action ) { post_name); // just in case @@ -2090,16 +2484,16 @@ function wp_remember_old_slug() { } /** - * add_meta_box() - Add a meta box to an edit form + * Add a meta box to an edit form. * - * @since 2.5 + * @since 2.5.0 * * @param string $id String for use in the 'id' attribute of tags. - * @param string $title Title of the meta box + * @param string $title Title of the meta box. * @param string $callback Function that fills the box with the desired content. The function should echo its output. - * @param string $page The type of edit page on which to show the box (post, page, link) - * @param string $context The context within the page where the boxes should show ('normal', 'advanced') - * @param string $priority The priority within the context where the boxes should show ('high', 'low') + * @param string $page The type of edit page on which to show the box (post, page, link). + * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). + * @param string $priority The priority within the context where the boxes should show ('high', 'low'). */ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') { global $wp_meta_boxes; @@ -2151,6 +2545,16 @@ function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $pri $wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + * @param unknown_type $context + * @param unknown_type $object + * @return unknown + */ function do_meta_boxes($page, $context, $object) { global $wp_meta_boxes; static $already_sorted = false; @@ -2202,13 +2606,13 @@ function do_meta_boxes($page, $context, $object) { } /** - * remove_meta_box() - Remove a meta box from an edit form + * Remove a meta box from an edit form. * - * @since 2.6 + * @since 2.6.0 * * @param string $id String for use in the 'id' attribute of tags. - * @param string $page The type of edit page on which to show the box (post, page, link) - * @param string $context The context within the page where the boxes should show ('normal', 'advanced') + * @param string $page The type of edit page on which to show the box (post, page, link). + * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). */ function remove_meta_box($id, $page, $context) { global $wp_meta_boxes; @@ -2224,6 +2628,13 @@ function remove_meta_box($id, $page, $context) { $wp_meta_boxes[$page][$context][$priority][$id] = false; } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + */ function meta_box_prefs($page) { global $wp_meta_boxes; @@ -2250,14 +2661,14 @@ function meta_box_prefs($page) { } /** - * Add a new section to a settings page + * Add a new section to a settings page. * - * @since 2.7 + * @since 2.7.0 * * @param string $id String for use in the 'id' attribute of tags. - * @param string $title Title of the section + * @param string $title Title of the section. * @param string $callback Function that fills the section with the desired content. The function should echo its output. - * @param string $page The type of settings page on which to show the section (general, reading, writing, ...) + * @param string $page The type of settings page on which to show the section (general, reading, writing, ...). */ function add_settings_section($id, $title, $callback, $page) { global $wp_settings_sections; @@ -2273,15 +2684,15 @@ function add_settings_section($id, $title, $callback, $page) { } /** - * Add a new field to a settings page + * Add a new field to a settings page. * - * @since 2.7 + * @since 2.7.0 * * @param string $id String for use in the 'id' attribute of tags. - * @param string $title Title of the field + * @param string $title Title of the field. * @param string $callback Function that fills the field with the desired content. The function should echo its output. - * @param string $page The type of settings page on which to show the field (general, reading, writing, ...) - * @param string $section The section of the settingss page in which to show the box (default, ...) + * @param string $page The type of settings page on which to show the field (general, reading, writing, ...). + * @param string $section The section of the settingss page in which to show the box (default, ...). * @param array $args Additional arguments */ function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) { @@ -2297,6 +2708,13 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default', $wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args); } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + */ function do_settings_sections($page) { global $wp_settings_sections, $wp_settings_fields; @@ -2314,6 +2732,14 @@ function do_settings_sections($page) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + * @param unknown_type $section + */ function do_settings_fields($page, $section) { global $wp_settings_fields; @@ -2333,6 +2759,13 @@ function do_settings_fields($page, $section) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $page + */ function manage_columns_prefs($page) { $columns = get_column_headers($page); @@ -2354,6 +2787,13 @@ function manage_columns_prefs($page) { } } +/** + * {@internal Missing Short Description}} + * + * @since unknown + * + * @param unknown_type $found_action + */ function find_posts_div($found_action = '') { ?> \n"; } + /** * Get the post title. * - * The post title is fetched and if it is blank then a default string is returned. + * The post title is fetched and if it is blank then a default string is + * returned. * * @since 2.7.0 - * @param int $id The post id. If not supplied the global $post is used.. + * @param int $id The post id. If not supplied the global $post is used. * */ function _draft_or_post_title($post_id = 0) @@ -2528,4 +2975,5 @@ function _draft_or_post_title($post_id = 0) $title = __('(no title)'); return $title; } + ?> diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 18a77b37fd..8b883e23ab 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -1,5 +1,18 @@ user_email; @@ -132,6 +180,15 @@ http://wordpress.org/ endif; if ( !function_exists('wp_upgrade') ) : +/** + * Run WordPress Upgrade functions. + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @return null + */ function wp_upgrade() { global $wp_current_db_version, $wp_db_version; @@ -141,7 +198,7 @@ function wp_upgrade() { if ( $wp_db_version == $wp_current_db_version ) return; - if(!is_blog_installed()) + if( ! is_blog_installed() ) return; wp_check_mysql_version(); @@ -152,7 +209,13 @@ function wp_upgrade() { } endif; -// Functions to be called in install and upgrade scripts +/** + * Functions to be called in install and upgrade scripts. + * + * {@internal Missing Long Description}} + * + * @since unknown + */ function upgrade_all() { global $wp_current_db_version, $wp_db_version, $wp_rewrite; $wp_current_db_version = __get_option('db_version'); @@ -220,6 +283,11 @@ function upgrade_all() { update_option('db_version', $wp_db_version); } +/** + * Execute changes made in WordPress 1.0. + * + * @since 1.0.0 + */ function upgrade_100() { global $wpdb; @@ -242,7 +310,6 @@ function upgrade_100() { } } - $wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/') WHERE option_name LIKE 'links_rating_image%' AND option_value LIKE 'wp-links/links-images/%'"); @@ -272,6 +339,11 @@ function upgrade_100() { endif; } +/** + * Execute changes made in WordPress 1.0.1. + * + * @since 1.0.1 + */ function upgrade_101() { global $wpdb; @@ -285,7 +357,11 @@ function upgrade_101() { add_clean_index($wpdb->links , 'link_visible'); } - +/** + * Execute changes made in WordPress 1.2. + * + * @since 1.2.0 + */ function upgrade_110() { global $wpdb; @@ -305,7 +381,6 @@ function upgrade_110() { } } - // Get the GMT offset, we'll use that later on $all_options = get_alloptions_110(); @@ -342,6 +417,11 @@ function upgrade_110() { } +/** + * Execute changes made in WordPress 1.5. + * + * @since 1.5.0 + */ function upgrade_130() { global $wpdb; @@ -419,6 +499,11 @@ function upgrade_130() { make_site_theme(); } +/** + * Execute changes made in WordPress 2.0. + * + * @since 2.0.0 + */ function upgrade_160() { global $wpdb, $wp_current_db_version; @@ -497,6 +582,11 @@ function upgrade_160() { } } +/** + * Execute changes made in WordPress 2.1. + * + * @since 2.1.0 + */ function upgrade_210() { global $wpdb, $wp_current_db_version; @@ -536,6 +626,11 @@ function upgrade_210() { } } +/** + * Execute changes made in WordPress 2.3. + * + * @since 2.3.0 + */ function upgrade_230() { global $wp_current_db_version, $wpdb; @@ -706,6 +801,11 @@ function upgrade_230() { } } +/** + * Remove old options from the database. + * + * @since 2.3.0 + */ function upgrade_230_options_table() { global $wpdb; $old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' ); @@ -715,6 +815,11 @@ function upgrade_230_options_table() { $wpdb->show_errors(); } +/** + * Remove old categories, link2cat, and post2cat database tables. + * + * @since 2.3.0 + */ function upgrade_230_old_tables() { global $wpdb; $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories'); @@ -722,13 +827,22 @@ function upgrade_230_old_tables() { $wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat'); } +/** + * Upgrade old slugs made in version 2.2. + * + * @since 2.2.0 + */ function upgrade_old_slugs() { // upgrade people who were using the Redirect Old Slugs plugin global $wpdb; $wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'"); } - +/** + * Execute changes made in WordPress 2.5.0. + * + * @since 2.5.0 + */ function upgrade_250() { global $wp_current_db_version; @@ -738,6 +852,11 @@ function upgrade_250() { } +/** + * Execute changes made in WordPress 2.5.1. + * + * @since 2.5.1 + */ function upgrade_251() { global $wp_current_db_version; @@ -745,12 +864,22 @@ function upgrade_251() { update_option('secret', wp_generate_password(64)); } +/** + * Execute changes made in WordPress 2.5.2. + * + * @since 2.5.2 + */ function upgrade_252() { global $wpdb; $wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''"); } +/** + * Execute changes made in WordPress 2.6. + * + * @since 2.6.0 + */ function upgrade_260() { global $wp_current_db_version; @@ -763,6 +892,11 @@ function upgrade_260() { } } +/** + * Execute changes made in WordPress 2.7. + * + * @since 2.7.0 + */ function upgrade_270() { global $wpdb, $wp_current_db_version; @@ -778,6 +912,18 @@ function upgrade_270() { // The functions we use to actually do stuff // General + +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param string $table_name Database table name to create. + * @param string $create_ddl SQL statement to create table. + * @return bool If table already exists or was created by function. + */ function maybe_create_table($table_name, $create_ddl) { global $wpdb; foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { @@ -796,6 +942,17 @@ function maybe_create_table($table_name, $create_ddl) { return false; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param string $table Database table name. + * @param string $index Index name to drop. + * @return bool True, when finished. + */ function drop_index($table, $index) { global $wpdb; $wpdb->hide_errors(); @@ -808,6 +965,17 @@ function drop_index($table, $index) { return true; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param string $table Database table name. + * @param string $index Database table index column. + * @return bool True, when done with execution. + */ function add_clean_index($table, $index) { global $wpdb; drop_index($table, $index); @@ -840,8 +1008,13 @@ function maybe_add_column($table_name, $column_name, $create_ddl) { return false; } - -// get_alloptions as it was for 1.2. +/** + * Retrieve all options as it was for 1.2. + * + * @since 1.2.0 + * + * @return array List of options. + */ function get_alloptions_110() { global $wpdb; if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) { @@ -857,7 +1030,15 @@ function get_alloptions_110() { return $all_options; } -// Version of get_option that is private to install/upgrade. +/** + * Version of get_option that is private to install/upgrade. + * + * @since unknown + * @access private + * + * @param string $setting Option name. + * @return mixed + */ function __get_option($setting) { global $wpdb; @@ -884,6 +1065,16 @@ function __get_option($setting) { return $option; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param string $content + * @return string + */ function deslash($content) { // Note: \\\ inside a regex denotes a single backslash. @@ -901,6 +1092,17 @@ function deslash($content) { return $content; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param unknown_type $queries + * @param unknown_type $execute + * @return unknown + */ function dbDelta($queries, $execute = true) { global $wpdb; @@ -1102,6 +1304,13 @@ function dbDelta($queries, $execute = true) { return $for_update; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + */ function make_db_current() { global $wp_queries; @@ -1111,12 +1320,30 @@ function make_db_current() { echo "\n"; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + */ function make_db_current_silent() { global $wp_queries; $alterations = dbDelta($wp_queries); } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param unknown_type $theme_name + * @param unknown_type $template + * @return unknown + */ function make_site_theme_from_oldschool($theme_name, $template) { $home_path = get_home_path(); $site_dir = WP_CONTENT_DIR . "/themes/$template"; @@ -1185,6 +1412,17 @@ function make_site_theme_from_oldschool($theme_name, $template) { return true; } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param unknown_type $theme_name + * @param unknown_type $template + * @return unknown + */ function make_site_theme_from_default($theme_name, $template) { $site_dir = WP_CONTENT_DIR . "/themes/$template"; $default_dir = WP_CONTENT_DIR . '/themes/default'; @@ -1240,6 +1478,15 @@ function make_site_theme_from_default($theme_name, $template) { } // Create a site theme from the default theme. +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @return unknown + */ function make_site_theme() { // Name the theme after the blog. $theme_name = __get_option('blogname'); @@ -1281,6 +1528,14 @@ function make_site_theme() { return $template; } +/** + * Translate user level to user role name. + * + * @since unknown + * + * @param int $level User level. + * @return string User role name. + */ function translate_level_to_role($level) { switch ($level) { case 10: @@ -1302,6 +1557,13 @@ function translate_level_to_role($level) { } } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + */ function wp_check_mysql_version() { global $wpdb; $result = $wpdb->check_database_version(); @@ -1309,6 +1571,13 @@ function wp_check_mysql_version() { die( $result->get_error_message() ); } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + */ function maybe_disable_automattic_widgets() { $plugins = __get_option( 'active_plugins' ); diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index 4400008d55..aa0d7c0692 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -1,6 +1,21 @@ prefix . 'user_level'; return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) ); } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param int $user_id User ID. + * @return array|bool List of editable authors. False if no editable users. + */ function get_editable_authors( $user_id ) { global $wpdb; @@ -163,6 +207,17 @@ function get_editable_authors( $user_id ) { return apply_filters('get_editable_authors', $authors); } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @param int $user_id User ID. + * @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros. + * @return unknown + */ function get_editable_user_ids( $user_id, $exclude_zeros = true ) { global $wpdb; @@ -184,6 +239,15 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true ) { return $wpdb->get_col( $query ); } +/** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * + * @return unknown + */ function get_nonauthor_user_ids() { global $wpdb; $level_key = $wpdb->prefix . 'user_level'; @@ -191,6 +255,15 @@ function get_nonauthor_user_ids() { return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) ); } +/** + * Retrieve editable posts from other users. + * + * @since unknown + * + * @param int $user_id User ID to not retrieve posts from. + * @param string $type Optional, defaults to 'any'. Post type to retrieve, can be 'draft' or 'pending'. + * @return array List of posts from others. + */ function get_others_unpublished_posts($user_id, $type='any') { global $wpdb; @@ -213,14 +286,38 @@ function get_others_unpublished_posts($user_id, $type='any') { return apply_filters('get_others_drafts', $other_unpubs); } +/** + * Retrieve drafts from other users. + * + * @since unknown + * + * @param int $user_id User ID. + * @return array List of drafts from other users. + */ function get_others_drafts($user_id) { return get_others_unpublished_posts($user_id, 'draft'); } +/** + * Retrieve pending review posts from other users. + * + * @since unknown + * + * @param int $user_id User ID. + * @return array List of posts with pending review post type from other users. + */ function get_others_pending($user_id) { return get_others_unpublished_posts($user_id, 'pending'); } +/** + * Retrieve user data and filter it. + * + * @since unknown + * + * @param int $user_id User ID. + * @return object WP_User object with user data. + */ function get_user_to_edit( $user_id ) { $user = new WP_User( $user_id ); $user->user_login = attribute_escape($user->user_login); @@ -238,6 +335,14 @@ function get_user_to_edit( $user_id ) { return $user; } +/** + * Retrieve the user's drafts. + * + * @since unknown + * + * @param int $user_id User ID. + * @return array + */ function get_users_drafts( $user_id ) { global $wpdb; $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,6 +350,20 @@ function get_users_drafts( $user_id ) { return $wpdb->get_results( $query ); } +/** + * Remove user and optionally reassign posts and links to another user. + * + * If the $reassign parameter is not assigned to an User ID, then all posts will + * be deleted of that user. The action 'delete_user' that is passed the User ID + * being deleted will be run after the posts are either reassigned or deleted. + * The user meta will also be deleted that are for that User ID. + * + * @since unknown + * + * @param int $id User ID. + * @param int $reassign Optional. Reassign posts and links to new User ID. + * @return bool True when finished. + */ function wp_delete_user($id, $reassign = 'novalue') { global $wpdb; @@ -279,6 +398,13 @@ function wp_delete_user($id, $reassign = 'novalue') { return true; } +/** + * Remove all capabilities from user. + * + * @since unknown + * + * @param int $id User ID. + */ function wp_revoke_user($id) { $id = (int) $id; @@ -286,28 +412,161 @@ function wp_revoke_user($id) { $user->remove_all_caps(); } -// WP_User_Search class -// by Mark Jaquith - if ( !class_exists('WP_User_Search') ) : +/** + * WordPress User Search class. + * + * @since unknown + * @author Mark Jaquith + */ class WP_User_Search { + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $results; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $search_term; + + /** + * Page number. + * + * @since unknown + * @access private + * @var int + */ var $page; + + /** + * Role name that users have. + * + * @since unknown + * @access private + * @var string + */ var $role; + + /** + * Raw page number. + * + * @since unknown + * @access private + * @var int|bool + */ var $raw_page; + + /** + * Amount of users to display per page. + * + * @since unknown + * @access public + * @var int + */ var $users_per_page = 50; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $first_user; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var int + */ var $last_user; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $query_limit; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $query_sort; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $query_from_where; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var int + */ var $total_users_for_query = 0; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var bool + */ var $too_many_total_users = false; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $search_errors; + + /** + * {@internal Missing Description}} + * + * @since unknown + * @access private + * @var unknown_type + */ var $paging_text; - function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor + /** + * PHP4 Constructor - Sets up the object properties. + * + * @since unknown + * + * @param string $search_term Search terms string. + * @param int $page Optional. Page ID. + * @param string $role Role name. + * @return WP_User_Search + */ + function WP_User_Search ($search_term = '', $page = '', $role = '') { $this->search_term = $search_term; $this->raw_page = ( '' == $page ) ? false : (int) $page; $this->page = (int) ( '' == $page ) ? 1 : $page; @@ -319,6 +578,14 @@ class WP_User_Search { $this->do_paging(); } + /** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * @access public + */ function prepare_query() { global $wpdb; $this->first_user = ($this->page - 1) * $this->users_per_page; @@ -343,6 +610,14 @@ class WP_User_Search { } + /** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * @access public + */ function query() { global $wpdb; $this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit); @@ -353,10 +628,26 @@ class WP_User_Search { $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); } + /** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * @access public + */ function prepare_vars_for_template_usage() { $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone } + /** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * @access public + */ function do_paging() { if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results $args = array(); @@ -375,20 +666,56 @@ class WP_User_Search { } } + /** + * {@internal Missing Short Description}} + * + * {@internal Missing Long Description}} + * + * @since unknown + * @access public + * + * @return unknown + */ function get_results() { return (array) $this->results; } + /** + * Displaying paging text. + * + * @see do_paging() Builds paging text. + * + * @since unknown + * @access public + */ function page_links() { echo $this->paging_text; } + /** + * Whether paging is enabled. + * + * @see do_paging() Builds paging text. + * + * @since unknown + * @access public + * + * @return bool + */ function results_are_paged() { if ( $this->paging_text ) return true; return false; } + /** + * Whether there are search terms. + * + * @since unknown + * @access public + * + * @return bool + */ function is_search() { if ( $this->search_term ) return true; diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index c6050960aa..b87d58aefc 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -9,10 +9,12 @@ /** * Display list of widgets, either all or matching search. * + * The search parameter are search terms separated by spaces. + * * @since unknown * - * @param unknown_type $show - * @param unknown_type $_search Optional. Search for widgets. Should be unsanitized. + * @param string $show Optional, default is all. What to display, can be 'all', 'unused', or 'used'. + * @param string $_search Optional. Search for widgets. Should be unsanitized. */ function wp_list_widgets( $show = 'all', $_search = false ) { global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls; @@ -168,7 +170,7 @@ function wp_list_widgets( $show = 'all', $_search = false ) { * * @since unknown * - * @param unknown_type $sidebar + * @param string $sidebar */ function wp_list_widget_controls( $sidebar ) { add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' ); @@ -188,8 +190,8 @@ function wp_list_widget_controls( $sidebar ) { * * @since unknown * - * @param unknown_type $params - * @return unknown + * @param array $params + * @return array */ function wp_list_widget_controls_dynamic_sidebar( $params ) { global $wp_registered_widgets; @@ -216,8 +218,8 @@ function wp_list_widget_controls_dynamic_sidebar( $params ) { * * @since unknown * - * @param unknown_type $sidebar_args - * @return unknown + * @param array $sidebar_args + * @return array */ function wp_widget_control( $sidebar_args ) { global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget; @@ -322,8 +324,8 @@ function wp_widget_control( $sidebar_args ) { * * @since unknown * - * @param unknown_type $string - * @return unknown + * @param string $string + * @return string */ function wp_widget_control_ob_filter( $string ) { if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) )