Docs: Improve comments in some wp-admin files per the documentation standards.

Props passoniate.
Fixes #49215, #49216.
Built from https://develop.svn.wordpress.org/trunk@47084


git-svn-id: http://core.svn.wordpress.org/trunk@46884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-01-18 00:54:04 +00:00
parent 1cfc32af58
commit 053a9cd5b8
11 changed files with 168 additions and 137 deletions

View File

@@ -233,7 +233,7 @@ function get_author_user_ids() {
if ( !is_multisite() )
$level_key = $wpdb->get_blog_prefix() . 'user_level';
else
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
}
@@ -295,7 +295,7 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'p
if ( !is_multisite() )
$level_key = $wpdb->get_blog_prefix() . 'user_level';
else
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
if ( $exclude_zeros )
@@ -319,7 +319,7 @@ function get_nonauthor_user_ids() {
if ( !is_multisite() )
$level_key = $wpdb->get_blog_prefix() . 'user_level';
else
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels
$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // WPMU site admins don't have user_levels.
return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
}
@@ -544,7 +544,7 @@ class WP_User_Search {
$this->query_from .= " INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id";
$this->query_where .= $wpdb->prepare(" AND $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
} elseif ( is_multisite() ) {
$level_key = $wpdb->prefix . 'capabilities'; // wpmu site admins don't have user_levels
$level_key = $wpdb->prefix . 'capabilities'; // WPMU site admins don't have user_levels.
$this->query_from .= ", $wpdb->usermeta";
$this->query_where .= " AND $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'";
}
@@ -564,7 +564,7 @@ class WP_User_Search {
$this->results = $wpdb->get_col("SELECT DISTINCT($wpdb->users.ID)" . $this->query_from . $this->query_where . $this->query_orderby . $this->query_limit);
if ( $this->results )
$this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // no limit
$this->total_users_for_query = $wpdb->get_var("SELECT COUNT(DISTINCT($wpdb->users.ID))" . $this->query_from . $this->query_where); // No limit.
else
$this->search_errors = new WP_Error('no_matching_users_found', __('No users found.'));
}
@@ -584,7 +584,7 @@ class WP_User_Search {
* @access public
*/
public function do_paging() {
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
if ( $this->total_users_for_query > $this->users_per_page ) { // Have to page the results.
$args = array();
if ( ! empty($this->search_term) )
$args['usersearch'] = urlencode($this->search_term);
@@ -1319,7 +1319,7 @@ function wp_dashboard_secondary_control() {}
function wp_dashboard_plugins_output( $rss, $args = array() ) {
_deprecated_function( __FUNCTION__, '4.8.0' );
// Plugin feeds plus link to install them
// Plugin feeds plus link to install them.
$popular = fetch_feed( $args['url']['popular'] );
if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
@@ -1335,9 +1335,9 @@ function wp_dashboard_plugins_output( $rss, $args = array() ) {
$items = $feed->get_items(0, 5);
// Pick a random, non-installed plugin
// Pick a random, non-installed plugin.
while ( true ) {
// Abort this foreach loop iteration if there's no plugins left of this type
// Abort this foreach loop iteration if there's no plugins left of this type.
if ( 0 == count($items) )
continue 2;
@@ -1367,7 +1367,7 @@ function wp_dashboard_plugins_output( $rss, $args = array() ) {
break;
}
// Eliminate some common badly formed plugin descriptions
// Eliminate some common badly formed plugin descriptions.
while ( ( null !== $item_key = array_rand($items) ) && false !== strpos( $items[$item_key]->get_description(), 'Plugin Name:' ) )
unset($items[$item_key]);