Skip to content

Commit f866cf4

Browse files
committed
WP/DeprecatedFunctions: update the functions list based on WP 6.8.1
Based on a scan of WP Core at commit WordPress/wordpress-develop@c5d3e24 using a preliminary sniff created for issue 1803. Includes tests.
1 parent d01788b commit f866cf4

File tree

3 files changed

+80
-6
lines changed

3 files changed

+80
-6
lines changed

WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
4343
* To retrieve a function list for comparison, the following tool is available:
4444
* https://github.com/JDGrimes/wp-deprecated-code-scanner
4545
*
46-
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
46+
* {@internal To be updated after every major release. Last updated for WordPress 6.8.1.}
4747
*
4848
* @var array
4949
*/
@@ -1529,6 +1529,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
15291529
'version' => '6.3.0',
15301530
),
15311531
'block_core_navigation_submenu_build_css_colors' => array(
1532+
// Verified correct alternative.
15321533
'alt' => 'wp_apply_colors_support()',
15331534
'version' => '6.3.0',
15341535
),
@@ -1545,7 +1546,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
15451546
'version' => '6.3.0',
15461547
),
15471548
'wp_get_duotone_filter_svg' => array(
1548-
'alt' => '',
1549+
'alt' => 'WP_Duotone::get_filter_svg_from_preset()',
15491550
'version' => '6.3.0',
15501551
),
15511552
'wp_get_global_styles_svg_filters' => array(
@@ -1603,11 +1604,11 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
16031604
'version' => '6.4.0',
16041605
),
16051606
'_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+
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_inject_theme_attribute_in_template_part_block" )',
16071608
'version' => '6.4.0',
16081609
),
16091610
'_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+
'alt' => 'traverse_and_serialize_blocks( parse_blocks( $template_content ), "_remove_theme_attribute_from_template_part_block" )',
16111612
'version' => '6.4.0',
16121613
),
16131614
'_wp_theme_json_webfonts_handler' => array(
@@ -1635,6 +1636,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
16351636
'version' => '6.4.0',
16361637
),
16371638
'wp_update_https_detection_errors' => array(
1639+
// Verified correct alternative.
16381640
'alt' => 'wp_get_https_detection_errors()',
16391641
'version' => '6.4.0',
16401642
),
@@ -1652,6 +1654,60 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
16521654
'alt' => 'wp_register_script_module()',
16531655
'version' => '6.5.0',
16541656
),
1657+
1658+
// WP 6.6.0.
1659+
'wp_interactivity_process_directives_of_interactive_blocks' => array(
1660+
'alt' => '',
1661+
'version' => '6.6.0',
1662+
),
1663+
'wp_render_elements_support' => array(
1664+
'alt' => 'wp_render_elements_class_name()',
1665+
'version' => '6.6.0',
1666+
),
1667+
1668+
// WP 6.7.0.
1669+
'current_user_can_for_blog' => array(
1670+
'alt' => 'current_user_can_for_site()',
1671+
'version' => '6.7.0',
1672+
),
1673+
'wp_create_block_style_variation_instance_name' => array(
1674+
'alt' => 'wp_unique_id( $variation . \'--\' )',
1675+
'version' => '6.7.0',
1676+
),
1677+
'wp_enqueue_global_styles_custom_css' => array(
1678+
'alt' => 'wp_enqueue_global_styles()',
1679+
'version' => '6.7.0',
1680+
),
1681+
'wp_get_global_styles_custom_css' => array(
1682+
'alt' => 'wp_get_global_stylesheet() or WP_Theme_JSON::get_styles_for_block()',
1683+
'version' => '6.7.0',
1684+
),
1685+
'wp_init_targeted_link_rel_filters' => array(
1686+
'alt' => '',
1687+
'version' => '6.7.0',
1688+
),
1689+
'wp_remove_targeted_link_rel_filters' => array(
1690+
'alt' => '',
1691+
'version' => '6.7.0',
1692+
),
1693+
'wp_simplepie_autoload' => array(
1694+
'alt' => 'SimplePie_Autoloader',
1695+
'version' => '6.7.0',
1696+
),
1697+
'wp_targeted_link_rel' => array(
1698+
'alt' => '',
1699+
'version' => '6.7.0',
1700+
),
1701+
'wp_targeted_link_rel_callback' => array(
1702+
'alt' => '',
1703+
'version' => '6.7.0',
1704+
),
1705+
1706+
// WP 6.8.0.
1707+
'wp_add_editor_classic_theme_styles' => array(
1708+
'alt' => 'wp_enqueue_classic_theme_styles()',
1709+
'version' => '6.8.0',
1710+
),
16551711
);
16561712

16571713
/**

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,3 +426,18 @@ wp_update_https_detection_errors();
426426
block_core_file_ensure_interactivity_dependency();
427427
block_core_image_ensure_interactivity_dependency();
428428
block_core_query_ensure_interactivity_dependency();
429+
/* ============ WP 6.6 ============ */
430+
wp_interactivity_process_directives_of_interactive_blocks();
431+
wp_render_elements_support();
432+
/* ============ WP 6.7 ============ */
433+
current_user_can_for_blog();
434+
wp_create_block_style_variation_instance_name();
435+
wp_enqueue_global_styles_custom_css();
436+
wp_get_global_styles_custom_css();
437+
wp_init_targeted_link_rel_filters();
438+
wp_remove_targeted_link_rel_filters();
439+
wp_simplepie_autoload();
440+
wp_targeted_link_rel();
441+
wp_targeted_link_rel_callback();
442+
/* ============ WP 6.8 ============ */
443+
wp_add_editor_classic_theme_styles();

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@ public function getErrorList() {
9090
*/
9191
public function getWarningList() {
9292
$start_line = 388;
93-
$end_line = 428;
93+
$end_line = 443;
9494
$warnings = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
9595

9696
// Unset the lines related to version comments.
9797
unset(
9898
$warnings[390],
9999
$warnings[414],
100-
$warnings[425]
100+
$warnings[425],
101+
$warnings[429],
102+
$warnings[432],
103+
$warnings[442]
101104
);
102105

103106
return $warnings;

0 commit comments

Comments
 (0)