Is this correct usage of filters in WordPress [closed]

Umm. Normally, people ask questions here that are more than yes/no questions, but hey, I’m game.

Yes, that code looks fine to me.

Hope that helps! 🙂

Also note that there is a built in function called __return_true which is there for usage just like so:

add_filter( 'image_priority', '__return_true' );

Easy.

Also also note that “image_priority” is pretty generic for a filter name. You should ideally prefix your filter names with the plugin’s name, so that filters don’t conflict with each other.