• Resolved Daniel Tara

    (@pseudoxiah)


    When trying to override the function get_link() inside a class that extends the WP_Customize_Control Theme Check throws the following error:

    REQUIRED: get_link() found in the file customizer/customize-controls.php. Deprecated since version 2.1. Use get_bookmark() instead.
    Line 45: public function get_link( $setting_key = 'default' ) {

    However this is a false positive since it’s a function declaration not a function call. Maybe the regex should be changed for deprecated function to make sure it’s a call and not a declaration (i.e. not preceded by the word function).

    Another suggestion is that function calls should also be checked that they are not class-level functions (i.e. not preceded by ::).

    https://wordpress.org/plugins/theme-check/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘False positive when overriding get_link() function of WP_Customize_Control class’ is closed to new replies.