Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (7 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/link-template.php

    r47060 r47122  
    196196                                }
    197197                        }
    198                         // show default category in permalinks, without
    199                         // having to assign it explicitly
     198                        // Show default category in permalinks,
     199                        // without having to assign it explicitly.
    200200                        if ( empty( $category ) ) {
    201201                                $default_category = get_term( get_option( 'default_category' ), 'category' );
     
    233233                $permalink = user_trailingslashit( $permalink, 'single' );
    234234
    235         } else { // if they're not using the fancy permalink option
     235        } else { // If they're not using the fancy permalink option.
    236236                $permalink = home_url( '?p=' . $post->ID );
    237237        }
     
    424424        if ( $wp_rewrite->using_permalinks() && $parent ) {
    425425                if ( 'page' == $parent->post_type ) {
    426                         $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front
     426                        $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front.
    427427                } else {
    428428                        $parentlink = get_permalink( $post->post_parent );
     
    430430
    431431                if ( is_numeric( $post->post_name ) || false !== strpos( get_option( 'permalink_structure' ), '%category%' ) ) {
    432                         $name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker
     432                        $name = 'attachment/' . $post->post_name; // <permalink>/<int>/ is paged so we use the explicit attachment marker.
    433433                } else {
    434434                        $name = $post->post_name;
     
    10881088 * Retrieves the permalink for a search.
    10891089 *
    1090  * @since  3.0.0
     1090 * @since 3.0.0
    10911091 *
    10921092 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
     
    16501650}
    16511651
    1652 // Navigation links
     1652//
     1653// Navigation links.
     1654//
    16531655
    16541656/**
     
    25142516                $paged         = get_query_var( 'paged' );
    25152517
    2516                 //only have sep if there's both prev and next results
     2518                // Only have sep if there's both prev and next results.
    25172519                if ( $paged < 2 || $paged >= $max_num_pages ) {
    25182520                        $args['sep'] = '';
     
    38823884        $shortlink = '';
    38833885
    3884         // Return p= link for all public post types.
     3886        // Return `?p=` link for all public post types.
    38853887        if ( ! empty( $post_id ) ) {
    38863888                $post_type = get_post_type_object( $post->post_type );
     
    40924094                        'rating'         => get_option( 'avatar_rating' ),
    40934095                        'scheme'         => null,
    4094                         'processed_args' => null, // if used, should be a reference
     4096                        'processed_args' => null, // If used, should be a reference.
    40954097                        'extra_attr'     => '',
    40964098                )
     
    41784180        } elseif ( is_string( $id_or_email ) ) {
    41794181                if ( strpos( $id_or_email, '@md5.gravatar.com' ) ) {
    4180                         // md5 hash
     4182                        // MD5 hash.
    41814183                        list( $email_hash ) = explode( '@', $id_or_email );
    41824184                } else {
    4183                         // email address
     4185                        // Email address.
    41844186                        $email = $id_or_email;
    41854187                }
    41864188        } elseif ( $id_or_email instanceof WP_User ) {
    4187                 // User Object
     4189                // User object.
    41884190                $user = $id_or_email;
    41894191        } elseif ( $id_or_email instanceof WP_Post ) {
    4190                 // Post Object
     4192                // Post object.
    41914193                $user = get_user_by( 'id', (int) $id_or_email->post_author );
    41924194        } elseif ( $id_or_email instanceof WP_Comment ) {
Note: See TracChangeset for help on using the changeset viewer.