Skip to content

Commit 16d40a0

Browse files
committed
WP/DeprecatedFunctions: update the functions list based on WP 6.5-RC3
Based on a scan of WP Core at commit WordPress/wordpress-develop@3595704 using a preliminary sniff created for issue 1803. Includes tests.
1 parent 8b1ef9b commit 16d40a0

3 files changed

Lines changed: 77 additions & 5 deletions

File tree

WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
3737
/**
3838
* List of deprecated functions with alternative when available.
3939
*
40-
* To be updated after every major release.
41-
* Last updated for WordPress 6.3.
42-
*
4340
* Version numbers should be fully qualified.
4441
* Replacement functions should have parentheses.
4542
*
4643
* To retrieve a function list for comparison, the following tool is available:
4744
* https://github.com/JDGrimes/wp-deprecated-code-scanner
4845
*
46+
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
47+
*
4948
* @var array
5049
*/
5150
private $deprecated_functions = array(
@@ -1597,6 +1596,62 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
15971596
'alt' => '',
15981597
'version' => '6.3.0',
15991598
),
1599+
1600+
// WP 6.4.0.
1601+
'_admin_bar_bump_cb' => array(
1602+
'alt' => 'wp_enqueue_admin_bar_bump_styles()',
1603+
'version' => '6.4.0',
1604+
),
1605+
'_inject_theme_attribute_in_block_template_content' => array(
1606+
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_inject_theme_attribute_in_template_part_block\' )',
1607+
'version' => '6.4.0',
1608+
),
1609+
'_remove_theme_attribute_in_block_template_content' => array(
1610+
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), \'_remove_theme_attribute_from_template_part_block\' )',
1611+
'version' => '6.4.0',
1612+
),
1613+
'_wp_theme_json_webfonts_handler' => array(
1614+
'alt' => 'wp_print_font_faces()',
1615+
'version' => '6.4.0',
1616+
),
1617+
'print_embed_styles' => array(
1618+
'alt' => 'wp_enqueue_embed_styles()',
1619+
'version' => '6.4.0',
1620+
),
1621+
'print_emoji_styles' => array(
1622+
'alt' => 'wp_enqueue_emoji_styles()',
1623+
'version' => '6.4.0',
1624+
),
1625+
'the_block_template_skip_link' => array(
1626+
'alt' => 'wp_enqueue_block_template_skip_link()',
1627+
'version' => '6.4.0',
1628+
),
1629+
'wp_admin_bar_header' => array(
1630+
'alt' => 'wp_enqueue_admin_bar_header_styles()',
1631+
'version' => '6.4.0',
1632+
),
1633+
'wp_img_tag_add_decoding_attr' => array(
1634+
'alt' => 'wp_img_tag_add_loading_optimization_attrs()',
1635+
'version' => '6.4.0',
1636+
),
1637+
'wp_update_https_detection_errors' => array(
1638+
'alt' => 'wp_get_https_detection_errors()',
1639+
'version' => '6.4.0',
1640+
),
1641+
1642+
// WP 6.5.0.
1643+
'block_core_file_ensure_interactivity_dependency' => array(
1644+
'alt' => 'wp_register_script_module()',
1645+
'version' => '6.5.0',
1646+
),
1647+
'block_core_image_ensure_interactivity_dependency' => array(
1648+
'alt' => 'wp_register_script_module()',
1649+
'version' => '6.5.0',
1650+
),
1651+
'block_core_query_ensure_interactivity_dependency' => array(
1652+
'alt' => 'wp_register_script_module()',
1653+
'version' => '6.5.0',
1654+
),
16001655
);
16011656

16021657
/**

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,18 @@ wp_tinycolor_hsl_to_rgb();
411411
wp_tinycolor_hue_to_rgb();
412412
wp_tinycolor_rgb_to_rgb();
413413
wp_tinycolor_string_to_rgb();
414+
/* ============ WP 6.4 ============ */
415+
_admin_bar_bump_cb();
416+
_inject_theme_attribute_in_block_template_content();
417+
_remove_theme_attribute_in_block_template_content();
418+
_wp_theme_json_webfonts_handler();
419+
print_embed_styles();
420+
print_emoji_styles();
421+
the_block_template_skip_link();
422+
wp_admin_bar_header();
423+
wp_img_tag_add_decoding_attr();
424+
wp_update_https_detection_errors();
425+
/* ============ WP 6.5 ============ */
426+
block_core_file_ensure_interactivity_dependency();
427+
block_core_image_ensure_interactivity_dependency();
428+
block_core_query_ensure_interactivity_dependency();

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function getErrorList() {
8686
*/
8787
public function getWarningList() {
8888
$start_line = 368;
89-
$end_line = 413;
89+
$end_line = 428;
9090
$warnings = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
9191

9292
// Unset the lines related to version comments.
@@ -95,7 +95,9 @@ public function getWarningList() {
9595
$warnings[375],
9696
$warnings[377],
9797
$warnings[387],
98-
$warnings[390]
98+
$warnings[390],
99+
$warnings[414],
100+
$warnings[425]
99101
);
100102

101103
return $warnings;

0 commit comments

Comments
 (0)