How do I track which user clicked my button?

Although you can put parameters on a URL link, be really careful about the parameters you use. For example, the other answer suggest using a parameter like this: https://www.example.com/somepage/?userid=12 Using the user ID number isn’t really safe. What is to stop an unscrupulous person to use your link, but another user ID number? Bad things … Read more

Redeclare a plugins function/class in my theme?

You can extend the existing class to override a particular class method (function): class Mod_Groups_Post_Access extends Groups_Post_Access { public static function wp_get_nav_menu_items( $items = null, $menu = null, $args = null ) { // … your code … } } Then you would need to call $instance = new Mod_Groups_Post_Access(); instead of $instance = new … Read more

How to center all text body in single.php at once?

There is probably some CSS you can add via Additional CSS (in Theme CUstomization) that you could use. Use the Inspector tool of your browser (F12) to see the CSS ‘class’ element used in the content. If the class is called ‘the_content’, then add this to your Additional CSS: .the_content{text-align:center !important;} You might need this, … Read more

Javascript / PHP – closing the loop

Perhaps you could either use admin ajax or the WP REST API to send a request to the server for the user meta update. If you have a look at the WP documentation (links above) or similar questions here on WPSE, you can find examples on how to do it. Update user meta with ajax … Read more