diff options
Diffstat (limited to '')
-rw-r--r-- | wp-includes/deprecated.php | 81 |
1 files changed, 74 insertions, 7 deletions
diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index e98cad9..4de4a93 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -57,6 +57,8 @@ function get_postdata($postid) { * * @since 1.0.1 * @deprecated 1.5.0 + * + * @global WP_Query $wp_query WordPress Query object. */ function start_wp() { global $wp_query; @@ -1908,7 +1910,7 @@ function get_attachment_icon_src( $id = 0, $fullsize = false ) { $src = wp_get_attachment_url( $post->ID ); $src_file = & $file; - } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { + } elseif ( $src = wp_mime_type_icon( $post->ID, '.svg' ) ) { // No thumb, no image. We'll look for a mime-related icon instead. /** This filter is documented in wp-includes/post.php */ @@ -2217,6 +2219,8 @@ function unregister_widget_control($id) { * @deprecated 3.0.0 Use delete_user_meta() * @see delete_user_meta() * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int $user_id User ID. * @param string $meta_key Metadata key. * @param mixed $meta_value Optional. Metadata value. Default empty. @@ -2264,6 +2268,8 @@ function delete_usermeta( $user_id, $meta_key, $meta_value = '' ) { * @deprecated 3.0.0 Use get_user_meta() * @see get_user_meta() * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int $user_id User ID * @param string $meta_key Optional. Metadata key. Default empty. * @return mixed @@ -2316,6 +2322,8 @@ function get_usermeta( $user_id, $meta_key = '' ) { * @deprecated 3.0.0 Use update_user_meta() * @see update_user_meta() * + * @global wpdb $wpdb WordPress database abstraction object. + * * @param int $user_id User ID * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. @@ -2753,6 +2761,8 @@ function index_rel_link() { * @since 2.8.0 * @deprecated 3.3.0 * + * @global WP_Post $post Global post object. + * * @param string $title Optional. Link title format. Default '%title'. * @return string */ @@ -3326,7 +3336,9 @@ function gd_edit_image_support($mime_type) { return (imagetypes() & IMG_GIF) != 0; case 'image/webp': return (imagetypes() & IMG_WEBP) != 0; - } + case 'image/avif': + return (imagetypes() & IMG_AVIF) != 0; + } } else { switch( $mime_type ) { case 'image/jpeg': @@ -3337,6 +3349,8 @@ function gd_edit_image_support($mime_type) { return function_exists('imagecreatefromgif'); case 'image/webp': return function_exists('imagecreatefromwebp'); + case 'image/avif': + return function_exists('imagecreatefromavif'); } } return false; @@ -4062,8 +4076,6 @@ function _wp_register_meta_args_whitelist( $args, $default_args ) { * @deprecated 5.5.0 Use add_allowed_options() instead. * Please consider writing more inclusive code. * - * @global array $allowed_options - * * @param array $new_options * @param string|array $options * @return array @@ -4081,8 +4093,6 @@ function add_option_whitelist( $new_options, $options = '' ) { * @deprecated 5.5.0 Use remove_allowed_options() instead. * Please consider writing more inclusive code. * - * @global array $allowed_options - * * @param array $del_options * @param string|array $options * @return array @@ -5430,7 +5440,7 @@ function _wp_theme_json_webfonts_handler() { $settings = WP_Theme_JSON_Resolver::get_merged_data()->get_settings(); // If in the editor, add webfonts defined in variations. - if ( is_admin() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) { + if ( is_admin() || wp_is_rest_endpoint() ) { $variations = WP_Theme_JSON_Resolver::get_style_variations(); foreach ( $variations as $variation ) { // Skip if fontFamilies are not defined in the variation. @@ -6233,3 +6243,60 @@ function the_block_template_skip_link() { </script> <?php } + +/** + * Ensure that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ +function block_core_query_ensure_interactivity_dependency() { + _deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' ); + global $wp_scripts; + if ( + isset( $wp_scripts->registered['wp-block-query-view'] ) && + ! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-query-view']->deps, true ) + ) { + $wp_scripts->registered['wp-block-query-view']->deps[] = 'wp-interactivity'; + } +} + +/** + * Ensure that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ +function block_core_file_ensure_interactivity_dependency() { + _deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' ); + global $wp_scripts; + if ( + isset( $wp_scripts->registered['wp-block-file-view'] ) && + ! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-file-view']->deps, true ) + ) { + $wp_scripts->registered['wp-block-file-view']->deps[] = 'wp-interactivity'; + } +} + +/** + * Ensures that the view script has the `wp-interactivity` dependency. + * + * @since 6.4.0 + * @deprecated 6.5.0 + * + * @global WP_Scripts $wp_scripts + */ +function block_core_image_ensure_interactivity_dependency() { + _deprecated_function( __FUNCTION__, '6.5.0', 'wp_register_script_module' ); + global $wp_scripts; + if ( + isset( $wp_scripts->registered['wp-block-image-view'] ) && + ! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-image-view']->deps, true ) + ) { + $wp_scripts->registered['wp-block-image-view']->deps[] = 'wp-interactivity'; + } +} |