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

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

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49963


git-svn-id: http://core.svn.wordpress.org/trunk@49664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-01-15 20:08:07 +00:00
parent 585303540a
commit 5c663524c2
9 changed files with 26 additions and 21 deletions

View File

@ -27,7 +27,7 @@ class WP_Http_Encoding {
* @param int $level Optional. Compression level, 9 is highest. Default 9.
* @param string $supports Optional, not used. When implemented it will choose
* the right compression based on what the server supports.
* @return string|false False on failure.
* @return string|false Compressed string on success, false on failure.
*/
public static function compress( $raw, $level = 9, $supports = null ) {
return gzdeflate( $raw, $level );
@ -45,7 +45,7 @@ class WP_Http_Encoding {
*
* @param string $compressed String to decompress.
* @param int $length The optional length of the compressed data.
* @return string|false False on failure.
* @return string|false Decompressed string on success, false on failure.
*/
public static function decompress( $compressed, $length = null ) {
@ -98,7 +98,7 @@ class WP_Http_Encoding {
* @link https://www.php.net/manual/en/function.gzinflate.php#77336
*
* @param string $gzData String to decompress.
* @return string|false False on failure.
* @return string|false Decompressed string on success, false on failure.
*/
public static function compatible_gzinflate( $gzData ) {

View File

@ -865,7 +865,7 @@ function wp_get_schedules() {
*
* @param string $hook Action hook to identify the event.
* @param array $args Optional. Arguments passed to the event's callback function.
* @return string|false False, if no schedule. Schedule name on success.
* @return string|false Schedule name on success, false if no schedule.
*/
function wp_get_schedule( $hook, $args = array() ) {
$schedule = false;
@ -947,7 +947,7 @@ function wp_get_ready_cron_jobs() {
* @since 2.1.0
* @access private
*
* @return array|false CRON info array.
* @return array|false Cron info array on success, false on failure.
*/
function _get_cron_array() {
$cron = get_option( 'cron' );

View File

@ -998,8 +998,8 @@ function load_child_theme_textdomain( $domain, $path = false ) {
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain Optional. Text domain. Default 'default'.
* @param string $path Optional. The full file path to the directory containing translation files.
* @return string|false False if the script textdomain could not be loaded, the translated strings
* in JSON encoding otherwise.
* @return string|false The translated strings in JSON encoding on success,
* false if the script textdomain could not be loaded.
*/
function load_script_textdomain( $handle, $domain = 'default', $path = null ) {
$wp_scripts = wp_scripts();
@ -1129,7 +1129,8 @@ function load_script_textdomain( $handle, $domain = 'default', $path = null ) {
* @param string|false $file Path to the translation file to load. False if there isn't one.
* @param string $handle Name of the script to register a translation domain to.
* @param string $domain The text domain.
* @return string|false The JSON-encoded translated strings for the given script handle and text domain. False if there are none.
* @return string|false The JSON-encoded translated strings for the given script handle and text domain.
* False if there are none.
*/
function load_script_translations( $file, $handle, $domain ) {
/**

View File

@ -13,7 +13,7 @@
* @since 3.0.0
*
* @param int|string|WP_Term $menu Menu ID, slug, name, or object.
* @return WP_Term|false False if $menu param isn't supplied or term does not exist, menu object if successful.
* @return WP_Term|false Menu object on success, false if $menu param isn't supplied or term does not exist.
*/
function wp_get_nav_menu_object( $menu ) {
$menu_obj = false;

View File

@ -6223,7 +6223,7 @@ function wp_get_attachment_url( $attachment_id = 0 ) {
* @since 4.6.0
*
* @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`.
* @return string|false False on failure. Attachment caption on success.
* @return string|false Attachment caption on success, false on failure.
*/
function wp_get_attachment_caption( $post_id = 0 ) {
$post_id = (int) $post_id;
@ -6256,7 +6256,7 @@ function wp_get_attachment_caption( $post_id = 0 ) {
* @since 2.1.0
*
* @param int $post_id Optional. Attachment ID. Default 0.
* @return string|false False on failure. Thumbnail file path on success.
* @return string|false Thumbnail file path on success, false on failure.
*/
function wp_get_attachment_thumb_file( $post_id = 0 ) {
$post_id = (int) $post_id;
@ -6296,7 +6296,7 @@ function wp_get_attachment_thumb_file( $post_id = 0 ) {
* @since 2.1.0
*
* @param int $post_id Optional. Attachment ID. Default 0.
* @return string|false False on failure. Thumbnail URL on success.
* @return string|false Thumbnail URL on success, false on failure.
*/
function wp_get_attachment_thumb_url( $post_id = 0 ) {
$post_id = (int) $post_id;

View File

@ -299,8 +299,8 @@ function get_shortcode_regex( $tagnames = null ) {
*
* @global array $shortcode_tags
*
* @param array $m Regular expression match array
* @return string|false False on failure.
* @param array $m Regular expression match array.
* @return string|false Shortcode output on success, false on failure.
*/
function do_shortcode_tag( $m ) {
global $shortcode_tags;

View File

@ -4724,7 +4724,7 @@ function get_ancestors( $object_id = 0, $object_type = '', $resource_type = '' )
*
* @param int $term_id Term ID.
* @param string $taxonomy Taxonomy name.
* @return int|false False on error.
* @return int|false Parent term ID on success, false on failure.
*/
function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) {
$term = get_term( $term_id, $taxonomy );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-49962';
$wp_version = '5.7-alpha-49963';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -879,11 +879,15 @@ function dynamic_sidebar( $index = 1 ) {
*
* @global array $wp_registered_widgets
*
* @param callable|false $callback Optional, Widget callback to check. Default false.
* @param int|false $widget_id Optional. Widget ID. Optional, but needed for checking. Default false.
* @param string|false $id_base Optional. The base ID of a widget created by extending WP_Widget. Default false.
* @param bool $skip_inactive Optional. Whether to check in 'wp_inactive_widgets'. Default true.
* @return string|false False if widget is not active or id of sidebar in which the widget is active.
* @param callable|false $callback Optional. Widget callback to check. Default false.
* @param int|false $widget_id Optional. Widget ID. Optional, but needed for checking.
* Default false.
* @param string|false $id_base Optional. The base ID of a widget created by extending WP_Widget.
* Default false.
* @param bool $skip_inactive Optional. Whether to check in 'wp_inactive_widgets'.
* Default true.
* @return string|false ID of the sidebar in which the widget is active,
* false if the widget is not active.
*/
function is_active_widget( $callback = false, $widget_id = false, $id_base = false, $skip_inactive = true ) {
global $wp_registered_widgets;