Soft Reject - Add favicon icon wordpress theme


I add favicon icon for my theme and get soft reject with reason

  1. Please use function_exists( ‘wp_site_icon’ ) and make your existing solutions fallback only.

And here is my code

if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) {    
        echo '<link rel="shortcut icon" href="'.esc_url($this->faviconUrl).'">';

Could you help me pass this issue ?

Basically you should do something like this:

if ( ! function_exists( 'has_site_icon' ) || ! has_site_icon() ) {
   // do your own site icon code here

which looks like you are doing correctly. Maybe the $this reference confused the reviewer a little bit? Re-submit and say you’re handling it as per the WP documentation.

1 Like

Thank you, i will try

yes that the new method or it’ll get require warn on theme check

What is the solution? Where do we put the code? Thanks.