WordPress.org

Make WordPress Core


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

    r47088 r47122  
    153153 * Example usage:
    154154 *
    155  *     // The filter callback function
     155 *     // The filter callback function.
    156156 *     function example_callback( $string, $arg1, $arg2 ) {
    157  *         // (maybe) modify $string
     157 *         // (maybe) modify $string.
    158158 *         return $string;
    159159 *     }
     
    161161 *
    162162 *     /*
    163  *      * Apply the filters by calling the 'example_callback()' function that's
    164  *      * hooked onto `example_filter` above.
     163 *      * Apply the filters by calling the 'example_callback()' function
     164 *      * that's hooked onto `example_filter` above.
    165165 *      *
    166  *      * - 'example_filter' is the filter hook
    167  *      * - 'filter me' is the value being filtered
     166 *      * - 'example_filter' is the filter hook.
     167 *      * - 'filter me' is the value being filtered.
    168168 *      * - $arg1 and $arg2 are the additional arguments passed to the callback.
    169169 *     $value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 );
     
    229229    global $wp_filter, $wp_current_filter;
    230230
    231     // Do 'all' actions first
     231    // Do 'all' actions first.
    232232    if ( isset( $wp_filter['all'] ) ) {
    233233        $wp_current_filter[] = $tag;
     
    416416 * Example usage:
    417417 *
    418  *     // The action callback function
     418 *     // The action callback function.
    419419 *     function example_callback( $arg1, $arg2 ) {
    420  *         // (maybe) do something with the args
     420 *         // (maybe) do something with the args.
    421421 *     }
    422422 *     add_action( 'example_action', 'example_callback', 10, 2 );
    423423 *
    424424 *     /*
    425  *      * Trigger the actions by calling the 'example_callback()' function that's
    426  *      * hooked onto `example_action` above.
     425 *      * Trigger the actions by calling the 'example_callback()' function
     426 *      * that's hooked onto `example_action` above.
    427427 *      *
    428  *      * - 'example_action' is the action hook
     428 *      * - 'example_action' is the action hook.
    429429 *      * - $arg1 and $arg2 are the additional arguments passed to the callback.
    430430 *     $value = do_action( 'example_action', $arg1, $arg2 );
     
    451451    }
    452452
    453     // Do 'all' actions first
     453    // Do 'all' actions first.
    454454    if ( isset( $wp_filter['all'] ) ) {
    455455        $wp_current_filter[] = $tag;
     
    524524    }
    525525
    526     // Do 'all' actions first
     526    // Do 'all' actions first.
    527527    if ( isset( $wp_filter['all'] ) ) {
    528528        $wp_current_filter[] = $tag;
     
    693693    $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR );
    694694
    695     $file = preg_replace( '#^' . preg_quote( $plugin_dir, '#' ) . '/|^' . preg_quote( $mu_plugin_dir, '#' ) . '/#', '', $file ); // get relative path from plugins dir
     695    // Get relative path from plugins directory.
     696    $file = preg_replace( '#^' . preg_quote( $plugin_dir, '#' ) . '/|^' . preg_quote( $mu_plugin_dir, '#' ) . '/#', '', $file );
    696697    $file = trim( $file, '/' );
    697698    return $file;
     
    718719    global $wp_plugin_paths;
    719720
    720     // Normalize, but store as static to avoid recalculation of a constant value
     721    // Normalize, but store as static to avoid recalculation of a constant value.
    721722    static $wp_plugin_path = null, $wpmu_plugin_path = null;
    722723    if ( ! isset( $wp_plugin_path ) ) {
Note: See TracChangeset for help on using the changeset viewer.