Is it necessary to use escape functions on everything or is it only necessary if you’re taking input from a 3rd party? (End Users, APIs, Etc.)

that wordpress.org page was probably written by someone that do not get security. Escaping is done to make sure that your output, when is part of an HTML page, is displayed to the user as you intend it to be which means converting thing like “<” to the appropriate HTML entity. Yes, if you do … Read more

How to add fetchpriority to first 2 images in wordpress?

you can use this filter to add attributes too. e.g. like that with you own counter : add_filter(“wp_get_loading_optimization_attributes”, function ($loading_attrs, $tag_name, $attr, $context) { if (!isset($GLOBALS[“MY_PLUGIN”][“fetchpriority_count”])) { $GLOBALS[“MY_PLUGIN”][“fetchpriority_count”] = 0; } if ($GLOBALS[“MY_PLUGIN”][“fetchpriority_count”] < 5) { $GLOBALS[“MY_PLUGIN”][“fetchpriority_count”]++; $loading_attrs[“fetchpriority”] = “high”; } return $loading_attrs; }, 10, 4);