Skip to content

Commit ee388b9

Browse files
committed
Improve various @param docs.
See #30224. git-svn-id: https://develop.svn.wordpress.org/trunk@30673 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6bb2a4c commit ee388b9

4 files changed

Lines changed: 17 additions & 19 deletions

File tree

src/wp-includes/option.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@ function update_option( $option, $value ) {
343343
*
344344
* @since 1.0.0
345345
*
346-
* @param string $option Name of option to add. Expected to not be SQL-escaped.
347-
* @param mixed $value Optional. Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
348-
* @param mixed $deprecated Optional. Description. Not used anymore.
349-
* @param bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up.
346+
* @param string $option Name of option to add. Expected to not be SQL-escaped.
347+
* @param mixed $value Optional. Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped.
348+
* @param string $deprecated Optional. Description. Not used anymore.
349+
* @param string|bool $autoload Optional. Default is enabled. Whether to load the option when WordPress starts up.
350350
* @return bool False if option was not added and true if option was added.
351351
*/
352352
function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) {
@@ -775,7 +775,7 @@ function get_user_setting( $name, $default = false ) {
775775
*
776776
* @param string $name The name of the setting.
777777
* @param string $value The value for the setting.
778-
* @return bool true if set successfully/false if not.
778+
* @return null|bool true if set successfully/false if not.
779779
*/
780780
function set_user_setting( $name, $value ) {
781781

@@ -797,8 +797,8 @@ function set_user_setting( $name, $value ) {
797797
*
798798
* @since 2.7.0
799799
*
800-
* @param mixed $names The name or array of names of the setting to be deleted.
801-
* @return bool true if deleted successfully/false if not.
800+
* @param string $names The name or array of names of the setting to be deleted.
801+
* @return null|bool true if deleted successfully/false if not.
802802
*/
803803
function delete_user_setting( $names ) {
804804

@@ -868,7 +868,7 @@ function get_all_user_settings() {
868868
* @since 2.8.0
869869
*
870870
* @param array $user_settings
871-
* @return bool
871+
* @return null|bool
872872
*/
873873
function wp_set_all_user_settings( $user_settings ) {
874874
global $_updated_user_settings;

src/wp-includes/query.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function is_post_type_archive( $post_types = '' ) {
176176
* @since 2.0.0
177177
* @uses $wp_query
178178
*
179-
* @param mixed $attachment Attachment ID, title, slug, or array of such.
179+
* @param int|string|array $attachment Attachment ID, title, slug, or array of such.
180180
* @return bool
181181
*/
182182
function is_attachment( $attachment = '' ) {
@@ -276,8 +276,8 @@ function is_tag( $tag = '' ) {
276276
* @since 2.5.0
277277
* @uses $wp_query
278278
*
279-
* @param mixed $taxonomy Optional. Taxonomy slug or slugs.
280-
* @param mixed $term Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
279+
* @param string|array $taxonomy Optional. Taxonomy slug or slugs.
280+
* @param int|string|array $term Optional. Term ID, name, slug or array of Term IDs, names, and slugs.
281281
* @return bool
282282
*/
283283
function is_tax( $taxonomy = '', $term = '' ) {
@@ -2100,7 +2100,7 @@ protected function parse_search( &$q ) {
21002100
*
21012101
* @since 3.7.0
21022102
*
2103-
* @param array Terms to check.
2103+
* @param array $terms Terms to check.
21042104
* @return array Terms that are not stopwords.
21052105
*/
21062106
protected function parse_search_terms( $terms ) {
@@ -4540,7 +4540,7 @@ public function is_main_query() {
45404540
*
45414541
* @since 4.1.0
45424542
*
4543-
* @param object $post Post data.
4543+
* @param WP_Post $post Post data.
45444544
* @return bool True when finished.
45454545
*/
45464546
public function setup_postdata( $post ) {
@@ -4608,8 +4608,6 @@ public function setup_postdata( $post ) {
46084608
* restores the $post global to the current post in this query.
46094609
*
46104610
* @since 3.7.0
4611-
*
4612-
* @return bool
46134611
*/
46144612
public function reset_postdata() {
46154613
if ( ! empty( $this->post ) ) {

src/wp-includes/revision.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ function wp_get_post_revisions( $post_id = 0, $args = null ) {
438438
*
439439
* @since 3.6.0
440440
*
441-
* @param object $post The post object.
441+
* @param WP_Post $post The post object.
442442
* @return bool True if number of revisions to keep isn't zero, false otherwise.
443443
*/
444444
function wp_revisions_enabled( $post ) {
@@ -572,7 +572,7 @@ function _wp_get_post_revision_version( $revision ) {
572572
* @since 3.6.0
573573
* @access private
574574
*
575-
* @param object $post Post object
575+
* @param WP_Post $post Post object
576576
* @param array $revisions Current revisions of the post
577577
* @return bool true if the revisions were upgraded, false if problems
578578
*/

src/wp-includes/taxonomy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ public function sanitize_query( $queries ) {
819819
* @access public
820820
*
821821
* @param string $relation Raw relation key from the query argument.
822-
* @return Sanitized relation ('AND' or 'OR').
822+
* @return string Sanitized relation ('AND' or 'OR').
823823
*/
824824
public function sanitize_relation( $relation ) {
825825
if ( 'OR' === strtoupper( $relation ) ) {
@@ -3736,7 +3736,7 @@ function get_object_term_cache($id, $taxonomy) {
37363736
*
37373737
* @param string|array $object_ids Single or list of term object ID(s)
37383738
* @param array|string $object_type The taxonomy object type
3739-
* @return null|bool Null value is given with empty $object_ids. False if
3739+
* @return null|false Null value is given with empty $object_ids. False if
37403740
*/
37413741
function update_object_term_cache($object_ids, $object_type) {
37423742
if ( empty($object_ids) )

0 commit comments

Comments
 (0)