Changeset 47122 for trunk/src/wp-includes/plugin.php
- Timestamp:
- 01/29/2020 12:43:23 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/plugin.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/plugin.php
r47088 r47122 153 153 * Example usage: 154 154 * 155 * // The filter callback function 155 * // The filter callback function. 156 156 * function example_callback( $string, $arg1, $arg2 ) { 157 * // (maybe) modify $string 157 * // (maybe) modify $string. 158 158 * return $string; 159 159 * } … … 161 161 * 162 162 * /* 163 * * Apply the filters by calling the 'example_callback()' function that's164 * * hooked onto `example_filter` above.163 * * Apply the filters by calling the 'example_callback()' function 164 * * that's hooked onto `example_filter` above. 165 165 * * 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. 168 168 * * - $arg1 and $arg2 are the additional arguments passed to the callback. 169 169 * $value = apply_filters( 'example_filter', 'filter me', $arg1, $arg2 ); … … 229 229 global $wp_filter, $wp_current_filter; 230 230 231 // Do 'all' actions first 231 // Do 'all' actions first. 232 232 if ( isset( $wp_filter['all'] ) ) { 233 233 $wp_current_filter[] = $tag; … … 416 416 * Example usage: 417 417 * 418 * // The action callback function 418 * // The action callback function. 419 419 * function example_callback( $arg1, $arg2 ) { 420 * // (maybe) do something with the args 420 * // (maybe) do something with the args. 421 421 * } 422 422 * add_action( 'example_action', 'example_callback', 10, 2 ); 423 423 * 424 424 * /* 425 * * Trigger the actions by calling the 'example_callback()' function that's426 * * hooked onto `example_action` above.425 * * Trigger the actions by calling the 'example_callback()' function 426 * * that's hooked onto `example_action` above. 427 427 * * 428 * * - 'example_action' is the action hook 428 * * - 'example_action' is the action hook. 429 429 * * - $arg1 and $arg2 are the additional arguments passed to the callback. 430 430 * $value = do_action( 'example_action', $arg1, $arg2 ); … … 451 451 } 452 452 453 // Do 'all' actions first 453 // Do 'all' actions first. 454 454 if ( isset( $wp_filter['all'] ) ) { 455 455 $wp_current_filter[] = $tag; … … 524 524 } 525 525 526 // Do 'all' actions first 526 // Do 'all' actions first. 527 527 if ( isset( $wp_filter['all'] ) ) { 528 528 $wp_current_filter[] = $tag; … … 693 693 $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR ); 694 694 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 ); 696 697 $file = trim( $file, '/' ); 697 698 return $file; … … 718 719 global $wp_plugin_paths; 719 720 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. 721 722 static $wp_plugin_path = null, $wpmu_plugin_path = null; 722 723 if ( ! isset( $wp_plugin_path ) ) {
Note: See TracChangeset
for help on using the changeset viewer.