Docs: Promote many `bool` types to `true` or `false` where only that value is used.

See #51800

Built from https://develop.svn.wordpress.org/trunk@49927


git-svn-id: http://core.svn.wordpress.org/trunk@49626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2021-01-03 22:04:04 +00:00
parent 53da9208dd
commit dfe1f9b322
60 changed files with 170 additions and 170 deletions

View File

@ -29,7 +29,7 @@ class WP_Community_Events {
* *
* @since 4.8.0 * @since 4.8.0
* *
* @var bool|array * @var false|array
*/ */
protected $user_location = false; protected $user_location = false;
@ -306,7 +306,7 @@ class WP_Community_Events {
* @since 4.8.0 * @since 4.8.0
* *
* @param array $location Should contain 'latitude' and 'longitude' indexes. * @param array $location Should contain 'latitude' and 'longitude' indexes.
* @return bool|string false on failure, or a string on success. * @return false|string false on failure, or a string on success.
*/ */
protected function get_events_transient_key( $location ) { protected function get_events_transient_key( $location ) {
$key = false; $key = false;
@ -326,7 +326,7 @@ class WP_Community_Events {
* @since 4.8.0 * @since 4.8.0
* *
* @param array $events Response body from the API request. * @param array $events Response body from the API request.
* @param int|bool $expiration Optional. Amount of time to cache the events. Defaults to false. * @param int|false $expiration Optional. Amount of time to cache the events. Defaults to false.
* @return bool true if events were cached; false if not. * @return bool true if events were cached; false if not.
*/ */
protected function cache_events( $events, $expiration = false ) { protected function cache_events( $events, $expiration = false ) {

View File

@ -128,7 +128,7 @@ class WP_Site_Health_Auto_Updates {
* *
* @since 5.3.0 * @since 5.3.0
* *
* @return array|bool The test results. False if auto-updates are enabled. * @return array|false The test results. False if auto-updates are enabled.
*/ */
public function test_wp_automatic_updates_disabled() { public function test_wp_automatic_updates_disabled() {
if ( ! class_exists( 'WP_Automatic_Updater' ) ) { if ( ! class_exists( 'WP_Automatic_Updater' ) ) {
@ -152,7 +152,7 @@ class WP_Site_Health_Auto_Updates {
* *
* @since 5.2.0 * @since 5.2.0
* *
* @return array|bool The test results. False if the auto-updates failed. * @return array|false The test results. False if the auto-updates failed.
*/ */
function test_if_failed_update() { function test_if_failed_update() {
$failed = get_site_option( 'auto_core_update_failed' ); $failed = get_site_option( 'auto_core_update_failed' );
@ -302,7 +302,7 @@ class WP_Site_Health_Auto_Updates {
* *
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
* *
* @return array|bool The test results. False if they're not writeable. * @return array|false The test results. False if they're not writeable.
*/ */
function test_all_files_writable() { function test_all_files_writable() {
global $wp_filesystem; global $wp_filesystem;
@ -387,7 +387,7 @@ class WP_Site_Health_Auto_Updates {
* *
* @since 5.2.0 * @since 5.2.0
* *
* @return array|bool The test results. False if it isn't a development version. * @return array|false The test results. False if it isn't a development version.
*/ */
function test_accepts_dev_updates() { function test_accepts_dev_updates() {
require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z

View File

@ -1680,7 +1680,7 @@ function dashboard_browser_nag_class( $classes ) {
* *
* @since 3.2.0 * @since 3.2.0
* *
* @return array|bool Array of browser data on success, false on failure. * @return array|false Array of browser data on success, false on failure.
*/ */
function wp_check_browser_version() { function wp_check_browser_version() {
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {

View File

@ -247,7 +247,7 @@ function get_author_user_ids() {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @return array|bool List of editable authors. False if no editable users. * @return array|false List of editable authors. False if no editable users.
*/ */
function get_editable_authors( $user_id ) { function get_editable_authors( $user_id ) {
_deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' ); _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );

View File

@ -130,7 +130,7 @@ function get_home_path() {
* @param string $folder Optional. Full path to folder. Default empty. * @param string $folder Optional. Full path to folder. Default empty.
* @param int $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit). * @param int $levels Optional. Levels of folders to follow, Default 100 (PHP Loop limit).
* @param string[] $exclusions Optional. List of folders and files to skip. * @param string[] $exclusions Optional. List of folders and files to skip.
* @return bool|string[] False on failure, else array of files. * @return false|string[] False on failure, else array of files.
*/ */
function list_files( $folder = '', $levels = 100, $exclusions = array() ) { function list_files( $folder = '', $levels = 100, $exclusions = array() ) {
if ( empty( $folder ) ) { if ( empty( $folder ) ) {
@ -1000,7 +1000,7 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) {
* *
* @param array $file Reference to a single element of `$_FILES`. * @param array $file Reference to a single element of `$_FILES`.
* Call the function once for each uploaded file. * Call the function once for each uploaded file.
* @param array|bool $overrides Optional. An associative array of names => values * @param array|false $overrides Optional. An associative array of names => values
* to override default variables. Default false. * to override default variables. Default false.
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
* @return array On success, returns an associative array of file attributes. * @return array On success, returns an associative array of file attributes.
@ -1031,7 +1031,7 @@ function wp_handle_upload( &$file, $overrides = false, $time = null ) {
* *
* @param array $file Reference to a single element of `$_FILES`. * @param array $file Reference to a single element of `$_FILES`.
* Call the function once for each uploaded file. * Call the function once for each uploaded file.
* @param array|bool $overrides Optional. An associative array of names => values * @param array|false $overrides Optional. An associative array of names => values
* to override default variables. Default false. * to override default variables. Default false.
* @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null.
* @return array On success, returns an associative array of file attributes. * @return array On success, returns an associative array of file attributes.

View File

@ -12,7 +12,7 @@
* @since 2.9.0 * @since 2.9.0
* *
* @param int $post_id Attachment post ID. * @param int $post_id Attachment post ID.
* @param bool|object $msg Optional. Message to display for image editor updates or errors. * @param false|object $msg Optional. Message to display for image editor updates or errors.
* Default false. * Default false.
*/ */
function wp_image_editor( $post_id, $msg = false ) { function wp_image_editor( $post_id, $msg = false ) {

View File

@ -680,7 +680,7 @@ function wp_exif_date2ts( $str ) {
* @since 2.5.0 * @since 2.5.0
* *
* @param string $file * @param string $file
* @return bool|array False on failure. Image metadata array on success. * @return false|array False on failure. Image metadata array on success.
*/ */
function wp_read_image_metadata( $file ) { function wp_read_image_metadata( $file ) {
if ( ! file_exists( $file ) ) { if ( ! file_exists( $file ) ) {
@ -1027,7 +1027,7 @@ function _load_image_to_edit_path( $attachment_id, $size = 'full' ) {
* *
* @since 2.9.0 * @since 2.9.0
* *
* @param string|bool $filepath File path or URL to current image, or false. * @param string|false $filepath File path or URL to current image, or false.
* @param int $attachment_id Attachment ID. * @param int $attachment_id Attachment ID.
* @param string|int[] $size Requested image size. Can be any registered image size name, or * @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order). * an array of width and height values in pixels (in that order).

View File

@ -17,7 +17,7 @@
* *
* @param string $class The type of the list table, which is the class name. * @param string $class The type of the list table, which is the class name.
* @param array $args Optional. Arguments to pass to the class. Accepts 'screen'. * @param array $args Optional. Arguments to pass to the class. Accepts 'screen'.
* @return WP_List_Table|bool List table object on success, false if the class does not exist. * @return WP_List_Table|false List table object on success, false if the class does not exist.
*/ */
function _get_list_table( $class, $args = array() ) { function _get_list_table( $class, $args = array() ) {
$core_classes = array( $core_classes = array(

View File

@ -3526,7 +3526,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
* @since 3.6.0 * @since 3.6.0
* *
* @param string $file Path to file. * @param string $file Path to file.
* @return array|bool Returns array of metadata, if found. * @return array|false Returns array of metadata, if found.
*/ */
function wp_read_video_metadata( $file ) { function wp_read_video_metadata( $file ) {
if ( ! file_exists( $file ) ) { if ( ! file_exists( $file ) ) {
@ -3637,7 +3637,7 @@ function wp_read_video_metadata( $file ) {
* @since 3.6.0 * @since 3.6.0
* *
* @param string $file Path to file. * @param string $file Path to file.
* @return array|bool Returns array of metadata, if found. * @return array|false Returns array of metadata, if found.
*/ */
function wp_read_audio_metadata( $file ) { function wp_read_audio_metadata( $file ) {
if ( ! file_exists( $file ) ) { if ( ! file_exists( $file ) ) {
@ -3706,7 +3706,7 @@ function wp_read_audio_metadata( $file ) {
* @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt * @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt
* *
* @param array $metadata The metadata returned by getID3::analyze(). * @param array $metadata The metadata returned by getID3::analyze().
* @return int|bool A UNIX timestamp for the media's creation date if available * @return int|false A UNIX timestamp for the media's creation date if available
* or a boolean FALSE if a timestamp could not be determined. * or a boolean FALSE if a timestamp could not be determined.
*/ */
function wp_get_media_creation_timestamp( $metadata ) { function wp_get_media_creation_timestamp( $metadata ) {

View File

@ -311,7 +311,7 @@ function upload_space_setting( $id ) {
* @since 3.0.0 * @since 3.0.0
* *
* @param int $id The user ID. * @param int $id The user ID.
* @return bool|int The ID of the refreshed user or false if the user does not exist. * @return false|int The ID of the refreshed user or false if the user does not exist.
*/ */
function refresh_user_details( $id ) { function refresh_user_details( $id ) {
$id = (int) $id; $id = (int) $id;

View File

@ -1763,7 +1763,7 @@ function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $
* @global array $menu * @global array $menu
* *
* @param string $menu_slug The slug of the menu. * @param string $menu_slug The slug of the menu.
* @return array|bool The removed menu on success, false if not found. * @return array|false The removed menu on success, false if not found.
*/ */
function remove_menu_page( $menu_slug ) { function remove_menu_page( $menu_slug ) {
global $menu; global $menu;
@ -1787,7 +1787,7 @@ function remove_menu_page( $menu_slug ) {
* *
* @param string $menu_slug The slug for the parent menu. * @param string $menu_slug The slug for the parent menu.
* @param string $submenu_slug The slug of the submenu. * @param string $submenu_slug The slug of the submenu.
* @return array|bool The removed submenu on success, false if not found. * @return array|false The removed submenu on success, false if not found.
*/ */
function remove_submenu_page( $menu_slug, $submenu_slug ) { function remove_submenu_page( $menu_slug, $submenu_slug ) {
global $submenu; global $submenu;

View File

@ -1115,7 +1115,7 @@ function get_available_post_statuses( $type = 'post' ) {
* *
* @since 2.5.0 * @since 2.5.0
* *
* @param array|bool $q Array of query variables to use to build the query or false to use $_GET superglobal. * @param array|false $q Array of query variables to use to build the query or false to use $_GET superglobal.
* @return array * @return array
*/ */
function wp_edit_posts_query( $q = false ) { function wp_edit_posts_query( $q = false ) {

View File

@ -13,7 +13,7 @@
* @access private * @access private
* *
* @param int $request_id Request ID. * @param int $request_id Request ID.
* @return bool|WP_Error Returns true if sending the email was successful, or a WP_Error object. * @return true|WP_Error Returns true if sending the email was successful, or a WP_Error object.
*/ */
function _wp_privacy_resend_request( $request_id ) { function _wp_privacy_resend_request( $request_id ) {
$request_id = absint( $request_id ); $request_id = absint( $request_id );

View File

@ -15,7 +15,7 @@
* @param WP_Post|int $post The post object or post ID. * @param WP_Post|int $post The post object or post ID.
* @param int $compare_from The revision ID to compare from. * @param int $compare_from The revision ID to compare from.
* @param int $compare_to The revision ID to come to. * @param int $compare_to The revision ID to come to.
* @return array|bool Associative array of a post's revisioned fields and their diffs. * @return array|false Associative array of a post's revisioned fields and their diffs.
* Or, false on failure. * Or, false on failure.
*/ */
function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) { function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {

View File

@ -183,7 +183,7 @@ function wp_insert_category( $catarr, $wp_error = false ) {
* @since 2.0.0 * @since 2.0.0
* *
* @param array $catarr The 'cat_ID' value is required. All other keys are optional. * @param array $catarr The 'cat_ID' value is required. All other keys are optional.
* @return int|bool The ID number of the new or updated Category on success. Zero or FALSE on failure. * @return int|false The ID number of the new or updated Category on success. Zero or FALSE on failure.
*/ */
function wp_update_category( $catarr ) { function wp_update_category( $catarr ) {
$cat_ID = (int) $catarr['cat_ID']; $cat_ID = (int) $catarr['cat_ID'];
@ -240,7 +240,7 @@ function wp_create_tag( $tag_name ) {
* *
* @param int $post_id * @param int $post_id
* @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
* @return string|bool|WP_Error * @return string|false|WP_Error
*/ */
function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) { function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {
return get_terms_to_edit( $post_id, $taxonomy ); return get_terms_to_edit( $post_id, $taxonomy );
@ -253,7 +253,7 @@ function get_tags_to_edit( $post_id, $taxonomy = 'post_tag' ) {
* *
* @param int $post_id * @param int $post_id
* @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
* @return string|bool|WP_Error * @return string|false|WP_Error
*/ */
function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {
$post_id = (int) $post_id; $post_id = (int) $post_id;

View File

@ -206,7 +206,7 @@ function wp_install_language_form( $languages ) {
* @see wp_get_available_translations() * @see wp_get_available_translations()
* *
* @param string $download Language code to download. * @param string $download Language code to download.
* @return string|bool Returns the language code if successfully downloaded * @return string|false Returns the language code if successfully downloaded
* (or already installed), or false on failure. * (or already installed), or false on failure.
*/ */
function wp_download_language_pack( $download ) { function wp_download_language_pack( $download ) {

View File

@ -280,7 +280,7 @@ function get_editable_roles() {
* @since 2.0.5 * @since 2.0.5
* *
* @param int $user_id User ID. * @param int $user_id User ID.
* @return WP_User|bool WP_User object on success, false on failure. * @return WP_User|false WP_User object on success, false on failure.
*/ */
function get_user_to_edit( $user_id ) { function get_user_to_edit( $user_id ) {
$user = get_userdata( $user_id ); $user = get_userdata( $user_id );

View File

@ -99,7 +99,7 @@ function generate_block_asset_handle( $block_name, $field_name ) {
* *
* @param array $metadata Block metadata. * @param array $metadata Block metadata.
* @param string $field_name Field name to pick from metadata. * @param string $field_name Field name to pick from metadata.
* @return string|bool Script handle provided directly or created through * @return string|false Script handle provided directly or created through
* script's registration, or false on failure. * script's registration, or false on failure.
*/ */
function register_block_script_handle( $metadata, $field_name ) { function register_block_script_handle( $metadata, $field_name ) {
@ -146,7 +146,7 @@ function register_block_script_handle( $metadata, $field_name ) {
* *
* @param array $metadata Block metadata. * @param array $metadata Block metadata.
* @param string $field_name Field name to pick from metadata. * @param string $field_name Field name to pick from metadata.
* @return string|boolean Style handle provided directly or created through * @return string|false Style handle provided directly or created through
* style's registration, or false on failure. * style's registration, or false on failure.
*/ */
function register_block_style_handle( $metadata, $field_name ) { function register_block_style_handle( $metadata, $field_name ) {

View File

@ -1076,7 +1076,7 @@ class WP_Http {
* @since 3.7.0 * @since 3.7.0
* *
* @param string $maybe_ip A suspected IP address. * @param string $maybe_ip A suspected IP address.
* @return int|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure * @return int|false Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
*/ */
public static function is_ip_address( $maybe_ip ) { public static function is_ip_address( $maybe_ip ) {
if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) { if ( preg_match( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/', $maybe_ip ) ) {

View File

@ -319,7 +319,7 @@ final class WP_Comment {
* @since 4.4.0 * @since 4.4.0
* *
* @param int $child_id ID of the child. * @param int $child_id ID of the child.
* @return WP_Comment|bool Returns the comment object if found, otherwise false. * @return WP_Comment|false Returns the comment object if found, otherwise false.
*/ */
public function get_child( $child_id ) { public function get_child( $child_id ) {
if ( isset( $this->children[ $child_id ] ) ) { if ( isset( $this->children[ $child_id ] ) ) {

View File

@ -95,7 +95,7 @@ final class WP_Hook implements Iterator, ArrayAccess {
* *
* @since 4.7.0 * @since 4.7.0
* *
* @param bool|int $new_priority Optional. The priority of the new filter being added. Default false, * @param false|int $new_priority Optional. The priority of the new filter being added. Default false,
* for no priority being added. * for no priority being added.
* @param bool $priority_existed Optional. Flag for whether the priority already existed before the new * @param bool $priority_existed Optional. Flag for whether the priority already existed before the new
* filter was added. Default false. * filter was added. Default false.
@ -193,8 +193,8 @@ final class WP_Hook implements Iterator, ArrayAccess {
* @since 4.7.0 * @since 4.7.0
* *
* @param string $tag Optional. The name of the filter hook. Default empty. * @param string $tag Optional. The name of the filter hook. Default empty.
* @param callable|bool $function_to_check Optional. The callback to check for. Default false. * @param callable|false $function_to_check Optional. The callback to check for. Default false.
* @return bool|int The priority of that hook is returned, or false if the function is not attached. * @return false|int The priority of that hook is returned, or false if the function is not attached.
*/ */
public function has_filter( $tag = '', $function_to_check = false ) { public function has_filter( $tag = '', $function_to_check = false ) {
if ( false === $function_to_check ) { if ( false === $function_to_check ) {
@ -236,7 +236,7 @@ final class WP_Hook implements Iterator, ArrayAccess {
* *
* @since 4.7.0 * @since 4.7.0
* *
* @param int|bool $priority Optional. The priority number to remove. Default false. * @param int|false $priority Optional. The priority number to remove. Default false.
*/ */
public function remove_all_filters( $priority = false ) { public function remove_all_filters( $priority = false ) {
if ( ! $this->callbacks ) { if ( ! $this->callbacks ) {

View File

@ -45,7 +45,7 @@ class WP_Http_Encoding {
* *
* @param string $compressed String to decompress. * @param string $compressed String to decompress.
* @param int $length The optional length of the compressed data. * @param int $length The optional length of the compressed data.
* @return string|bool False on failure. * @return string|false False on failure.
*/ */
public static function decompress( $compressed, $length = null ) { 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 * @link https://www.php.net/manual/en/function.gzinflate.php#77336
* *
* @param string $gzData String to decompress. * @param string $gzData String to decompress.
* @return string|bool False on failure. * @return string|false False on failure.
*/ */
public static function compatible_gzinflate( $gzData ) { public static function compatible_gzinflate( $gzData ) {

View File

@ -14,8 +14,8 @@ class WP_HTTP_IXR_Client extends IXR_Client {
/** /**
* @param string $server * @param string $server
* @param string|bool $path * @param string|false $path
* @param int|bool $port * @param int|false $port
* @param int $timeout * @param int $timeout
*/ */
public function __construct( $server, $path = false, $port = false, $timeout = 15 ) { public function __construct( $server, $path = false, $port = false, $timeout = 15 ) {

View File

@ -79,7 +79,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* *
* @since 3.5.0 * @since 3.5.0
* *
* @return bool|WP_Error True if loaded successfully; WP_Error on failure. * @return true|WP_Error True if loaded successfully; WP_Error on failure.
*/ */
public function load() { public function load() {
if ( $this->image ) { if ( $this->image ) {
@ -311,7 +311,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* @param int $dst_w Optional. The destination width. * @param int $dst_w Optional. The destination width.
* @param int $dst_h Optional. The destination height. * @param int $dst_h Optional. The destination height.
* @param bool $src_abs Optional. If the source crop points are absolute. * @param bool $src_abs Optional. If the source crop points are absolute.
* @return bool|WP_Error * @return true|WP_Error
*/ */
public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
// If destination width/height isn't specified, // If destination width/height isn't specified,

View File

@ -252,7 +252,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @param int|null $max_w Image width. * @param int|null $max_w Image width.
* @param int|null $max_h Image height. * @param int|null $max_h Image height.
* @param bool $crop * @param bool $crop
* @return bool|WP_Error * @return true|WP_Error
*/ */
public function resize( $max_w, $max_h, $crop = false ) { public function resize( $max_w, $max_h, $crop = false ) {
if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) { if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) {
@ -524,7 +524,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @param int $dst_w Optional. The destination width. * @param int $dst_w Optional. The destination width.
* @param int $dst_h Optional. The destination height. * @param int $dst_h Optional. The destination height.
* @param bool $src_abs Optional. If the source crop points are absolute. * @param bool $src_abs Optional. If the source crop points are absolute.
* @return bool|WP_Error * @return true|WP_Error
*/ */
public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
if ( $src_abs ) { if ( $src_abs ) {
@ -775,7 +775,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* @since 3.5.0 * @since 3.5.0
* *
* @param string $mime_type The mime type of the image. * @param string $mime_type The mime type of the image.
* @return bool|WP_Error True on success, WP_Error object on failure. * @return true|WP_Error True on success, WP_Error object on failure.
*/ */
public function stream( $mime_type = null ) { public function stream( $mime_type = null ) {
list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type ); list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type );

View File

@ -64,7 +64,7 @@ abstract class WP_Image_Editor {
* @since 3.5.0 * @since 3.5.0
* @abstract * @abstract
* *
* @return bool|WP_Error True if loaded; WP_Error on failure. * @return true|WP_Error True if loaded; WP_Error on failure.
*/ */
abstract public function load(); abstract public function load();
@ -93,7 +93,7 @@ abstract class WP_Image_Editor {
* @param int|null $max_w Image width. * @param int|null $max_w Image width.
* @param int|null $max_h Image height. * @param int|null $max_h Image height.
* @param bool $crop * @param bool $crop
* @return bool|WP_Error * @return true|WP_Error
*/ */
abstract public function resize( $max_w, $max_h, $crop = false ); abstract public function resize( $max_w, $max_h, $crop = false );
@ -129,7 +129,7 @@ abstract class WP_Image_Editor {
* @param int $dst_w Optional. The destination width. * @param int $dst_w Optional. The destination width.
* @param int $dst_h Optional. The destination height. * @param int $dst_h Optional. The destination height.
* @param bool $src_abs Optional. If the source crop points are absolute. * @param bool $src_abs Optional. If the source crop points are absolute.
* @return bool|WP_Error * @return true|WP_Error
*/ */
abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ); abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
@ -140,7 +140,7 @@ abstract class WP_Image_Editor {
* @abstract * @abstract
* *
* @param float $angle * @param float $angle
* @return bool|WP_Error * @return true|WP_Error
*/ */
abstract public function rotate( $angle ); abstract public function rotate( $angle );
@ -152,7 +152,7 @@ abstract class WP_Image_Editor {
* *
* @param bool $horz Flip along Horizontal Axis * @param bool $horz Flip along Horizontal Axis
* @param bool $vert Flip along Vertical Axis * @param bool $vert Flip along Vertical Axis
* @return bool|WP_Error * @return true|WP_Error
*/ */
abstract public function flip( $horz, $vert ); abstract public function flip( $horz, $vert );
@ -163,7 +163,7 @@ abstract class WP_Image_Editor {
* @abstract * @abstract
* *
* @param string $mime_type The mime type of the image. * @param string $mime_type The mime type of the image.
* @return bool|WP_Error True on success, WP_Error object or false on failure. * @return true|WP_Error True on success, WP_Error object on failure.
*/ */
abstract public function stream( $mime_type = null ); abstract public function stream( $mime_type = null );

View File

@ -822,7 +822,7 @@ class WP_Meta_Query {
* *
* @since 4.1.0 * @since 4.1.0
* *
* @param string|bool $alias Table alias, or false if none was found. * @param string|false $alias Table alias, or false if none was found.
* @param array $clause First-order query clause. * @param array $clause First-order query clause.
* @param array $parent_query Parent of $clause. * @param array $parent_query Parent of $clause.
* @param WP_Meta_Query $this WP_Meta_Query object. * @param WP_Meta_Query $this WP_Meta_Query object.

View File

@ -89,7 +89,7 @@ class WP_Network {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param int $network_id The ID of the network to retrieve. * @param int $network_id The ID of the network to retrieve.
* @return WP_Network|bool The network's object if found. False if not. * @return WP_Network|false The network's object if found. False if not.
*/ */
public static function get_instance( $network_id ) { public static function get_instance( $network_id ) {
global $wpdb; global $wpdb;
@ -326,7 +326,7 @@ class WP_Network {
* @param string $domain Domain to check. * @param string $domain Domain to check.
* @param string $path Path to check. * @param string $path Path to check.
* @param int|null $segments Path segments to use. Defaults to null, or the full path. * @param int|null $segments Path segments to use. Defaults to null, or the full path.
* @return WP_Network|bool Network object if successful. False when no network is found. * @return WP_Network|false Network object if successful. False when no network is found.
*/ */
public static function get_by_path( $domain = '', $path = '', $segments = null ) { public static function get_by_path( $domain = '', $path = '', $segments = null ) {
$domains = array( $domain ); $domains = array( $domain );
@ -407,7 +407,7 @@ class WP_Network {
* *
* @since 3.9.0 * @since 3.9.0
* *
* @param null|bool|WP_Network $network Network value to return by path. Default null * @param null|false|WP_Network $network Network value to return by path. Default null
* to continue retrieving the network. * to continue retrieving the network.
* @param string $domain The requested domain. * @param string $domain The requested domain.
* @param string $path The requested path, in full. * @param string $path The requested path, in full.

View File

@ -220,7 +220,7 @@ class WP_oEmbed {
* *
* @param string $name Method to call. * @param string $name Method to call.
* @param array $arguments Arguments to pass when calling. * @param array $arguments Arguments to pass when calling.
* @return mixed|bool Return value of the callback, false otherwise. * @return mixed|false Return value of the callback, false otherwise.
*/ */
public function __call( $name, $arguments ) { public function __call( $name, $arguments ) {
if ( in_array( $name, $this->compat_methods, true ) ) { if ( in_array( $name, $this->compat_methods, true ) ) {

View File

@ -4330,7 +4330,7 @@ class WP_Query {
* @since 5.2.0 * @since 5.2.0
* *
* @param WP_Post|object|int $post WP_Post instance or Post ID/object. * @param WP_Post|object|int $post WP_Post instance or Post ID/object.
* @return array|bool Elements of post or false on failure. * @return array|false Elements of post or false on failure.
*/ */
public function generate_postdata( $post ) { public function generate_postdata( $post ) {

View File

@ -289,7 +289,7 @@ When seeking help with this issue, you may be asked for some of the following in
* @since 5.3.0 * @since 5.3.0
* *
* @param array $extension The extension that caused the error. * @param array $extension The extension that caused the error.
* @return bool|array A plugin array {@see get_plugins()} or `false` if no plugin was found. * @return false|array A plugin array {@see get_plugins()} or `false` if no plugin was found.
*/ */
private function get_plugin( $extension ) { private function get_plugin( $extension ) {
if ( ! function_exists( 'get_plugins' ) ) { if ( ! function_exists( 'get_plugins' ) ) {

View File

@ -228,7 +228,7 @@ class wp_xmlrpc_server extends IXR_Server {
* *
* @param string $username User's username. * @param string $username User's username.
* @param string $password User's password. * @param string $password User's password.
* @return WP_User|bool WP_User object if authentication passed, false otherwise * @return WP_User|false WP_User object if authentication passed, false otherwise
*/ */
public function login( $username, $password ) { public function login( $username, $password ) {
/* /*
@ -2231,7 +2231,7 @@ class wp_xmlrpc_server extends IXR_Server {
* @type string $taxnomy_name Taxonomy name. * @type string $taxnomy_name Taxonomy name.
* @type int $term_id Term ID. * @type int $term_id Term ID.
* } * }
* @return bool|IXR_Error True on success, IXR_Error instance on failure. * @return true|IXR_Error True on success, IXR_Error instance on failure.
*/ */
public function wp_deleteTerm( $args ) { public function wp_deleteTerm( $args ) {
if ( ! $this->minimum_args( $args, 5 ) ) { if ( ! $this->minimum_args( $args, 5 ) ) {
@ -5653,7 +5653,7 @@ class wp_xmlrpc_server extends IXR_Server {
* @type array $content_struct * @type array $content_struct
* @type int $publish * @type int $publish
* } * }
* @return bool|IXR_Error True on success. * @return true|IXR_Error True on success.
*/ */
public function mw_editPost( $args ) { public function mw_editPost( $args ) {
$this->escape( $args ); $this->escape( $args );

View File

@ -454,7 +454,7 @@ function get_comment_count( $post_id = 0 ) {
* @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar.
* @param bool $unique Optional. Whether the same key should not be added. * @param bool $unique Optional. Whether the same key should not be added.
* Default false. * Default false.
* @return int|bool Meta ID on success, false on failure. * @return int|false Meta ID on success, false on failure.
*/ */
function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false ) { function add_comment_meta( $comment_id, $meta_key, $meta_value, $unique = false ) {
return add_metadata( 'comment', $comment_id, $meta_key, $meta_value, $unique ); return add_metadata( 'comment', $comment_id, $meta_key, $meta_value, $unique );

View File

@ -754,7 +754,7 @@ function spawn_cron( $gmt_time = 0 ) {
* @since 2.1.0 * @since 2.1.0
* @since 5.1.0 Return value added to indicate success or failure. * @since 5.1.0 Return value added to indicate success or failure.
* *
* @return bool|int On success an integer indicating number of events spawned (0 indicates no * @return false|int On success an integer indicating number of events spawned (0 indicates no
* events needed to be spawned), false if spawning fails for one or more events. * events needed to be spawned), false if spawning fails for one or more events.
*/ */
function wp_cron() { function wp_cron() {
@ -880,7 +880,7 @@ function wp_get_schedule( $hook, $args = array() ) {
* *
* @since 5.1.0 * @since 5.1.0
* *
* @param string|bool $schedule Schedule for the hook. False if not found. * @param string|false $schedule Schedule for the hook. False if not found.
* @param string $hook Action hook to execute when cron is run. * @param string $hook Action hook to execute when cron is run.
* @param array $args Optional. Arguments to pass to the hook's callback function. * @param array $args Optional. Arguments to pass to the hook's callback function.
*/ */

View File

@ -3585,7 +3585,7 @@ function iso8601_timezone_to_offset( $timezone ) {
* *
* @param string $date_string Date and time in ISO 8601 format {@link https://en.wikipedia.org/wiki/ISO_8601}. * @param string $date_string Date and time in ISO 8601 format {@link https://en.wikipedia.org/wiki/ISO_8601}.
* @param string $timezone Optional. If set to 'gmt' returns the result in UTC. Default 'user'. * @param string $timezone Optional. If set to 'gmt' returns the result in UTC. Default 'user'.
* @return string|bool The date and time in MySQL DateTime format - Y-m-d H:i:s, or false on failure. * @return string|false The date and time in MySQL DateTime format - Y-m-d H:i:s, or false on failure.
*/ */
function iso8601_to_datetime( $date_string, $timezone = 'user' ) { function iso8601_to_datetime( $date_string, $timezone = 'user' ) {
$timezone = strtolower( $timezone ); $timezone = strtolower( $timezone );

View File

@ -938,7 +938,7 @@ function do_enclose( $content, $post ) {
* *
* @param string $url URL to retrieve HTTP headers from. * @param string $url URL to retrieve HTTP headers from.
* @param bool $deprecated Not Used. * @param bool $deprecated Not Used.
* @return bool|string False on failure, headers on success. * @return false|string False on failure, headers on success.
*/ */
function wp_get_http_headers( $url, $deprecated = false ) { function wp_get_http_headers( $url, $deprecated = false ) {
if ( ! empty( $deprecated ) ) { if ( ! empty( $deprecated ) ) {
@ -3025,7 +3025,7 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
* @param string $filename The name of the file (may differ from $file due to * @param string $filename The name of the file (may differ from $file due to
* $file being in a tmp directory). * $file being in a tmp directory).
* @param string[] $mimes Array of mime types keyed by their file extension regex. * @param string[] $mimes Array of mime types keyed by their file extension regex.
* @param string|bool $real_mime The actual mime type or false if the type cannot be determined. * @param string|false $real_mime The actual mime type or false if the type cannot be determined.
*/ */
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime ); return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime );
} }
@ -6914,7 +6914,7 @@ function mysql_to_rfc3339( $date_string ) {
* 'image', or an arbitrary other context. If an arbitrary context is passed, * 'image', or an arbitrary other context. If an arbitrary context is passed,
* the similarly arbitrary {@see '$context_memory_limit'} filter will be * the similarly arbitrary {@see '$context_memory_limit'} filter will be
* invoked. Default 'admin'. * invoked. Default 'admin'.
* @return bool|int|string The limit that was set or false on failure. * @return false|int|string The limit that was set or false on failure.
*/ */
function wp_raise_memory_limit( $context = 'admin' ) { function wp_raise_memory_limit( $context = 'admin' ) {
// Exit early if the limit cannot be changed. // Exit early if the limit cannot be changed.

View File

@ -39,7 +39,7 @@
* @see wp_kses_allowed_html() * @see wp_kses_allowed_html()
* @since 1.2.0 * @since 1.2.0
* *
* @var array[]|bool Array of default allowable HTML tags, or false to use the defaults. * @var array[]|false Array of default allowable HTML tags, or false to use the defaults.
*/ */
if ( ! defined( 'CUSTOM_TAGS' ) ) { if ( ! defined( 'CUSTOM_TAGS' ) ) {
define( 'CUSTOM_TAGS', false ); define( 'CUSTOM_TAGS', false );
@ -1411,7 +1411,7 @@ function wp_kses_hair( $attr, $allowed_protocols ) {
* @since 4.2.3 * @since 4.2.3
* *
* @param string $element HTML element. * @param string $element HTML element.
* @return array|bool List of attributes found in the element. Returns false on failure. * @return array|false List of attributes found in the element. Returns false on failure.
*/ */
function wp_kses_attr_parse( $element ) { function wp_kses_attr_parse( $element ) {
$valid = preg_match( '%^(<\s*)(/\s*)?([a-zA-Z0-9]+\s*)([^>]*)(>?)$%', $element, $matches ); $valid = preg_match( '%^(<\s*)(/\s*)?([a-zA-Z0-9]+\s*)([^>]*)(>?)$%', $element, $matches );
@ -1462,7 +1462,7 @@ function wp_kses_attr_parse( $element ) {
* @since 4.2.3 * @since 4.2.3
* *
* @param string $attr Attribute list from HTML element to closing HTML element tag. * @param string $attr Attribute list from HTML element to closing HTML element tag.
* @return array|bool List of attributes found in $attr. Returns false on failure. * @return array|false List of attributes found in $attr. Returns false on failure.
*/ */
function wp_kses_hair_parse( $attr ) { function wp_kses_hair_parse( $attr ) {
if ( '' === $attr ) { if ( '' === $attr ) {

View File

@ -1201,7 +1201,7 @@ function _wp_get_image_size_from_meta( $size_name, $image_meta ) {
* width and height values in pixels (in that order). Default 'medium'. * width and height values in pixels (in that order). Default 'medium'.
* @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
* Default null. * Default null.
* @return string|bool A 'srcset' value string or false. * @return string|false A 'srcset' value string or false.
*/ */
function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $image_meta = null ) { function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $image_meta = null ) {
$image = wp_get_attachment_image_src( $attachment_id, $size ); $image = wp_get_attachment_image_src( $attachment_id, $size );
@ -1442,7 +1442,7 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac
* width and height values in pixels (in that order). Default 'medium'. * width and height values in pixels (in that order). Default 'medium'.
* @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. * @param array $image_meta Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
* Default null. * Default null.
* @return string|bool A valid source size value for use in a 'sizes' attribute or false. * @return string|false A valid source size value for use in a 'sizes' attribute or false.
*/ */
function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image_meta = null ) { function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image_meta = null ) {
$image = wp_get_attachment_image_src( $attachment_id, $size ); $image = wp_get_attachment_image_src( $attachment_id, $size );

View File

@ -775,7 +775,7 @@ function get_metadata_by_mid( $meta_type, $meta_id ) {
* or any other object type with an associated meta table. * or any other object type with an associated meta table.
* @param int $meta_id ID for a specific meta row. * @param int $meta_id ID for a specific meta row.
* @param string $meta_value Metadata value. Must be serializable if non-scalar. * @param string $meta_value Metadata value. Must be serializable if non-scalar.
* @param string $meta_key Optional. You can provide a meta key to update it. Default false. * @param string|false $meta_key Optional. You can provide a meta key to update it. Default false.
* @return bool True on successful update, false on failure. * @return bool True on successful update, false on failure.
*/ */
function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = false ) { function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key = false ) {
@ -811,7 +811,7 @@ function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key =
* @param null|bool $check Whether to allow updating metadata for the given type. * @param null|bool $check Whether to allow updating metadata for the given type.
* @param int $meta_id Meta ID. * @param int $meta_id Meta ID.
* @param mixed $meta_value Meta value. Must be serializable if non-scalar. * @param mixed $meta_value Meta value. Must be serializable if non-scalar.
* @param string|bool $meta_key Meta key, if provided. * @param string|false $meta_key Meta key, if provided.
*/ */
$check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key ); $check = apply_filters( "update_{$meta_type}_metadata_by_mid", null, $meta_id, $meta_value, $meta_key );
if ( null !== $check ) { if ( null !== $check ) {

View File

@ -928,7 +928,7 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $us
* *
* @since MU (3.0.0) * @since MU (3.0.0)
* *
* @param string|bool $domain Site domain. * @param string|false $domain Site domain, or false to prevent the email from sending.
* @param string $path Site path. * @param string $path Site path.
* @param string $title Site title. * @param string $title Site title.
* @param string $user_login User login name. * @param string $user_login User login name.
@ -1601,7 +1601,7 @@ function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta
* *
* @since MU (3.0.0) * @since MU (3.0.0)
* *
* @param int|bool $blog_id Site ID. * @param int|false $blog_id Site ID, or false to prevent the email from sending.
* @param int $user_id User ID of the site administrator. * @param int $user_id User ID of the site administrator.
* @param string $password User password, or "N/A" if the user account is not new. * @param string $password User password, or "N/A" if the user account is not new.
* @param string $title Site title. * @param string $title Site title.

View File

@ -668,7 +668,7 @@ function wp_validate_site_data( $errors, $data, $old_site = null ) {
* @type array $meta Custom site metadata $key => $value pairs to use. * @type array $meta Custom site metadata $key => $value pairs to use.
* Default empty array. * Default empty array.
* } * }
* @return bool|WP_Error True on success, or error object on failure. * @return true|WP_Error True on success, or error object on failure.
*/ */
function wp_initialize_site( $site_id, array $args = array() ) { function wp_initialize_site( $site_id, array $args = array() ) {
global $wpdb, $wp_roles; global $wpdb, $wp_roles;
@ -799,7 +799,7 @@ function wp_initialize_site( $site_id, array $args = array() ) {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param int|WP_Site $site_id Site ID or object. * @param int|WP_Site $site_id Site ID or object.
* @return bool|WP_Error True on success, or error object on failure. * @return true|WP_Error True on success, or error object on failure.
*/ */
function wp_uninitialize_site( $site_id ) { function wp_uninitialize_site( $site_id ) {
global $wpdb; global $wpdb;

View File

@ -33,7 +33,7 @@ require_once ABSPATH . WPINC . '/class-walker-nav-menu.php';
* @type string $container_id The ID that is applied to the container. Default empty. * @type string $container_id The ID that is applied to the container. Default empty.
* @type string $container_aria_label The aria-label attribute that is applied to the container * @type string $container_aria_label The aria-label attribute that is applied to the container
* when it's a nav element. Default empty. * when it's a nav element. Default empty.
* @type callable|bool $fallback_cb If the menu doesn't exist, a callback function will fire. * @type callable|false $fallback_cb If the menu doesn't exist, a callback function will fire.
* Default is 'wp_page_menu'. Set to false for no fallback. * Default is 'wp_page_menu'. Set to false for no fallback.
* @type string $before Text before the link markup. Default empty. * @type string $before Text before the link markup. Default empty.
* @type string $after Text after the link markup. Default empty. * @type string $after Text after the link markup. Default empty.

View File

@ -128,7 +128,7 @@ function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1
* @global WP_Hook[] $wp_filter Stores all of the filters and actions. * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* *
* @param string $tag The name of the filter hook. * @param string $tag The name of the filter hook.
* @param callable|bool $function_to_check Optional. The callback to check for. Default false. * @param callable|false $function_to_check Optional. The callback to check for. Default false.
* @return false|int If $function_to_check is omitted, returns boolean for whether the hook has * @return false|int If $function_to_check is omitted, returns boolean for whether the hook has
* anything registered. When checking a specific function, the priority of that * anything registered. When checking a specific function, the priority of that
* hook is returned, or false if the function is not attached. When using the * hook is returned, or false if the function is not attached. When using the
@ -301,7 +301,7 @@ function remove_filter( $tag, $function_to_remove, $priority = 10 ) {
* @global WP_Hook[] $wp_filter Stores all of the filters and actions. * @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* *
* @param string $tag The filter to remove hooks from. * @param string $tag The filter to remove hooks from.
* @param int|bool $priority Optional. The priority number to remove. Default false. * @param int|false $priority Optional. The priority number to remove. Default false.
* @return true True when finished. * @return true True when finished.
*/ */
function remove_all_filters( $tag, $priority = false ) { function remove_all_filters( $tag, $priority = false ) {
@ -561,7 +561,7 @@ function do_action_ref_array( $tag, $args ) {
* @see has_filter() has_action() is an alias of has_filter(). * @see has_filter() has_action() is an alias of has_filter().
* *
* @param string $tag The name of the action hook. * @param string $tag The name of the action hook.
* @param callable|bool $function_to_check Optional. The callback to check for. Default false. * @param callable|false $function_to_check Optional. The callback to check for. Default false.
* @return bool|int If $function_to_check is omitted, returns boolean for whether the hook has * @return bool|int If $function_to_check is omitted, returns boolean for whether the hook has
* anything registered. When checking a specific function, the priority of that * anything registered. When checking a specific function, the priority of that
* hook is returned, or false if the function is not attached. When using the * hook is returned, or false if the function is not attached. When using the
@ -597,7 +597,7 @@ function remove_action( $tag, $function_to_remove, $priority = 10 ) {
* @since 2.7.0 * @since 2.7.0
* *
* @param string $tag The action to remove hooks from. * @param string $tag The action to remove hooks from.
* @param int|bool $priority The priority number to remove them from. Default false. * @param int|false $priority The priority number to remove them from. Default false.
* @return true True when finished. * @return true True when finished.
*/ */
function remove_all_actions( $tag, $priority = false ) { function remove_all_actions( $tag, $priority = false ) {

View File

@ -1645,7 +1645,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
* an array of width and height values in pixels (in that order). * an array of width and height values in pixels (in that order).
* @param bool $permalink Whether to add permalink to image. Default false. * @param bool $permalink Whether to add permalink to image. Default false.
* @param bool $icon Whether to include an icon. * @param bool $icon Whether to include an icon.
* @param string|bool $text If string, will be link text. * @param string|false $text If string, will be link text.
* @param array|string $attr Array or string of attributes. * @param array|string $attr Array or string of attributes.
*/ */
return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text, $attr ); return apply_filters( 'wp_get_attachment_link', "<a href='" . esc_url( $url ) . "'>$link_text</a>", $id, $size, $permalink, $icon, $text, $attr );

View File

@ -1476,7 +1476,7 @@ function register_post_type( $post_type, $args = array() ) {
* @global array $wp_post_types List of post types. * @global array $wp_post_types List of post types.
* *
* @param string $post_type Post type to unregister. * @param string $post_type Post type to unregister.
* @return bool|WP_Error True on success, WP_Error on failure or if the post type doesn't exist. * @return true|WP_Error True on success, WP_Error on failure or if the post type doesn't exist.
*/ */
function unregister_post_type( $post_type ) { function unregister_post_type( $post_type ) {
global $wp_post_types; global $wp_post_types;
@ -5060,7 +5060,7 @@ function get_enclosed( $post_id ) {
* @since 4.7.0 `$post_id` can be a WP_Post object. * @since 4.7.0 `$post_id` can be a WP_Post object.
* *
* @param int|WP_Post $post_id Post ID or object. * @param int|WP_Post $post_id Post ID or object.
* @return bool|string[] Array of URLs already pinged for the given post, false if the post is not found. * @return false|string[] Array of URLs already pinged for the given post, false if the post is not found.
*/ */
function get_pung( $post_id ) { function get_pung( $post_id ) {
$post = get_post( $post_id ); $post = get_post( $post_id );
@ -6116,7 +6116,7 @@ function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) {
* *
* @param int $attachment_id Attachment post ID. * @param int $attachment_id Attachment post ID.
* @param array $data Attachment meta data. * @param array $data Attachment meta data.
* @return int|bool False if $post is invalid. * @return int|false False if $post is invalid.
*/ */
function wp_update_attachment_metadata( $attachment_id, $data ) { function wp_update_attachment_metadata( $attachment_id, $data ) {
$attachment_id = (int) $attachment_id; $attachment_id = (int) $attachment_id;

View File

@ -1186,7 +1186,7 @@ function setup_postdata( $post ) {
* @global WP_Query $wp_query WordPress Query object. * @global WP_Query $wp_query WordPress Query object.
* *
* @param WP_Post|object|int $post WP_Post instance or Post ID/object. * @param WP_Post|object|int $post WP_Post instance or Post ID/object.
* @return array|bool Elements of post, or false on failure. * @return array|false Elements of post, or false on failure.
*/ */
function generate_postdata( $post ) { function generate_postdata( $post ) {
global $wp_query; global $wp_query;

View File

@ -855,7 +855,7 @@ class WP_REST_Request implements ArrayAccess {
* *
* @since 4.4.0 * @since 4.4.0
* *
* @return bool|WP_Error True if there are no parameters to validate or if all pass validation, * @return true|WP_Error True if there are no parameters to validate or if all pass validation,
* WP_Error if required parameters are missing. * WP_Error if required parameters are missing.
*/ */
public function has_valid_params() { public function has_valid_params() {

View File

@ -1203,7 +1203,7 @@ class WP_REST_Server {
* *
* @since 4.4.0 * @since 4.4.0
* *
* @return bool|string Boolean false or string error message. * @return false|string Boolean false or string error message.
*/ */
protected function get_json_last_error() { protected function get_json_last_error() {
$last_error_code = json_last_error(); $last_error_code = json_last_error();

View File

@ -50,7 +50,7 @@ class WP_REST_Block_Directory_Controller extends WP_REST_Controller {
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* *
* @return WP_Error|bool True if the request has permission, WP_Error object otherwise. * @return WP_Error|true True if the request has permission, WP_Error object otherwise.
*/ */
public function get_items_permissions_check( $request ) { public function get_items_permissions_check( $request ) {
if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) { if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) {

View File

@ -114,7 +114,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
* @since 5.5.0 * @since 5.5.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return WP_Error|bool True if the request has read access, WP_Error object otherwise. * @return WP_Error|true True if the request has read access, WP_Error object otherwise.
*/ */
public function get_items_permissions_check( $request ) { public function get_items_permissions_check( $request ) {
return $this->check_read_permission(); return $this->check_read_permission();
@ -160,7 +160,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
* @since 5.5.0 * @since 5.5.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise. * @return WP_Error|true True if the request has read access for the item, WP_Error object otherwise.
*/ */
public function get_item_permissions_check( $request ) { public function get_item_permissions_check( $request ) {
$check = $this->check_read_permission(); $check = $this->check_read_permission();
@ -181,7 +181,7 @@ class WP_REST_Block_Types_Controller extends WP_REST_Controller {
* *
* @since 5.5.0 * @since 5.5.0
* *
* @return WP_Error|bool True if the block type is visible, WP_Error otherwise. * @return WP_Error|true True if the block type is visible, WP_Error otherwise.
*/ */
protected function check_read_permission() { protected function check_read_permission() {
if ( current_user_can( 'edit_posts' ) ) { if ( current_user_can( 'edit_posts' ) ) {

View File

@ -443,7 +443,7 @@ abstract class WP_REST_Controller {
* *
* @param object $object Data model like WP_Term or WP_Post. * @param object $object Data model like WP_Term or WP_Post.
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True on success, WP_Error object if a field cannot be updated. * @return true|WP_Error True on success, WP_Error object if a field cannot be updated.
*/ */
protected function update_additional_fields_for_object( $object, $request ) { protected function update_additional_fields_for_object( $object, $request ) {
$additional_fields = $this->get_additional_fields(); $additional_fields = $this->get_additional_fields();

View File

@ -426,7 +426,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
*/ */
public function get_item_permissions_check( $request ) { public function get_item_permissions_check( $request ) {
$post = $this->get_post( $request['id'] ); $post = $this->get_post( $request['id'] );

View File

@ -362,7 +362,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise.
*/ */
public function get_item_permissions_check( $request ) { public function get_item_permissions_check( $request ) {
return $this->get_items_permissions_check( $request ); return $this->get_items_permissions_check( $request );
@ -397,7 +397,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has access to delete the item, WP_Error object otherwise. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise.
*/ */
public function delete_item_permissions_check( $request ) { public function delete_item_permissions_check( $request ) {
$parent = $this->get_parent( $request['parent'] ); $parent = $this->get_parent( $request['parent'] );

View File

@ -140,7 +140,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has read access, otherwise false or WP_Error object. * @return true|WP_Error True if the request has read access, otherwise false or WP_Error object.
*/ */
public function get_items_permissions_check( $request ) { public function get_items_permissions_check( $request ) {
$tax_obj = get_taxonomy( $this->taxonomy ); $tax_obj = get_taxonomy( $this->taxonomy );
@ -347,7 +347,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object. * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object.
*/ */
public function get_item_permissions_check( $request ) { public function get_item_permissions_check( $request ) {
$term = $this->get_term( $request['id'] ); $term = $this->get_term( $request['id'] );
@ -392,7 +392,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has access to create items, false or WP_Error object otherwise. * @return true|WP_Error True if the request has access to create items, false or WP_Error object otherwise.
*/ */
public function create_item_permissions_check( $request ) { public function create_item_permissions_check( $request ) {
@ -528,7 +528,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has access to update the item, false or WP_Error object otherwise. * @return true|WP_Error True if the request has access to update the item, false or WP_Error object otherwise.
*/ */
public function update_item_permissions_check( $request ) { public function update_item_permissions_check( $request ) {
$term = $this->get_term( $request['id'] ); $term = $this->get_term( $request['id'] );
@ -629,7 +629,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller {
* @since 4.7.0 * @since 4.7.0
* *
* @param WP_REST_Request $request Full details about the request. * @param WP_REST_Request $request Full details about the request.
* @return bool|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object. * @return true|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object.
*/ */
public function delete_item_permissions_check( $request ) { public function delete_item_permissions_check( $request ) {
$term = $this->get_term( $request['id'] ); $term = $this->get_term( $request['id'] );

View File

@ -213,7 +213,7 @@ abstract class WP_REST_Meta_Fields {
* @param int $object_id Object ID the field belongs to. * @param int $object_id Object ID the field belongs to.
* @param string $meta_key Key for the field. * @param string $meta_key Key for the field.
* @param string $name Name for the field that is exposed in the REST API. * @param string $name Name for the field that is exposed in the REST API.
* @return bool|WP_Error True if meta field is deleted, WP_Error otherwise. * @return true|WP_Error True if meta field is deleted, WP_Error otherwise.
*/ */
protected function delete_meta_value( $object_id, $meta_key, $name ) { protected function delete_meta_value( $object_id, $meta_key, $name ) {
$meta_type = $this->get_meta_type(); $meta_type = $this->get_meta_type();
@ -255,7 +255,7 @@ abstract class WP_REST_Meta_Fields {
* @param string $meta_key Key for the custom field. * @param string $meta_key Key for the custom field.
* @param string $name Name for the field that is exposed in the REST API. * @param string $name Name for the field that is exposed in the REST API.
* @param array $values List of values to update to. * @param array $values List of values to update to.
* @return bool|WP_Error True if meta fields are updated, WP_Error otherwise. * @return true|WP_Error True if meta fields are updated, WP_Error otherwise.
*/ */
protected function update_multi_meta_value( $object_id, $meta_key, $name, $values ) { protected function update_multi_meta_value( $object_id, $meta_key, $name, $values ) {
$meta_type = $this->get_meta_type(); $meta_type = $this->get_meta_type();
@ -350,7 +350,7 @@ abstract class WP_REST_Meta_Fields {
* @param string $meta_key Key for the custom field. * @param string $meta_key Key for the custom field.
* @param string $name Name for the field that is exposed in the REST API. * @param string $name Name for the field that is exposed in the REST API.
* @param mixed $value Updated value. * @param mixed $value Updated value.
* @return bool|WP_Error True if the meta field was updated, WP_Error otherwise. * @return true|WP_Error True if the meta field was updated, WP_Error otherwise.
*/ */
protected function update_meta_value( $object_id, $meta_key, $name, $value ) { protected function update_meta_value( $object_id, $meta_key, $name, $value ) {
$meta_type = $this->get_meta_type(); $meta_type = $this->get_meta_type();

View File

@ -404,7 +404,7 @@ if ( !function_exists('fetch_rss') ) :
* @subpackage MagpieRSS * @subpackage MagpieRSS
* *
* @param string $url URL to retrieve feed * @param string $url URL to retrieve feed
* @return bool|MagpieRSS false on failure or MagpieRSS object on success. * @return false|MagpieRSS false on failure or MagpieRSS object on success.
*/ */
function fetch_rss ($url) { function fetch_rss ($url) {
// initialize constants // initialize constants

View File

@ -487,7 +487,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
* @global array $wp_taxonomies List of taxonomies. * @global array $wp_taxonomies List of taxonomies.
* *
* @param string $taxonomy Taxonomy name. * @param string $taxonomy Taxonomy name.
* @return bool|WP_Error True on success, WP_Error on failure or if the taxonomy doesn't exist. * @return true|WP_Error True on success, WP_Error on failure or if the taxonomy doesn't exist.
*/ */
function unregister_taxonomy( $taxonomy ) { function unregister_taxonomy( $taxonomy ) {
if ( ! taxonomy_exists( $taxonomy ) ) { if ( ! taxonomy_exists( $taxonomy ) ) {

View File

@ -2492,7 +2492,7 @@ function get_theme_starter_content() {
* 'disable-custom-font-sizes', 'editor-color-palette', 'editor-font-sizes', * 'disable-custom-font-sizes', 'editor-color-palette', 'editor-font-sizes',
* 'editor-styles', 'wp-block-styles', and 'core-block-patterns'. * 'editor-styles', 'wp-block-styles', and 'core-block-patterns'.
* @param mixed ...$args Optional extra arguments to pass along with certain features. * @param mixed ...$args Optional extra arguments to pass along with certain features.
* @return void|bool False on failure, void otherwise. * @return void|false False on failure, void otherwise.
*/ */
function add_theme_support( $feature, ...$args ) { function add_theme_support( $feature, ...$args ) {
global $_wp_theme_features; global $_wp_theme_features;

View File

@ -449,8 +449,8 @@ function wp_authenticate_application_password( $input_user, $username, $password
* *
* @since 5.6.0 * @since 5.6.0
* *
* @param int|bool $input_user User ID if one has been determined, false otherwise. * @param int|false $input_user User ID if one has been determined, false otherwise.
* @return int|bool The authenticated user ID if successful, false otherwise. * @return int|false The authenticated user ID if successful, false otherwise.
*/ */
function wp_validate_application_password( $input_user ) { function wp_validate_application_password( $input_user ) {
// Don't authenticate twice. // Don't authenticate twice.
@ -515,7 +515,7 @@ function wp_authenticate_spam_check( $user ) {
* *
* @since 3.9.0 * @since 3.9.0
* *
* @param int|bool $user_id The user ID (or false) as received from * @param int|false $user_id The user ID (or false) as received from
* the `determine_current_user` filter. * the `determine_current_user` filter.
* @return int|false User ID if validated, false otherwise. If a user ID from * @return int|false User ID if validated, false otherwise. If a user ID from
* an earlier filter callback is received, that value is returned. * an earlier filter callback is received, that value is returned.
@ -2978,7 +2978,7 @@ function _wp_get_current_user() {
* *
* @since 3.9.0 * @since 3.9.0
* *
* @param int|bool $user_id User ID if one has been determined, false otherwise. * @param int|false $user_id User ID if one has been determined, false otherwise.
*/ */
$user_id = apply_filters( 'determine_current_user', false ); $user_id = apply_filters( 'determine_current_user', false );
if ( ! $user_id ) { if ( ! $user_id ) {
@ -3866,7 +3866,7 @@ function wp_user_request_action_description( $action_name ) {
* @since 4.9.6 * @since 4.9.6
* *
* @param string $request_id ID of the request created via wp_create_user_request(). * @param string $request_id ID of the request created via wp_create_user_request().
* @return bool|WP_Error True on success, `WP_Error` on failure. * @return true|WP_Error True on success, `WP_Error` on failure.
*/ */
function wp_send_user_request( $request_id ) { function wp_send_user_request( $request_id ) {
$request_id = absint( $request_id ); $request_id = absint( $request_id );
@ -4050,7 +4050,7 @@ function wp_generate_user_request_key( $request_id ) {
* *
* @param string $request_id ID of the request being confirmed. * @param string $request_id ID of the request being confirmed.
* @param string $key Provided key to validate. * @param string $key Provided key to validate.
* @return bool|WP_Error True on success, WP_Error on failure. * @return true|WP_Error True on success, WP_Error on failure.
*/ */
function wp_validate_user_request_key( $request_id, $key ) { function wp_validate_user_request_key( $request_id, $key ) {
global $wp_hasher; global $wp_hasher;

View File

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