Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/deprecated.php

    r47088 r47122  
    271271    _deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
    272272
    273     // right now if one can edit, one can delete
     273    // Right now if one can edit, one can delete.
    274274    return user_can_edit_post($user_id, $post_id, $blog_id);
    275275}
     
    328328    _deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
    329329
    330     // right now if one can edit a post, one can edit comments made on it
     330    // Right now if one can edit a post, one can edit comments made on it.
    331331    return user_can_edit_post($user_id, $post_id, $blog_id);
    332332}
     
    347347    _deprecated_function( __FUNCTION__, '2.0.0', 'current_user_can()' );
    348348
    349     // right now if one can edit comments, one can delete comments
     349    // Right now if one can edit comments, one can delete comments.
    350350    return user_can_edit_post_comments($user_id, $post_id, $blog_id);
    351351}
     
    932932    }
    933933
    934     if ( $category == -1 ) //get_bookmarks uses '' to signify all categories
     934    if ( $category == -1 ) // get_bookmarks() uses '' to signify all categories.
    935935        $category = '';
    936936
     
    977977            if ( strpos($row->link_image, 'http') !== false )
    978978                $output .= "<img src=\"$row->link_image\" $alt $title />";
    979             else // If it's a relative path
     979            else // If it's a relative path.
    980980                $output .= "<img src=\"" . get_option('siteurl') . "$row->link_image\" $alt $title />";
    981981        } else {
     
    996996
    997997        $output .= "$after\n";
    998     } // end while
     998    } // End while.
    999999
    10001000    if ( !$echo )
     
    10201020    $order = strtolower($order);
    10211021
    1022     // Handle link category sorting
     1022    // Handle link category sorting.
    10231023    $direction = 'ASC';
    10241024    if ( '_' == substr($order,0,1) ) {
     
    10321032    $cats = get_categories(array('type' => 'link', 'orderby' => $order, 'order' => $direction, 'hierarchical' => 0));
    10331033
    1034     // Display each category
     1034    // Display each category.
    10351035    if ( $cats ) {
    10361036        foreach ( (array) $cats as $cat ) {
    10371037            // Handle each category.
    10381038
    1039             // Display the category name
     1039            // Display the category name.
    10401040            echo '  <li id="linkcat-' . $cat->term_id . '" class="linkcat"><h2>' . apply_filters('link_category', $cat->name ) . "</h2>\n\t<ul>\n";
    1041             // Call get_links() with all the appropriate params
     1041            // Call get_links() with all the appropriate params.
    10421042            get_links($cat->term_id, '<li>', "</li>", "\n", true, 'name', false);
    10431043
    1044             // Close the last category
     1044            // Close the last category.
    10451045            echo "\n\t</ul>\n</li>\n";
    10461046        }
     
    12551255
    12561256    $chain = '';
    1257     /** TODO: consult hierarchy */
     1257    /** TODO: Consult hierarchy */
    12581258    $cat_ids = get_all_category_ids();
    12591259    foreach ( (array) $cat_ids as $cat_id ) {
     
    18781878
    18791879    if ( !$fullsize && $src = wp_get_attachment_thumb_url( $post->ID ) ) {
    1880         // We have a thumbnail desired, specified and existing
     1880        // We have a thumbnail desired, specified and existing.
    18811881
    18821882        $src_file = wp_basename($src);
    18831883    } elseif ( wp_attachment_is_image( $post->ID ) ) {
    1884         // We have an image without a thumbnail
     1884        // We have an image without a thumbnail.
    18851885
    18861886        $src = wp_get_attachment_url( $post->ID );
     
    21142114function register_sidebar_widget($name, $output_callback, $classname = '', ...$params) {
    21152115    _deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_sidebar_widget()' );
    2116     // Compat
     2116    // Compat.
    21172117    if ( is_array( $name ) ) {
    21182118        if ( count( $name ) === 3 ) {
     
    21682168function register_widget_control($name, $control_callback, $width = '', $height = '', ...$params) {
    21692169    _deprecated_function( __FUNCTION__, '2.8.0', 'wp_register_widget_control()' );
    2170     // Compat
     2170    // Compat.
    21712171    if ( is_array( $name ) ) {
    21722172        if ( count( $name ) === 3 ) {
     
    22722272        $meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);
    22732273        $user = wp_cache_get($user_id, 'users');
    2274         // Check the cached user object
     2274        // Check the cached user object.
    22752275        if ( false !== $user && isset($user->$meta_key) )
    22762276            $metas = array($user->$meta_key);
     
    23952395        add_theme_support( 'automatic-feed-links' );
    23962396    else
    2397         remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+
     2397        remove_action( 'wp_head', 'feed_links_extra', 3 ); // Just do this yourself in 3.0+.
    23982398}
    23992399
     
    26712671
    26722672    $posts = get_boundary_post($in_same_cat, $excluded_categories, $start);
    2673     // If there is no post stop.
     2673    // If there is no post, stop.
    26742674    if ( empty($posts) )
    26752675        return;
    26762676
    2677     // Even though we limited get_posts to return only 1 item it still returns an array of objects.
     2677    // Even though we limited get_posts() to return only 1 item it still returns an array of objects.
    26782678    $post = $posts[0];
    26792679
     
    35973597
    35983598    if ( !empty($output) )
    3599         $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
     3599        $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // Convert only '< > &'.
    36003600
    36013601    /**
     
    36743674        return $headers;
    36753675
    3676     // GET request - write it to the supplied filename
     3676    // GET request - write it to the supplied filename.
    36773677    $out_fp = fopen($file_path, 'w');
    36783678    if ( !$out_fp )
Note: See TracChangeset for help on using the changeset viewer.