mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 01:24:27 +00:00
Docs: Improve comments in some wp-admin files per the documentation standards.
Follow-up to [47084]. Props passoniate, apedog. Fixes #49223, #49227. git-svn-id: https://develop.svn.wordpress.org/trunk@47119 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -20,7 +20,7 @@ function check_upload_size( $file ) {
|
||||
return $file;
|
||||
}
|
||||
|
||||
if ( $file['error'] != '0' ) { // there's already an error
|
||||
if ( $file['error'] != '0' ) { // There's already an error.
|
||||
return $file;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
||||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @todo Merge with wp_delete_user() ?
|
||||
* @todo Merge with wp_delete_user()?
|
||||
*
|
||||
* @global wpdb $wpdb WordPress database abstraction object.
|
||||
*
|
||||
@@ -177,7 +177,7 @@ function wpmu_delete_user( $id ) {
|
||||
wp_delete_post( $post_id );
|
||||
}
|
||||
|
||||
// Clean links
|
||||
// Clean links.
|
||||
$link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id ) );
|
||||
|
||||
if ( $link_ids ) {
|
||||
@@ -220,7 +220,7 @@ function upload_is_user_over_quota( $echo = true ) {
|
||||
|
||||
$space_allowed = get_space_allowed();
|
||||
if ( ! is_numeric( $space_allowed ) ) {
|
||||
$space_allowed = 10; // Default space allowed is 10 MB
|
||||
$space_allowed = 10; // Default space allowed is 10 MB.
|
||||
}
|
||||
$space_used = get_space_used();
|
||||
|
||||
@@ -644,11 +644,11 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
|
||||
foreach ( (array) $lang_files as $val ) {
|
||||
$code_lang = basename( $val, '.mo' );
|
||||
|
||||
if ( $code_lang == 'en_US' ) { // American English
|
||||
if ( $code_lang == 'en_US' ) { // American English.
|
||||
$flag = true;
|
||||
$ae = __( 'American English' );
|
||||
$output[ $ae ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $ae . '</option>';
|
||||
} elseif ( $code_lang == 'en_GB' ) { // British English
|
||||
} elseif ( $code_lang == 'en_GB' ) { // British English.
|
||||
$flag = true;
|
||||
$be = __( 'British English' );
|
||||
$output[ $be ] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . $be . '</option>';
|
||||
@@ -658,11 +658,11 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( $flag === false ) { // WordPress english
|
||||
if ( $flag === false ) { // WordPress English.
|
||||
$output[] = '<option value=""' . selected( $current, '', false ) . '>' . __( 'English' ) . '</option>';
|
||||
}
|
||||
|
||||
// Order by name
|
||||
// Order by name.
|
||||
uksort( $output, 'strnatcasecmp' );
|
||||
|
||||
/**
|
||||
@@ -1067,7 +1067,7 @@ function network_edit_site_nav( $args = array() ) {
|
||||
)
|
||||
);
|
||||
|
||||
// Parse arguments
|
||||
// Parse arguments.
|
||||
$parsed_args = wp_parse_args(
|
||||
$args,
|
||||
array(
|
||||
@@ -1077,36 +1077,36 @@ function network_edit_site_nav( $args = array() ) {
|
||||
)
|
||||
);
|
||||
|
||||
// Setup the links array
|
||||
// Setup the links array.
|
||||
$screen_links = array();
|
||||
|
||||
// Loop through tabs
|
||||
// Loop through tabs.
|
||||
foreach ( $parsed_args['links'] as $link_id => $link ) {
|
||||
|
||||
// Skip link if user can't access
|
||||
// Skip link if user can't access.
|
||||
if ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Link classes
|
||||
// Link classes.
|
||||
$classes = array( 'nav-tab' );
|
||||
|
||||
// Aria-current attribute.
|
||||
$aria_current = '';
|
||||
|
||||
// Selected is set by the parent OR assumed by the $pagenow global
|
||||
// Selected is set by the parent OR assumed by the $pagenow global.
|
||||
if ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
|
||||
$classes[] = 'nav-tab-active';
|
||||
$aria_current = ' aria-current="page"';
|
||||
}
|
||||
|
||||
// Escape each class
|
||||
// Escape each class.
|
||||
$esc_classes = implode( ' ', $classes );
|
||||
|
||||
// Get the URL for this link
|
||||
// Get the URL for this link.
|
||||
$url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) );
|
||||
|
||||
// Add link to nav links
|
||||
// Add link to nav links.
|
||||
$screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user