Docs: Standardise the type name for booleans and integers.

This brings these docs inline with the documentation standards.

Props ravipatel, justinahinon

Fixes #51426

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


git-svn-id: http://core.svn.wordpress.org/trunk@48882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2020-10-10 20:02:05 +00:00
parent 6b7ba33d68
commit 905460bd5e
26 changed files with 50 additions and 50 deletions

View File

@ -176,7 +176,7 @@ function get_image_send_to_editor( $id, $caption, $title, $align, $url = '', $re
* @since 2.6.0
*
* @param string $html The image HTML markup to send.
* @param integer $id Image attachment ID.
* @param int $id Image attachment ID.
* @param string $caption Image caption.
* @param string $title Image title attribute (not used).
* @param string $align Image CSS alignment property.
@ -1319,7 +1319,7 @@ function image_attachment_fields_to_save( $post, $attachment ) {
* @since 2.5.0
*
* @param string $html
* @param integer $attachment_id
* @param int $attachment_id
* @param array $attachment
* @return string
*/
@ -2275,7 +2275,7 @@ function media_upload_form( $errors = null ) {
*
* @param string $type
* @param object $errors
* @param integer $id
* @param int $id
*/
function media_upload_type_form( $type = 'file', $errors = null, $id = null ) {
@ -2349,7 +2349,7 @@ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) {
*
* @param string $type
* @param object $errors
* @param integer $id
* @param int $id
*/
function media_upload_type_url_form( $type = null, $errors = null, $id = null ) {
if ( null === $type ) {

View File

@ -128,7 +128,7 @@ endif;
*
* @since Twenty Fourteen 1.0
*
* @return boolean true if blog has more than 1 category
* @return bool true if blog has more than 1 category
*/
function twentyfourteen_categorized_blog() {
$all_the_cool_cats = get_transient( 'twentyfourteen_category_count' );

View File

@ -127,7 +127,7 @@ endif;
* Display a front page section.
*
* @param WP_Customize_Partial $partial Partial associated with a selective refresh request.
* @param integer $id Front page section to display.
* @param int $id Front page section to display.
*/
function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
if ( is_a( $partial, 'WP_Customize_Partial' ) ) {

View File

@ -515,7 +515,7 @@ if ( ! function_exists( 'twentythirteen_entry_date' ) ) :
*
* @since Twenty Thirteen 1.0
*
* @param boolean $echo (optional) Whether to echo the date. Default true.
* @param bool $echo (optional) Whether to echo the date. Default true.
* @return string The HTML-formatted post date.
*/
function twentythirteen_entry_date( $echo = true ) {

View File

@ -26,7 +26,7 @@
* Displays the site logo, either text or image.
*
* @param array $args Arguments for displaying the site logo either as an image or text.
* @param boolean $echo Echo or return the HTML.
* @param bool $echo Echo or return the HTML.
* @return string Compiled HTML based on our arguments.
*/
function twentytwenty_site_logo( $args = array(), $echo = true ) {
@ -88,7 +88,7 @@ function twentytwenty_site_logo( $args = array(), $echo = true ) {
/**
* Displays the site description.
*
* @param boolean $echo Echo or return the html.
* @param bool $echo Echo or return the html.
* @return string The HTML to display.
*/
function twentytwenty_site_description( $echo = true ) {

View File

@ -75,7 +75,7 @@ class Text_Diff {
*
* @since Text_Diff 1.1.0
*
* @return integer The number of new lines
* @return int The number of new lines
*/
function countAddedLines()
{
@ -94,7 +94,7 @@ class Text_Diff {
*
* @since Text_Diff 1.1.0
*
* @return integer The number of deleted lines
* @return int The number of deleted lines
*/
function countDeletedLines()
{
@ -139,7 +139,7 @@ class Text_Diff {
/**
* Checks for an empty diff.
*
* @return boolean True if two sequences were identical.
* @return bool True if two sequences were identical.
*/
function isEmpty()
{
@ -156,7 +156,7 @@ class Text_Diff {
*
* This is mostly for diagnostic purposes.
*
* @return integer The length of the LCS.
* @return int The length of the LCS.
*/
function lcs()
{
@ -210,7 +210,7 @@ class Text_Diff {
* with array_walk().
*
* @param string $line The line to trim.
* @param integer $key The index of the line in the array. Not used.
* @param int $key The index of the line in the array. Not used.
*/
static function trimNewlines(&$line, $key)
{

View File

@ -812,7 +812,7 @@ function block_version( $content ) {
* @param array $style_properties Array containing the properties of the style name,
* label, style (name of the stylesheet to be enqueued),
* inline_style (string containing the CSS to be added).
* @return boolean True if the block style was registered with success and false otherwise.
* @return bool True if the block style was registered with success and false otherwise.
*/
function register_block_style( $block_name, $style_properties ) {
return WP_Block_Styles_Registry::get_instance()->register( $block_name, $style_properties );
@ -825,7 +825,7 @@ function register_block_style( $block_name, $style_properties ) {
*
* @param string $block_name Block type name including namespace.
* @param array $block_style_name Block style name.
* @return boolean True if the block style was unregistered with success and false otherwise.
* @return bool True if the block style was unregistered with success and false otherwise.
*/
function unregister_block_style( $block_name, $block_style_name ) {
return WP_Block_Styles_Registry::get_instance()->unregister( $block_name, $block_style_name );

View File

@ -1076,7 +1076,7 @@ class WP_Http {
* @since 3.7.0
*
* @param string $maybe_ip A suspected IP address.
* @return integer|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
* @return int|bool Upon success, '4' or '6' to represent a IPv4 or IPv6 address, false upon failure
*/
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 ) ) {

View File

@ -38,7 +38,7 @@ final class WP_Block_Styles_Registry {
* @param array $style_properties Array containing the properties of the style name, label,
* style (name of the stylesheet to be enqueued),
* inline_style (string containing the CSS to be added).
* @return boolean True if the block style was registered with success and false otherwise.
* @return bool True if the block style was registered with success and false otherwise.
*/
public function register( $block_name, $style_properties ) {
@ -69,7 +69,7 @@ final class WP_Block_Styles_Registry {
*
* @param string $block_name Block type name including namespace.
* @param string $block_style_name Block style name.
* @return boolean True if the block style was unregistered with success and false otherwise.
* @return bool True if the block style was unregistered with success and false otherwise.
*/
public function unregister( $block_name, $block_style_name ) {
if ( ! $this->is_registered( $block_name, $block_style_name ) ) {

View File

@ -192,7 +192,7 @@ class WP_Block_Type {
*
* @since 5.0.0
*
* @return boolean Whether block type is dynamic.
* @return bool Whether block type is dynamic.
*/
public function is_dynamic() {
return is_callable( $this->render_callback );

View File

@ -490,7 +490,7 @@ final class WP_Hook implements Iterator, ArrayAccess {
*
* @link https://www.php.net/manual/en/iterator.valid.php
*
* @return boolean
* @return bool Whether the current position is valid.
*/
public function valid() {
return key( $this->callbacks ) !== null;

View File

@ -45,7 +45,7 @@ class WP_HTTP_Requests_Hooks extends Requests_Hooks {
*
* @param string $hook Hook name.
* @param array $parameters Parameters to pass to callbacks.
* @return boolean True if hooks were run, false if nothing was hooked.
* @return bool True if hooks were run, false if nothing was hooked.
*/
public function dispatch( $hook, $parameters = array() ) {
$result = parent::dispatch( $hook, $parameters );

View File

@ -23,13 +23,13 @@ class WP_SimplePie_File extends SimplePie_File {
* @since 3.2.0 Updated to use a PHP5 constructor.
*
* @param string $url Remote file URL.
* @param integer $timeout Optional. How long the connection should stay open in seconds.
* @param int $timeout Optional. How long the connection should stay open in seconds.
* Default 10.
* @param integer $redirects Optional. The number of allowed redirects. Default 5.
* @param int $redirects Optional. The number of allowed redirects. Default 5.
* @param string|array $headers Optional. Array or string of headers to send with the request.
* Default null.
* @param string $useragent Optional. User-agent value sent. Default null.
* @param boolean $force_fsockopen Optional. Whether to force opening internet or unix domain socket
* @param bool $force_fsockopen Optional. Whether to force opening internet or unix domain socket
* connection or not. Default false.
*/
public function __construct( $url, $timeout = 10, $redirects = 5, $headers = null, $useragent = null, $force_fsockopen = false ) {

View File

@ -27,7 +27,7 @@ class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize {
* @since 3.5.0
*
* @param mixed $data The data that needs to be sanitized.
* @param integer $type The type of data that it's supposed to be.
* @param int $type The type of data that it's supposed to be.
* @param string $base Optional. The `xml:base` value to use when converting relative
* URLs to absolute ones. Default empty.
* @return mixed Sanitized data.

View File

@ -544,7 +544,7 @@ class WP_Widget {
*
* @since 2.8.0
*
* @param integer $number Optional. The unique order number of this widget instance
* @param int $number Optional. The unique order number of this widget instance
* compared to other instances of the same class. Default -1.
*/
public function _register_one( $number = -1 ) {

View File

@ -5574,7 +5574,7 @@ class wp_xmlrpc_server extends IXR_Server {
*
* @since 2.8.0
*
* @param integer $post_ID Post ID.
* @param int $post_ID Post ID.
* @param array $enclosure Enclosure data.
*/
public function add_enclosure_if_new( $post_ID, $enclosure ) {

View File

@ -283,7 +283,7 @@ if ( ! class_exists( 'PO', false ) ) :
/**
* @param string $filename
* @return boolean
* @return bool
*/
function import_from_file( $filename ) {
$f = fopen( $filename, 'r' );
@ -454,7 +454,7 @@ if ( ! class_exists( 'PO', false ) ) :
/**
* @param resource $f
* @param string $action
* @return boolean
* @return bool
*/
function read_line( $f, $action = 'read' ) {
static $last_line = '';

View File

@ -62,7 +62,7 @@ if ( ! class_exists( 'POMO_Reader', false ) ) :
/**
* Reads an array of 32-bit Integers from the Stream
*
* @param integer $count How many elements should be read
* @param int $count How many elements should be read
* @return mixed Array of integers or false if there isn't
* enough data or on error
*/
@ -175,7 +175,7 @@ if ( ! class_exists( 'POMO_FileReader', false ) ) :
/**
* @param int $pos
* @return boolean
* @return bool
*/
function seekto( $pos ) {
if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) {

View File

@ -116,7 +116,7 @@ if ( ! class_exists( 'Translations', false ) ) :
* This function should be overridden by the subclasses. For example MO/PO can derive the logic
* from their headers.
*
* @param integer $count number of items
* @param int $count number of items
*/
function select_plural_form( $count ) {
return 1 == $count ? 0 : 1;

View File

@ -1244,7 +1244,7 @@ function rest_get_date_with_gmt( $date, $is_utc = false ) {
*
* @since 4.7.0
*
* @return integer 401 if the user is not logged in, 403 if the user is logged in.
* @return int 401 if the user is not logged in, 403 if the user is logged in.
*/
function rest_authorization_required_code() {
return is_user_logged_in() ? 403 : 401;
@ -1341,7 +1341,7 @@ function rest_is_ip_address( $ip ) {
* @since 4.7.0
*
* @param bool|string|int $value The value being evaluated.
* @return boolean Returns the proper associated boolean value.
* @return bool Returns the proper associated boolean value.
*/
function rest_sanitize_boolean( $value ) {
// String values are translated to `true`; make sure 'false' is false.
@ -1362,7 +1362,7 @@ function rest_sanitize_boolean( $value ) {
* @since 4.7.0
*
* @param bool|string $maybe_bool The value being evaluated.
* @return boolean True if a boolean, otherwise false.
* @return bool True if a boolean, otherwise false.
*/
function rest_is_boolean( $maybe_bool ) {
if ( is_bool( $maybe_bool ) ) {

View File

@ -1371,7 +1371,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller {
* @since 4.9.0 Added the `$validate` parameter.
*
* @param string $template Page template filename.
* @param integer $post_id Post ID.
* @param int $post_id Post ID.
* @param bool $validate Whether to validate that the template selected is valid.
*/
public function handle_template( $template, $post_id, $validate = false ) {

View File

@ -1173,7 +1173,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
*
* @since 4.7.0
*
* @param integer $user_id User ID.
* @param int $user_id User ID.
* @param array $roles New user roles.
* @return true|WP_Error True if the current user is allowed to make the role change,
* otherwise a WP_Error object.

View File

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

View File

@ -58,7 +58,7 @@ class WP_Widget_Custom_HTML extends WP_Widget {
*
* @since 4.9.0
*
* @param integer $number Optional. The unique order number of this widget instance
* @param int $number Optional. The unique order number of this widget instance
* compared to other instances of the same class. Default -1.
*/
public function _register_one( $number = -1 ) {

View File

@ -96,7 +96,7 @@ abstract class WP_Widget_Media extends WP_Widget {
*
* @since 4.8.0
*
* @param integer $number Optional. The unique order number of this widget instance
* @param int $number Optional. The unique order number of this widget instance
* compared to other instances of the same class. Default -1.
*/
public function _register_one( $number = -1 ) {

View File

@ -45,7 +45,7 @@ class WP_Widget_Text extends WP_Widget {
/**
* Add hooks for enqueueing assets when registering all widget instances of this widget class.
*
* @param integer $number Optional. The unique order number of this widget instance
* @param int $number Optional. The unique order number of this widget instance
* compared to other instances of the same class. Default -1.
*/
public function _register_one( $number = -1 ) {