Can I use a Shortcode output as an HTML attribute value?

I am not good at Regex but do_shortcode will basically will not parse any shortcode in the attributes, this might help you out: add_filter(‘the_content’, function($c){ $pattern = ‘/<span\s*(.*?)data-value=[“\’]?\[(.*?)\][“\’]?\s*(.*?)>\s*(.*?)\s*<\/span>/si’; $c = preg_replace_callback($pattern, function($c){ return isset( $c[2] ) ? str_replace( $c[2], do_shortcode(“[{$c[2]}]”), $c[0] ) : array_pop($c); }, $c); return $c; });

How to show popup to a group of users?

The way I’d approach this problem is to give a certain role to users you want to be shown the popup. ( If you’re looking to show the popup to different users that are logged out of WordPress, that’s out of scope for this StackExchange. ) I’d then use the wp_loaded hook to check the … Read more

Website dumps encoded result

So my previous search results were actually true. This problem was coming because of a cache plug-in. I am hosting this website at BlueHost and there was a plug-in named endurance-page-cache that was installed by BlueHost to improve the page speed and i was not aware of.From my search i found out that other people … Read more

Cannot run the code after I activate the plugin

you can not, and should not be able to write to files directly. You need to use the wordpress filesystem api https://codex.wordpress.org/Filesystem_API which either requires a pre configuration on the site or user manual control. In addition it is just wrong to automatically write anything into wp-config.php as any mistake will bring down the site … Read more