Make WordPress Core


Ignore:
Timestamp:
09/10/2019 07:22:07 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Fix placement of some duplicate hook references.

Hook documentation should be on the line directly above the line containing the do_action() or apply_filters() call. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of duplicate hook references.

Includes minor code layout fixes.

See #47110.

File:
1 edited

Legend:

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

    r45590 r46088  
    200200        $title = isset( $obj->extra['title'] ) ? "title='" . esc_attr( $obj->extra['title'] ) . "'" : '';
    201201
     202        $tag = "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n";
     203
    202204        /**
    203205         * Filters the HTML link tag of an enqueued style.
     
    212214         * @param string $media  The stylesheet's media attribute.
    213215         */
    214         $tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle, $href, $media );
     216        $tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media );
    215217
    216218        if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) {
     
    222224            }
    223225
     226            $rtl_tag = "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n";
    224227            /** This filter is documented in wp-includes/class.wp-styles.php */
    225             $rtl_tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-rtl-css' $title href='$rtl_href' type='text/css' media='$media' />\n", $handle, $rtl_href, $media );
     228            $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media );
    226229
    227230            if ( $obj->extra['rtl'] === 'replace' ) {
Note: See TracChangeset for help on using the changeset viewer.