WordPress.org

Make WordPress Core

Changeset 49963


Ignore:
Timestamp:
01/15/2021 08:06:50 PM (9 months ago)
Author:
SergeyBiryukov
Message:

Docs: In various @return tags, list the expected type first, instead of false.

Follow-up to [46696], [47060], [49926], [49927], [49929].

See #51800.

Location:
trunk/src/wp-includes
Files:
8 edited

Legend:

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

    r49927 r49963  
    2828     * @param string $supports Optional, not used. When implemented it will choose
    2929     *                         the right compression based on what the server supports.
    30      * @return string|false False on failure.
     30     * @return string|false Compressed string on success, false on failure.
    3131     */
    3232    public static function compress( $raw, $level = 9, $supports = null ) {
     
    4646     * @param string $compressed String to decompress.
    4747     * @param int    $length     The optional length of the compressed data.
    48      * @return string|false False on failure.
     48     * @return string|false Decompressed string on success, false on failure.
    4949     */
    5050    public static function decompress( $compressed, $length = null ) {
     
    9999     *
    100100     * @param string $gzData String to decompress.
    101      * @return string|false False on failure.
     101     * @return string|false Decompressed string on success, false on failure.
    102102     */
    103103    public static function compatible_gzinflate( $gzData ) {
  • trunk/src/wp-includes/cron.php

    r49929 r49963  
    866866 * @param string $hook Action hook to identify the event.
    867867 * @param array  $args Optional. Arguments passed to the event's callback function.
    868  * @return string|false False, if no schedule. Schedule name on success.
     868 * @return string|false Schedule name on success, false if no schedule.
    869869 */
    870870function wp_get_schedule( $hook, $args = array() ) {
     
    948948 * @access private
    949949 *
    950  * @return array|false CRON info array.
     950 * @return array|false Cron info array on success, false on failure.
    951951 */
    952952function _get_cron_array() {
  • trunk/src/wp-includes/l10n.php

    r49936 r49963  
    999999 * @param string $domain Optional. Text domain. Default 'default'.
    10001000 * @param string $path   Optional. The full file path to the directory containing translation files.
    1001  * @return string|false False if the script textdomain could not be loaded, the translated strings
    1002  *                      in JSON encoding otherwise.
     1001 * @return string|false The translated strings in JSON encoding on success,
     1002 *                      false if the script textdomain could not be loaded.
    10031003 */
    10041004function load_script_textdomain( $handle, $domain = 'default', $path = null ) {
     
    11301130 * @param string       $handle Name of the script to register a translation domain to.
    11311131 * @param string       $domain The text domain.
    1132  * @return string|false The JSON-encoded translated strings for the given script handle and text domain. False if there are none.
     1132 * @return string|false The JSON-encoded translated strings for the given script handle and text domain.
     1133 *                      False if there are none.
    11331134 */
    11341135function load_script_translations( $file, $handle, $domain ) {
  • trunk/src/wp-includes/nav-menu.php

    r49108 r49963  
    1414 *
    1515 * @param int|string|WP_Term $menu Menu ID, slug, name, or object.
    16  * @return WP_Term|false False if $menu param isn't supplied or term does not exist, menu object if successful.
     16 * @return WP_Term|false Menu object on success, false if $menu param isn't supplied or term does not exist.
    1717 */
    1818function wp_get_nav_menu_object( $menu ) {
  • trunk/src/wp-includes/post.php

    r49936 r49963  
    62246224 *
    62256225 * @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`.
    6226  * @return string|false False on failure. Attachment caption on success.
     6226 * @return string|false Attachment caption on success, false on failure.
    62276227 */
    62286228function wp_get_attachment_caption( $post_id = 0 ) {
     
    62576257 *
    62586258 * @param int $post_id Optional. Attachment ID. Default 0.
    6259  * @return string|false False on failure. Thumbnail file path on success.
     6259 * @return string|false Thumbnail file path on success, false on failure.
    62606260 */
    62616261function wp_get_attachment_thumb_file( $post_id = 0 ) {
     
    62976297 *
    62986298 * @param int $post_id Optional. Attachment ID. Default 0.
    6299  * @return string|false False on failure. Thumbnail URL on success.
     6299 * @return string|false Thumbnail URL on success, false on failure.
    63006300 */
    63016301function wp_get_attachment_thumb_url( $post_id = 0 ) {
  • trunk/src/wp-includes/shortcodes.php

    r49193 r49963  
    300300 * @global array $shortcode_tags
    301301 *
    302  * @param array $m Regular expression match array
    303  * @return string|false False on failure.
     302 * @param array $m Regular expression match array.
     303 * @return string|false Shortcode output on success, false on failure.
    304304 */
    305305function do_shortcode_tag( $m ) {
  • trunk/src/wp-includes/taxonomy.php

    r49947 r49963  
    47254725 * @param int    $term_id  Term ID.
    47264726 * @param string $taxonomy Taxonomy name.
    4727  * @return int|false False on error.
     4727 * @return int|false Parent term ID on success, false on failure.
    47284728 */
    47294729function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {
  • trunk/src/wp-includes/widgets.php

    r49790 r49963  
    880880 * @global array $wp_registered_widgets
    881881 *
    882  * @param callable|false $callback      Optional, Widget callback to check. Default false.
    883  * @param int|false      $widget_id     Optional. Widget ID. Optional, but needed for checking. Default false.
    884  * @param string|false   $id_base       Optional. The base ID of a widget created by extending WP_Widget. Default false.
    885  * @param bool           $skip_inactive Optional. Whether to check in 'wp_inactive_widgets'. Default true.
    886  * @return string|false False if widget is not active or id of sidebar in which the widget is active.
     882 * @param callable|false $callback      Optional. Widget callback to check. Default false.
     883 * @param int|false      $widget_id     Optional. Widget ID. Optional, but needed for checking.
     884 *                                      Default false.
     885 * @param string|false   $id_base       Optional. The base ID of a widget created by extending WP_Widget.
     886 *                                      Default false.
     887 * @param bool           $skip_inactive Optional. Whether to check in 'wp_inactive_widgets'.
     888 *                                      Default true.
     889 * @return string|false ID of the sidebar in which the widget is active,
     890 *                      false if the widget is not active.
    887891 */
    888892function is_active_widget( $callback = false, $widget_id = false, $id_base = false, $skip_inactive = true ) {
Note: See TracChangeset for help on using the changeset viewer.