diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php index 5f53c12bc3dbf..c657c6c2e7af3 100644 --- a/src/wp-includes/meta.php +++ b/src/wp-includes/meta.php @@ -1397,6 +1397,8 @@ function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = * @since 6.4.0 The `$revisions_enabled` argument was added to the arguments array. * @since 6.7.0 The `label` argument was added to the arguments array. * + * @global array $wp_meta_keys Global registry for meta keys. + * * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', * 'user', or any other object type with an associated meta table. * @param string $meta_key Meta key to register. @@ -1567,6 +1569,8 @@ function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { * * @since 5.5.0 * + * @global array $wp_meta_keys Global registry for meta keys. + * * @param mixed $value Current value passed to filter. * @param int $object_id ID of the object metadata is for. * @param string $meta_key Metadata key. @@ -1646,6 +1650,8 @@ function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * + * @global array $wp_meta_keys Global registry for meta keys. + * * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', * 'user', or any other object type with an associated meta table. * @param string $meta_key Metadata key. @@ -1696,6 +1702,8 @@ function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) { * @since 4.6.0 * @since 4.9.8 The `$object_subtype` parameter was added. * + * @global array $wp_meta_keys Global registry for meta keys. + * * @param string $object_type Type of object metadata is for. Accepts 'blog', 'post', 'comment', 'term', * 'user', or any other object type with an associated meta table. * @param string $object_subtype Optional. The subtype of the object type. Default empty string. diff --git a/tests/phpunit/includes/abstract-testcase.php b/tests/phpunit/includes/abstract-testcase.php index d83b23ca4cf5c..2c2268b44de01 100644 --- a/tests/phpunit/includes/abstract-testcase.php +++ b/tests/phpunit/includes/abstract-testcase.php @@ -58,6 +58,8 @@ public static function get_called_class() { /** * Runs the routine before setting up all tests. + * + * @global wpdb $wpdb WordPress database abstraction object. */ public static function set_up_before_class() { global $wpdb; @@ -98,6 +100,8 @@ public static function tear_down_after_class() { /** * Runs the routine before each test is executed. + * + * @global WP_Rewrite $wp_rewrite WordPress rewrite rules object. */ public function set_up() { set_time_limit( 0 ); @@ -155,6 +159,11 @@ public function wp_hash_password_options( array $options, string $algorithm ): a /** * After a test method runs, resets any state in WordPress the test method might have changed. + * + * @global wpdb $wpdb WordPress database abstraction object. + * @global WP_Query $wp_the_query WordPress Query object. + * @global WP_Query $wp_query WordPress Query object. + * @global WP $wp WordPress environment object. */ public function tear_down() { global $wpdb, $wp_the_query, $wp_query, $wp; @@ -359,10 +368,10 @@ protected function reset__SERVER() { * Stores $wp_filter, $wp_actions, $wp_filters, and $wp_current_filter * on a class variable so they can be restored on tear_down() using _restore_hooks(). * - * @global array $wp_filter - * @global array $wp_actions - * @global array $wp_filters - * @global array $wp_current_filter + * @global array $wp_filter Stores all of the filters and actions. + * @global array $wp_actions Stores the number of times each action was triggered. + * @global array $wp_filters Stores the number of times each filter was triggered. + * @global array $wp_current_filter Stores the list of current filters with the current one last. */ protected function _backup_hooks() { self::$hooks_saved['wp_filter'] = array(); @@ -382,10 +391,10 @@ protected function _backup_hooks() { * Restores the hook-related globals to their state at set_up() * so that future tests aren't affected by hooks set during this last test. * - * @global array $wp_filter - * @global array $wp_actions - * @global array $wp_filters - * @global array $wp_current_filter + * @global array $wp_filter Stores all of the filters and actions. + * @global array $wp_actions Stores the number of times each action was triggered. + * @global array $wp_filters Stores the number of times each filter was triggered. + * @global array $wp_current_filter Stores the list of current filters with the current one last. */ protected function _restore_hooks() { if ( isset( self::$hooks_saved['wp_filter'] ) ) { @@ -407,6 +416,8 @@ protected function _restore_hooks() { /** * Flushes the WordPress object cache. + * + * @global WP_Object_Cache $wp_object_cache WordPress Object Cache object. */ public static function flush_cache() { global $wp_object_cache; @@ -452,7 +463,7 @@ public static function flush_cache() { * * @since 5.1.0 * - * @global array $wp_meta_keys + * @global array $wp_meta_keys Global registry for meta keys. */ public function unregister_all_meta_keys() { global $wp_meta_keys; @@ -470,6 +481,8 @@ public function unregister_all_meta_keys() { /** * Starts a database transaction. + * + * @global wpdb $wpdb WordPress database abstraction object. */ public function start_transaction() { global $wpdb; @@ -483,6 +496,8 @@ public function start_transaction() { * Commits the queries in a transaction. * * @since 4.1.0 + * + * @global wpdb $wpdb WordPress database abstraction object. */ public static function commit_transaction() { global $wpdb; @@ -1133,6 +1148,8 @@ public function normalizeDirectorySeparatorsInPath( $path ) { * @since 5.3.0 Formalized the existing `...$prop` parameter by adding it * to the function signature. * + * @global WP_Query $wp_query WordPress Query object. + * * @param string ...$prop Any number of WP_Query properties that are expected to be true for the current request. */ public function assertQueryTrue( ...$prop ) { @@ -1632,7 +1649,7 @@ public static function delete_user( $user_id ) { * * @since 4.4.0 * - * @global WP_Rewrite $wp_rewrite + * @global WP_Rewrite $wp_rewrite WordPress rewrite rules object. * * @param string $structure Optional. Permalink structure to set. Default empty. */