Make WordPress Core

Ticket #49572: 49572.returning-from-filter.diff

File 49572.returning-from-filter.diff, 13.8 KB (added by SergeyBiryukov, 4 years ago)
  • src/wp-admin/includes/export.php

     
    328328                        /**
    329329                         * Filters whether to selectively skip term meta used for WXR exports.
    330330                         *
    331                          * Returning a truthy value to the filter will skip the current meta
     331                         * Returning a truthy value from the filter will skip the current meta
    332332                         * object from being exported.
    333333                         *
    334334                         * @since 4.6.0
     
    595595                                        /**
    596596                                         * Filters whether to selectively skip post meta used for WXR exports.
    597597                                         *
    598                                          * Returning a truthy value to the filter will skip the current meta
     598                                         * Returning a truthy value from the filter will skip the current meta
    599599                                         * object from being exported.
    600600                                         *
    601601                                         * @since 3.3.0
     
    638638                                                /**
    639639                                                 * Filters whether to selectively skip comment meta used for WXR exports.
    640640                                                 *
    641                                                  * Returning a truthy value to the filter will skip the current meta
     641                                                 * Returning a truthy value from the filter will skip the current meta
    642642                                                 * object from being exported.
    643643                                                 *
    644644                                                 * @since 4.0.0
  • src/wp-admin/includes/file.php

     
    880880        /**
    881881         * Filters whether to short-circuit moving the uploaded file after passing all checks.
    882882         *
    883          * If a non-null value is passed to the filter, moving the file and any related error
    884          * reporting will be completely skipped.
     883         * If a non-null value is returned from the filter, moving the file and any related
     884         * error reporting will be completely skipped.
    885885         *
    886886         * @since 4.9.0
    887887         *
  • src/wp-admin/includes/media.php

     
    208208         *
    209209         * @since 2.6.0
    210210         *
    211          * @param bool $bool Whether to disable appending captions. Returning true to the filter
     211         * @param bool $bool Whether to disable appending captions. Returning true from the filter
    212212         *                   will disable captions. Default empty string.
    213213         */
    214214        if ( empty( $caption ) || apply_filters( 'disable_captions', '' ) ) {
  • src/wp-admin/includes/misc.php

     
    695695                                         * The filter can also be used to modify non-standard [items]_per_page
    696696                                         * settings. See the parent function for a full list of standard options.
    697697                                         *
    698                                          * Returning false to the filter will skip saving the current option.
     698                                         * Returning false from the filter will skip saving the current option.
    699699                                         *
    700700                                         * @since 2.8.0
    701701                                         * @since 5.4.2 Only applied to options ending with '_page',
     
    716716                                 *
    717717                                 * The dynamic portion of the hook, `$option`, refers to the option name.
    718718                                 *
    719                                  * Returning false to the filter will skip saving the current option.
     719                                 * Returning false from the filter will skip saving the current option.
    720720                                 *
    721721                                 * @since 5.4.2
    722722                                 *
  • src/wp-includes/canonical.php

     
    849849        /**
    850850         * Filters whether to attempt to guess a redirect URL for a 404 request.
    851851         *
    852          * Passing a false value to the filter will disable the URL guessing
     852         * Returning a false value from the filter will disable the URL guessing
    853853         * and return early.
    854854         *
    855855         * @since 5.5.0
     
    864864        /**
    865865         * Filters whether to short-circuit redirect URL guessing for 404 requests.
    866866         *
    867          * Passing a non-null value to the filter will effectively short-circuit
     867         * Returning a non-null value from the filter will effectively short-circuit
    868868         * the URL guessing, returning the passed value instead.
    869869         *
    870870         * @since 5.5.0
     
    881881                /**
    882882                 * Filters whether to perform a strict or loose guess.
    883883                 *
    884                  * Passing a truthy value to the filter will redirect only exact post_name matches.
     884                 * Returning a truthy value from the filter will redirect only exact post_name matches.
    885885                 *
    886886                 * @since 5.5.0
    887887                 *
  • src/wp-includes/class-wp-oembed.php

     
    381381                 * This allows one to short-circuit the default logic, perhaps by
    382382                 * replacing it with a routine that is more optimal for your setup.
    383383                 *
    384                  * Passing a non-null value to the filter will effectively short-circuit retrieval,
    385                  * returning the passed value instead.
     384                 * Returning a non-null value from the filter will effectively short-circuit retrieval
     385                 * and return the passed value instead.
    386386                 *
    387387                 * @since 4.5.3
    388388                 *
  • src/wp-includes/comment.php

     
    831831         * Filters a comment's approval status before it is set.
    832832         *
    833833         * @since 2.1.0
    834          * @since 4.9.0 Returning a WP_Error value from the filter will shortcircuit comment insertion
     834         * @since 4.9.0 Returning a WP_Error value from the filter will short-circuit comment insertion
    835835         *              and allow skipping further processing.
    836836         *
    837837         * @param int|string|WP_Error $approved    The approval status. Accepts 1, 0, 'spam', 'trash',
  • src/wp-includes/formatting.php

     
    6464                /**
    6565                 * Filters whether to skip running wptexturize().
    6666                 *
    67                  * Passing false to the filter will effectively short-circuit wptexturize().
    68                  * returning the original text passed to the function instead.
     67                 * Returning false from the filter will effectively short-circuit wptexturize()
     68                 * and return the original text passed to the function instead.
    6969                 *
    7070                 * The filter runs only once, the first time wptexturize() is called.
    7171                 *
  • src/wp-includes/functions.php

     
    26542654        /**
    26552655         * Filters whether to treat the upload bits as an error.
    26562656         *
    2657          * Returning a non-array from the filter will effectively short-circuit preparing the upload
    2658          * bits, returning that value instead. An error message should be returned as a string.
     2657         * Returning a non-array from the filter will effectively short-circuit preparing the upload bits
     2658         * and return that value instead. An error message should be returned as a string.
    26592659         *
    26602660         * @since 3.0.0
    26612661         *
     
    45784578        /**
    45794579         * Filters whether to load the Widgets library.
    45804580         *
    4581          * Passing a falsey value to the filter will effectively short-circuit
     4581         * Returning a falsey value from the filter will effectively short-circuit
    45824582         * the Widgets library from loading.
    45834583         *
    45844584         * @since 2.8.0
     
    55805580                /**
    55815581                 * Filters whether global terms are enabled.
    55825582                 *
    5583                  * Passing a non-null value to the filter will effectively short-circuit the function,
    5584                  * returning the value of the 'global_terms_enabled' site option instead.
     5583                 * Returning a non-null value from the filter will effectively short-circuit the function
     5584                 * and return the value of the 'global_terms_enabled' site option instead.
    55855585                 *
    55865586                 * @since 3.0.0
    55875587                 *
     
    64486448        /**
    64496449         * Filters whether to load the authentication check.
    64506450         *
    6451          * Passing a falsey value to the filter will effectively short-circuit
     6451         * Returning a falsey value from the filter will effectively short-circuit
    64526452         * loading the authentication check.
    64536453         *
    64546454         * @since 3.6.0
  • src/wp-includes/link-template.php

     
    38573857        /**
    38583858         * Filters whether to preempt generating a shortlink for the given post.
    38593859         *
    3860          * Passing a truthy value to the filter will effectively short-circuit the
    3861          * shortlink-generation process, returning that value instead.
     3860         * Returning a truthy value from the filter will effectively short-circuit
     3861         * the shortlink generation process, returning that value instead.
    38623862         *
    38633863         * @since 3.0.0
    38643864         *
  • src/wp-includes/media.php

     
    541541        /**
    542542         * Filters whether to preempt calculating the image resize dimensions.
    543543         *
    544          * Passing a non-null value to the filter will effectively short-circuit
     544         * Returning a non-null value from the filter will effectively short-circuit
    545545         * image_resize_dimensions(), returning that value instead.
    546546         *
    547547         * @since 3.4.0
     
    16251625 * @see wp_img_tag_add_srcset_and_sizes_attr()
    16261626 *
    16271627 * @param string $content The HTML content to be filtered.
    1628  * @param string $context Optional. Additional context to pass to the filters. Defaults to `current_filter()` when not set.
     1628 * @param string $context Optional. Additional context to pass to the filters.
     1629 *                        Defaults to `current_filter()` when not set.
    16291630 * @return string Converted content with images modified.
    16301631 */
    16311632function wp_filter_content_tags( $content, $context = null ) {
     
    23692370        /**
    23702371         * Filters the playlist output.
    23712372         *
    2372          * Passing a non-empty value to the filter will short-circuit generation
     2373         * Returning a non-empty value from the filter will short-circuit generation
    23732374         * of the default playlist output, returning the passed value instead.
    23742375         *
    23752376         * @since 3.9.0
  • src/wp-includes/nav-menu-template.php

     
    8989        /**
    9090         * Filters whether to short-circuit the wp_nav_menu() output.
    9191         *
    92          * Passing a non-null value to the filter will short-circuit
    93          * wp_nav_menu(), echoing that value if $args->echo is true,
    94          * returning that value otherwise.
     92         * Returning a non-null value from the filter will short-circuit wp_nav_menu(),
     93         * echoing that value if $args->echo is true, returning that value otherwise.
    9594         *
    9695         * @since 3.9.0
    9796         *
  • src/wp-includes/option.php

     
    4040         *
    4141         * The dynamic portion of the hook name, `$option`, refers to the option name.
    4242         *
    43          * Passing a truthy value to the filter will short-circuit retrieving
     43         * Returning a truthy value from the filter will short-circuit retrieving
    4444         * the option value, returning the passed value instead.
    4545         *
    4646         * @since 1.5.0
     
    687687         *
    688688         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
    689689         *
    690          * Passing a truthy value to the filter will effectively short-circuit retrieval
     690         * Returning a truthy value from the filter will effectively short-circuit retrieval
    691691         * of the transient, returning the passed value instead.
    692692         *
    693693         * @since 2.8.0
     
    12371237         *
    12381238         * The dynamic portion of the hook name, `$option`, refers to the option name.
    12391239         *
    1240          * Passing a truthy value to the filter will effectively short-circuit retrieval,
    1241          * returning the passed value instead.
     1240         * Returning a truthy value from the filter will effectively short-circuit retrieval
     1241         * and return the passed value instead.
    12421242         *
    12431243         * @since 2.9.0 As 'pre_site_option_' . $key
    12441244         * @since 3.0.0
     
    17501750         *
    17511751         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
    17521752         *
    1753          * Passing a truthy value to the filter will effectively short-circuit retrieval,
    1754          * returning the passed value instead.
     1753         * Returning a truthy value from the filter will effectively short-circuit retrieval
     1754         * and return the passed value instead.
    17551755         *
    17561756         * @since 2.9.0
    17571757         * @since 4.4.0 The `$transient` parameter was added.
  • src/wp-includes/post.php

     
    36853685         * 1. The post type supports the title, editor, and excerpt fields
    36863686         * 2. The title, editor, and excerpt fields are all empty
    36873687         *
    3688          * Passing a truthy value to the filter will effectively short-circuit
    3689          * the new post being inserted, returning 0. If $wp_error is true, a WP_Error
     3688         * Returning a truthy value from the filter will effectively short-circuit
     3689         * the new post being inserted and return 0. If $wp_error is true, a WP_Error
    36903690         * will be returned instead.
    36913691         *
    36923692         * @since 3.3.0
  • src/wp-includes/user.php

     
    608608        /**
    609609         * Filters the list of a user's sites before it is populated.
    610610         *
    611          * Passing a non-null value to the filter will effectively short circuit
     611         * Returning a non-null value from the filter will effectively short circuit
    612612         * get_blogs_of_user(), returning that value instead.
    613613         *
    614614         * @since 4.6.0