For doc block types, favor `bool` over the few remaining `boolean`s
See #32444. Built from https://develop.svn.wordpress.org/trunk@32964 git-svn-id: http://core.svn.wordpress.org/trunk@32935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
642af1f3f4
commit
a0e373ef80
|
@ -319,7 +319,7 @@ function export_wp( $args = array() ) {
|
|||
*
|
||||
* @param bool $return_me
|
||||
* @param string $meta_key
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
function wxr_filter_postmeta( $return_me, $meta_key ) {
|
||||
if ( '_edit_lock' == $meta_key )
|
||||
|
|
|
@ -837,7 +837,7 @@ function copy_dir($from, $to, $skip_list = array() ) {
|
|||
* the `WP_Filesystem_*()` classes. Default false.
|
||||
* @param string|false $context Optional. Context for get_filesystem_method(). Default false.
|
||||
* @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false.
|
||||
* @return null|boolean false on failure, true on success.
|
||||
* @return null|bool false on failure, true on success.
|
||||
*/
|
||||
function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) {
|
||||
global $wp_filesystem;
|
||||
|
@ -996,13 +996,13 @@ function get_filesystem_method( $args = array(), $context = false, $allow_relaxe
|
|||
*
|
||||
* @todo Properly mark optional arguments as such
|
||||
*
|
||||
* @param string $form_post the URL to post the form to
|
||||
* @param string $type the chosen Filesystem method in use
|
||||
* @param boolean $error if the current request has failed to connect
|
||||
* @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
|
||||
* @param array $extra_fields Extra POST fields which should be checked for to be included in the post.
|
||||
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
|
||||
* @return boolean False on failure. True on success.
|
||||
* @param string $form_post the URL to post the form to
|
||||
* @param string $type the chosen Filesystem method in use
|
||||
* @param bool $error if the current request has failed to connect
|
||||
* @param string $context The directory which is needed access to, The write-test will be performed on this directory by get_filesystem_method()
|
||||
* @param array $extra_fields Extra POST fields which should be checked for to be included in the post.
|
||||
* @param bool $allow_relaxed_file_ownership Whether to allow Group/World writable.
|
||||
* @return bool False on failure. True on success.
|
||||
*/
|
||||
function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null, $allow_relaxed_file_ownership = false ) {
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ function wp_image_editor($post_id, $msg = false) {
|
|||
* @param WP_Image_Editor $image
|
||||
* @param string $mime_type
|
||||
* @param int $post_id
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
function wp_stream_image( $image, $mime_type, $post_id ) {
|
||||
if ( $image instanceof WP_Image_Editor ) {
|
||||
|
@ -264,7 +264,7 @@ function wp_stream_image( $image, $mime_type, $post_id ) {
|
|||
* @param WP_Image_Editor $image
|
||||
* @param string $mime_type
|
||||
* @param int $post_id
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
|
||||
if ( $image instanceof WP_Image_Editor ) {
|
||||
|
@ -552,7 +552,7 @@ function image_edit_apply_changes( $image, $changes ) {
|
|||
* in $_REQUEST['history']
|
||||
*
|
||||
* @param int $post_id
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
function stream_preview_image( $post_id ) {
|
||||
$post = get_post( $post_id );
|
||||
|
|
|
@ -1493,7 +1493,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
|||
}
|
||||
if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
|
||||
&& post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
|
||||
|
||||
|
||||
$calling_post = get_post( $calling_post_id );
|
||||
$calling_post_type_object = get_post_type_object( $calling_post->post_type );
|
||||
|
||||
|
@ -1743,11 +1743,11 @@ function media_upload_header() {
|
|||
|
||||
$post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
|
||||
|
||||
if ( ! empty( $post_id ) ) {
|
||||
$post_type = get_post_type( $post_id );
|
||||
if ( ! empty( $post_id ) ) {
|
||||
$post_type = get_post_type( $post_id );
|
||||
} else {
|
||||
$post_type = '';
|
||||
}
|
||||
$post_type = '';
|
||||
}
|
||||
|
||||
echo '<script type="text/javascript">post_id = ' . $post_id . ';post_type = ' . $post_type . ';</script>';
|
||||
if ( empty( $_GET['chromeless'] ) ) {
|
||||
|
@ -3024,7 +3024,7 @@ function wp_read_video_metadata( $file ) {
|
|||
* @since 3.6.0
|
||||
*
|
||||
* @param string $file Path to file.
|
||||
* @return array|boolean Returns array of metadata, if found.
|
||||
* @return array|bool Returns array of metadata, if found.
|
||||
*/
|
||||
function wp_read_audio_metadata( $file ) {
|
||||
if ( ! file_exists( $file ) )
|
||||
|
|
|
@ -1482,9 +1482,9 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
|
|||
*
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $setting Optional slug title of a specific setting who's errors you want.
|
||||
* @param boolean $sanitize Whether to re-sanitize the setting value before returning errors.
|
||||
* @param boolean $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
|
||||
* @param string $setting Optional slug title of a specific setting who's errors you want.
|
||||
* @param bool $sanitize Whether to re-sanitize the setting value before returning errors.
|
||||
* @param bool $hide_on_update If set to true errors will not be shown if the settings page has already been submitted.
|
||||
*/
|
||||
function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ class IXR_Value {
|
|||
* Checks whether or not the supplied array is a struct or not
|
||||
*
|
||||
* @param array $array
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
function isStruct($array)
|
||||
{
|
||||
|
|
|
@ -1255,7 +1255,7 @@ class WP_Http_Streams {
|
|||
* @since 2.7.0
|
||||
* @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client().
|
||||
*
|
||||
* @return boolean False means this class can not be used, true means it can.
|
||||
* @return bool False means this class can not be used, true means it can.
|
||||
*/
|
||||
public static function test( $args = array() ) {
|
||||
if ( ! function_exists( 'stream_socket_client' ) )
|
||||
|
@ -1634,7 +1634,7 @@ class WP_Http_Curl {
|
|||
* @static
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @return boolean False means this class can not be used, true means it can.
|
||||
* @return bool False means this class can not be used, true means it can.
|
||||
*/
|
||||
public static function test( $args = array() ) {
|
||||
if ( ! function_exists( 'curl_init' ) || ! function_exists( 'curl_exec' ) )
|
||||
|
@ -2009,7 +2009,7 @@ class WP_Http_Cookie {
|
|||
* @since 2.8.0
|
||||
*
|
||||
* @param string $url URL you intend to send this cookie to
|
||||
* @return boolean true if allowed, false otherwise.
|
||||
* @return bool true if allowed, false otherwise.
|
||||
*/
|
||||
public function test( $url ) {
|
||||
if ( is_null( $this->name ) )
|
||||
|
|
|
@ -38,7 +38,7 @@ final class WP_Customize_Manager {
|
|||
/**
|
||||
* Whether this is a Customizer pageload.
|
||||
*
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
protected $previewing = false;
|
||||
|
||||
|
|
|
@ -1431,7 +1431,7 @@ final class WP_Customize_Widgets {
|
|||
* @access protected
|
||||
*
|
||||
* @param string $option_name Option name.
|
||||
* @return boolean Whether the option capture is ignored.
|
||||
* @return bool Whether the option capture is ignored.
|
||||
*/
|
||||
protected function is_option_capture_ignored( $option_name ) {
|
||||
return ( 0 === strpos( $option_name, '_transient_' ) );
|
||||
|
|
|
@ -87,7 +87,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
|||
* @since 3.5.0
|
||||
* @access protected
|
||||
*
|
||||
* @return boolean|WP_Error True if loaded successfully; WP_Error on failure.
|
||||
* @return bool|WP_Error True if loaded successfully; WP_Error on failure.
|
||||
*/
|
||||
public function load() {
|
||||
if ( $this->image )
|
||||
|
@ -160,7 +160,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
|||
*
|
||||
* @param int|null $max_w Image width.
|
||||
* @param int|null $max_h Image height.
|
||||
* @param boolean $crop
|
||||
* @param bool $crop
|
||||
* @return true|WP_Error
|
||||
*/
|
||||
public function resize( $max_w, $max_h, $crop = false ) {
|
||||
|
@ -272,14 +272,14 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
|||
* @since 3.5.0
|
||||
* @access public
|
||||
*
|
||||
* @param int $src_x The start x position to crop from.
|
||||
* @param int $src_y The start y position to crop from.
|
||||
* @param int $src_w The width to crop.
|
||||
* @param int $src_h The height to crop.
|
||||
* @param int $dst_w Optional. The destination width.
|
||||
* @param int $dst_h Optional. The destination height.
|
||||
* @param boolean $src_abs Optional. If the source crop points are absolute.
|
||||
* @return boolean|WP_Error
|
||||
* @param int $src_x The start x position to crop from.
|
||||
* @param int $src_y The start y position to crop from.
|
||||
* @param int $src_w The width to crop.
|
||||
* @param int $src_h The height to crop.
|
||||
* @param int $dst_w Optional. The destination width.
|
||||
* @param int $dst_h Optional. The destination height.
|
||||
* @param bool $src_abs Optional. If the source crop points are absolute.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
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, use same as
|
||||
|
@ -344,8 +344,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
|||
* @since 3.5.0
|
||||
* @access public
|
||||
*
|
||||
* @param boolean $horz Flip along Horizontal Axis
|
||||
* @param boolean $vert Flip along Vertical Axis
|
||||
* @param bool $horz Flip along Horizontal Axis
|
||||
* @param bool $vert Flip along Vertical Axis
|
||||
* @returns true|WP_Error
|
||||
*/
|
||||
public function flip( $horz, $vert ) {
|
||||
|
@ -476,7 +476,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
|||
* @param string|stream $filename
|
||||
* @param callable $function
|
||||
* @param array $arguments
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
protected function make_image( $filename, $function, $arguments ) {
|
||||
if ( wp_is_stream( $filename ) )
|
||||
|
|
|
@ -43,7 +43,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||
* @access public
|
||||
*
|
||||
* @param array $args
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public static function test( $args = array() ) {
|
||||
|
||||
|
@ -93,7 +93,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||
* @access public
|
||||
*
|
||||
* @param string $mime_type
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public static function supports_mime_type( $mime_type ) {
|
||||
$imagick_extension = strtoupper( self::get_extension( $mime_type ) );
|
||||
|
@ -233,8 +233,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||
*
|
||||
* @param int|null $max_w Image width.
|
||||
* @param int|null $max_h Image height.
|
||||
* @param boolean $crop
|
||||
* @return boolean|WP_Error
|
||||
* @param bool $crop
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
public function resize( $max_w, $max_h, $crop = false ) {
|
||||
if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) )
|
||||
|
@ -338,14 +338,14 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||
* @since 3.5.0
|
||||
* @access public
|
||||
*
|
||||
* @param int $src_x The start x position to crop from.
|
||||
* @param int $src_y The start y position to crop from.
|
||||
* @param int $src_w The width to crop.
|
||||
* @param int $src_h The height to crop.
|
||||
* @param int $dst_w Optional. The destination width.
|
||||
* @param int $dst_h Optional. The destination height.
|
||||
* @param boolean $src_abs Optional. If the source crop points are absolute.
|
||||
* @return boolean|WP_Error
|
||||
* @param int $src_x The start x position to crop from.
|
||||
* @param int $src_y The start y position to crop from.
|
||||
* @param int $src_w The width to crop.
|
||||
* @param int $src_h The height to crop.
|
||||
* @param int $dst_w Optional. The destination width.
|
||||
* @param int $dst_h Optional. The destination height.
|
||||
* @param bool $src_abs Optional. If the source crop points are absolute.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) {
|
||||
if ( $src_abs ) {
|
||||
|
@ -411,8 +411,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||
* @since 3.5.0
|
||||
* @access public
|
||||
*
|
||||
* @param boolean $horz Flip along Horizontal Axis
|
||||
* @param boolean $vert Flip along Vertical Axis
|
||||
* @param bool $horz Flip along Horizontal Axis
|
||||
* @param bool $vert Flip along Vertical Axis
|
||||
* @returns true|WP_Error
|
||||
*/
|
||||
public function flip( $horz, $vert ) {
|
||||
|
|
|
@ -37,7 +37,7 @@ abstract class WP_Image_Editor {
|
|||
* @abstract
|
||||
*
|
||||
* @param array $args
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public static function test( $args = array() ) {
|
||||
return false;
|
||||
|
@ -54,7 +54,7 @@ abstract class WP_Image_Editor {
|
|||
* @abstract
|
||||
*
|
||||
* @param string $mime_type
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public static function supports_mime_type( $mime_type ) {
|
||||
return false;
|
||||
|
@ -67,7 +67,7 @@ abstract class WP_Image_Editor {
|
|||
* @access protected
|
||||
* @abstract
|
||||
*
|
||||
* @return boolean|WP_Error True if loaded; WP_Error on failure.
|
||||
* @return bool|WP_Error True if loaded; WP_Error on failure.
|
||||
*/
|
||||
abstract public function load();
|
||||
|
||||
|
@ -97,8 +97,8 @@ abstract class WP_Image_Editor {
|
|||
*
|
||||
* @param int|null $max_w Image width.
|
||||
* @param int|null $max_h Image height.
|
||||
* @param boolean $crop
|
||||
* @return boolean|WP_Error
|
||||
* @param bool $crop
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
abstract public function resize( $max_w, $max_h, $crop = false );
|
||||
|
||||
|
@ -135,8 +135,8 @@ abstract class WP_Image_Editor {
|
|||
* @param int $src_h The height to crop.
|
||||
* @param int $dst_w Optional. The destination width.
|
||||
* @param int $dst_h Optional. The destination height.
|
||||
* @param boolean $src_abs Optional. If the source crop points are absolute.
|
||||
* @return boolean|WP_Error
|
||||
* @param bool $src_abs Optional. If the source crop points are absolute.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
abstract public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false );
|
||||
|
||||
|
@ -148,7 +148,7 @@ abstract class WP_Image_Editor {
|
|||
* @abstract
|
||||
*
|
||||
* @param float $angle
|
||||
* @return boolean|WP_Error
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
abstract public function rotate( $angle );
|
||||
|
||||
|
@ -159,9 +159,9 @@ abstract class WP_Image_Editor {
|
|||
* @access public
|
||||
* @abstract
|
||||
*
|
||||
* @param boolean $horz Flip along Horizontal Axis
|
||||
* @param boolean $vert Flip along Vertical Axis
|
||||
* @return boolean|WP_Error
|
||||
* @param bool $horz Flip along Horizontal Axis
|
||||
* @param bool $vert Flip along Vertical Axis
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
abstract public function flip( $horz, $vert );
|
||||
|
||||
|
@ -173,7 +173,7 @@ abstract class WP_Image_Editor {
|
|||
* @abstract
|
||||
*
|
||||
* @param string $mime_type
|
||||
* @return boolean|WP_Error
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
abstract public function stream( $mime_type = null );
|
||||
|
||||
|
@ -410,7 +410,7 @@ abstract class WP_Image_Editor {
|
|||
* @param string|stream $filename
|
||||
* @param callable $function
|
||||
* @param array $arguments
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
protected function make_image( $filename, $function, $arguments ) {
|
||||
if ( $stream = wp_is_stream( $filename ) ) {
|
||||
|
|
|
@ -331,7 +331,7 @@ class WP_Dependencies {
|
|||
*
|
||||
* @param array $queue An array of queued _WP_Dependency handle objects.
|
||||
* @param string $handle Name of the item. Should be unique.
|
||||
* @return boolean Whether the handle is found after recursively searching the dependency tree.
|
||||
* @return bool Whether the handle is found after recursively searching the dependency tree.
|
||||
*/
|
||||
protected function recurse_deps( $queue, $handle ) {
|
||||
foreach ( $queue as $queued ) {
|
||||
|
|
|
@ -1493,8 +1493,8 @@ function separate_comments(&$comments) {
|
|||
* @global WP_Query $wp_query
|
||||
*
|
||||
* @param array $comments Optional array of comment objects. Defaults to $wp_query->comments
|
||||
* @param int $per_page Optional comments per page.
|
||||
* @param boolean $threaded Optional control over flat or threaded comments.
|
||||
* @param int $per_page Optional comments per page.
|
||||
* @param bool $threaded Optional control over flat or threaded comments.
|
||||
* @return int Number of comment pages.
|
||||
*/
|
||||
function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
|
||||
|
|
|
@ -2445,7 +2445,7 @@ function get_users_of_blog( $id = '' ) {
|
|||
* @deprecated 3.0.0
|
||||
* @deprecated Use add_theme_support( 'automatic-feed-links' )
|
||||
*
|
||||
* @param boolean $add Optional, default is true. Add or remove links. Defaults to true.
|
||||
* @param bool $add Optional, default is true. Add or remove links. Defaults to true.
|
||||
*/
|
||||
function automatic_feed_links( $add = true ) {
|
||||
_deprecated_function( __FUNCTION__, '3.0', "add_theme_support( 'automatic-feed-links' )" );
|
||||
|
|
|
@ -2057,8 +2057,8 @@ function get_next_posts_page_link($max_page = 0) {
|
|||
*
|
||||
* @since 0.71
|
||||
*
|
||||
* @param int $max_page Optional. Max pages.
|
||||
* @param boolean $echo Optional. Echo or return;
|
||||
* @param int $max_page Optional. Max pages.
|
||||
* @param bool $echo Optional. Echo or return;
|
||||
* @return string|void The link URL for next posts page if `$echo = false`.
|
||||
*/
|
||||
function next_posts( $max_page = 0, $echo = true ) {
|
||||
|
@ -2151,7 +2151,7 @@ function get_previous_posts_page_link() {
|
|||
*
|
||||
* @since 0.71
|
||||
*
|
||||
* @param boolean $echo Optional. Echo or return;
|
||||
* @param bool $echo Optional. Echo or return;
|
||||
* @return string|void The previous posts page link if `$echo = false`.
|
||||
*/
|
||||
function previous_posts( $echo = true ) {
|
||||
|
|
|
@ -615,7 +615,7 @@ function has_action($tag, $function_to_check = false) {
|
|||
* @param string $tag The action hook to which the function to be removed is hooked.
|
||||
* @param callback $function_to_remove The name of the function which should be removed.
|
||||
* @param int $priority Optional. The priority of the function. Default 10.
|
||||
* @return boolean Whether the function is removed.
|
||||
* @return bool Whether the function is removed.
|
||||
*/
|
||||
function remove_action( $tag, $function_to_remove, $priority = 10 ) {
|
||||
return remove_filter( $tag, $function_to_remove, $priority );
|
||||
|
|
|
@ -1159,7 +1159,7 @@ function get_random_header_image() {
|
|||
* @since 3.2.0
|
||||
*
|
||||
* @param string $type The random pool to use. any|default|uploaded
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
function is_random_header_image( $type = 'any' ) {
|
||||
$header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-alpha-32963';
|
||||
$wp_version = '4.3-alpha-32964';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
@ -176,7 +176,7 @@ class wpdb {
|
|||
* @since 4.2.0
|
||||
* @access private
|
||||
* @see wpdb::check_safe_collation()
|
||||
* @var boolean
|
||||
* @var bool
|
||||
*/
|
||||
private $checking_collation = false;
|
||||
|
||||
|
|
|
@ -299,8 +299,8 @@ function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
|
|||
*
|
||||
* @since MU
|
||||
*
|
||||
* @return null|boolean True if blog signup was validated, false if error.
|
||||
* The function halts all execution if the user is not logged in.
|
||||
* @return null|bool True if blog signup was validated, false if error.
|
||||
* The function halts all execution if the user is not logged in.
|
||||
*/
|
||||
function validate_another_blog_signup() {
|
||||
global $wpdb, $blogname, $blog_title, $errors, $domain, $path;
|
||||
|
|
Loading…
Reference in New Issue