Skip to content

Commit ab2efa3

Browse files
committed
WP/DeprecatedFunctions: update the functions list based on WP 6.3-RC1
Updates the list of deprecated functions in the `WP.DeprecatedFunctions` sniff based on the WP 6.3.0-beta2 release. Input for this based on @JDGrimes's WP deprecated code scanner, though that is getting more and more difficult to run as it is no longer maintained and is throwing lots of errors. Previous: 2121
1 parent 690f93e commit ab2efa3

File tree

3 files changed

+136
-4
lines changed

3 files changed

+136
-4
lines changed

WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
4040
* List of deprecated functions with alternative when available.
4141
*
4242
* To be updated after every major release.
43-
* Last updated for WordPress 4.8.
43+
* Last updated for WordPress 6.3.
4444
*
4545
* Version numbers should be fully qualified.
4646
* Replacement functions should have parentheses.
@@ -51,7 +51,6 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
5151
* @var array
5252
*/
5353
private $deprecated_functions = array(
54-
5554
// WP 0.71.
5655
'the_category_head' => array(
5756
'alt' => 'get_the_category_by_ID()',
@@ -1496,6 +1495,110 @@ final class DeprecatedFunctionsSniff extends AbstractFunctionRestrictionsSniff {
14961495
'alt' => 'wp_style_engine_get_styles()',
14971496
'version' => '6.1.0',
14981497
),
1498+
1499+
// WP 6.2.0.
1500+
'_resolve_home_block_template' => array(
1501+
'alt' => '',
1502+
'version' => '6.2.0',
1503+
),
1504+
'get_page_by_title' => array(
1505+
'alt' => 'WP_Query',
1506+
'version' => '6.2.0',
1507+
),
1508+
1509+
// WP 6.3.0.
1510+
'_wp_tinycolor_bound_alpha' => array(
1511+
'alt' => '',
1512+
'version' => '6.3.0',
1513+
),
1514+
'block_core_navigation_get_classic_menu_fallback' => array(
1515+
'alt' => 'WP_Navigation_Fallback::get_classic_menu_fallback',
1516+
'version' => '6.3.0',
1517+
),
1518+
'block_core_navigation_get_classic_menu_fallback_blocks' => array(
1519+
'alt' => 'WP_Navigation_Fallback::get_classic_menu_fallback_blocks',
1520+
'version' => '6.3.0',
1521+
),
1522+
'block_core_navigation_get_most_recently_published_navigation' => array(
1523+
'alt' => 'WP_Navigation_Fallback::get_most_recently_published_navigation',
1524+
'version' => '6.3.0',
1525+
),
1526+
'block_core_navigation_maybe_use_classic_menu_fallback' => array(
1527+
'alt' => 'WP_Navigation_Fallback::create_classic_menu_fallback',
1528+
'version' => '6.3.0',
1529+
),
1530+
'block_core_navigation_parse_blocks_from_menu_items' => array(
1531+
'alt' => 'WP_Navigation_Fallback::parse_blocks_from_menu_items',
1532+
'version' => '6.3.0',
1533+
),
1534+
'block_core_navigation_submenu_build_css_colors' => array(
1535+
'alt' => 'wp_apply_colors_support()',
1536+
'version' => '6.3.0',
1537+
),
1538+
'wlwmanifest_link' => array(
1539+
'alt' => '',
1540+
'version' => '6.3.0',
1541+
),
1542+
'wp_get_duotone_filter_id' => array(
1543+
'alt' => '',
1544+
'version' => '6.3.0',
1545+
),
1546+
'wp_get_duotone_filter_property' => array(
1547+
'alt' => '',
1548+
'version' => '6.3.0',
1549+
),
1550+
'wp_get_duotone_filter_svg' => array(
1551+
'alt' => '',
1552+
'version' => '6.3.0',
1553+
),
1554+
'wp_get_global_styles_svg_filters' => array(
1555+
'alt' => '',
1556+
'version' => '6.3.0',
1557+
),
1558+
'wp_get_loading_attr_default' => array(
1559+
'alt' => 'wp_get_loading_optimization_attributes()',
1560+
'version' => '6.3.0',
1561+
),
1562+
'wp_global_styles_render_svg_filters' => array(
1563+
'alt' => '',
1564+
'version' => '6.3.0',
1565+
),
1566+
'wp_img_tag_add_loading_attr' => array(
1567+
'alt' => 'wp_img_tag_add_loading_optimization_attrs()',
1568+
'version' => '6.3.0',
1569+
),
1570+
'wp_queue_comments_for_comment_meta_lazyload' => array(
1571+
'alt' => 'wp_lazyload_comment_meta()',
1572+
'version' => '6.3.0',
1573+
),
1574+
'wp_register_duotone_support' => array(
1575+
'alt' => 'WP_Duotone::register_duotone_support()',
1576+
'version' => '6.3.0',
1577+
),
1578+
'wp_render_duotone_support' => array(
1579+
'alt' => 'WP_Duotone::render_duotone_support()',
1580+
'version' => '6.3.0',
1581+
),
1582+
'wp_tinycolor_bound01' => array(
1583+
'alt' => '',
1584+
'version' => '6.3.0',
1585+
),
1586+
'wp_tinycolor_hsl_to_rgb' => array(
1587+
'alt' => '',
1588+
'version' => '6.3.0',
1589+
),
1590+
'wp_tinycolor_hue_to_rgb' => array(
1591+
'alt' => '',
1592+
'version' => '6.3.0',
1593+
),
1594+
'wp_tinycolor_rgb_to_rgb' => array(
1595+
'alt' => '',
1596+
'version' => '6.3.0',
1597+
),
1598+
'wp_tinycolor_string_to_rgb' => array(
1599+
'alt' => '',
1600+
'version' => '6.3.0',
1601+
),
14991602
);
15001603

15011604
/**

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,3 +384,30 @@ install_global_terms();
384384
sync_category_tag_slugs();
385385
wp_get_attachment_thumb_file();
386386
wp_typography_get_css_variable_inline_style();
387+
/* ============ WP 6.2 ============ */
388+
_resolve_home_block_template();
389+
get_page_by_title();
390+
/* ============ WP 6.3 ============ */
391+
_wp_tinycolor_bound_alpha();
392+
block_core_navigation_get_classic_menu_fallback();
393+
block_core_navigation_get_classic_menu_fallback_blocks();
394+
block_core_navigation_get_most_recently_published_navigation();
395+
block_core_navigation_maybe_use_classic_menu_fallback();
396+
block_core_navigation_parse_blocks_from_menu_items();
397+
block_core_navigation_submenu_build_css_colors();
398+
wlwmanifest_link();
399+
wp_get_duotone_filter_id();
400+
wp_get_duotone_filter_property();
401+
wp_get_duotone_filter_svg();
402+
wp_get_global_styles_svg_filters();
403+
wp_get_loading_attr_default();
404+
wp_global_styles_render_svg_filters();
405+
wp_img_tag_add_loading_attr();
406+
wp_queue_comments_for_comment_meta_lazyload();
407+
wp_register_duotone_support();
408+
wp_render_duotone_support();
409+
wp_tinycolor_bound01();
410+
wp_tinycolor_hsl_to_rgb();
411+
wp_tinycolor_hue_to_rgb();
412+
wp_tinycolor_rgb_to_rgb();
413+
wp_tinycolor_string_to_rgb();

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getErrorList() {
8585
*/
8686
public function getWarningList() {
8787
$start_line = 362;
88-
$end_line = 386;
88+
$end_line = 413;
8989
$warnings = array_fill( $start_line, ( ( $end_line - $start_line ) + 1 ), 1 );
9090

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

101103
// Temporarily until PHPCS supports PHP 8.2.

0 commit comments

Comments
 (0)