How to trigger click events using hooks

That’s not possible (well, not without building super weird things). Action hooks are server side in PHP, clicks happen on the client side. You should probably use JavaScript to run the actions when the form is submitted. With jQuery, this could be as easy as jQuery(“#formid”).submit( function() { jQuery(“#someButton”).click(); }); Depending on what else you … Read more

Get First Post content and edit it using pre_get_posts (or similar?!)

You can use the loop_start hook which passes the $WP_Query object by reference. namespace StackExchange\WordPress; class editFirstPostContent { public function load() { if( \is_admin() ) { return; } \add_filter( ‘loop_start’, [ $this, ‘loopStart’ ] ); } public function loopStart( \WP_Query $WP_Query) { if( ! $WP_Query->is_main_query() ) { return; } if( ! isset( $WP_Query->posts[0] ) ) … Read more

How to I prevent WordPress from switching external HTTP links to HTTPS?

I suspect a bad plugin, but you didn’t provide enough information. But it could be a directive in your htaccess file that is not correct. Take a look at this question/answer for a comprehensive discussion about it: https://stackoverflow.com/questions/4398951/force-ssl-https-using-htaccess-and-mod-rewrite . If that doesn’t help, provide more information about plugins and your htaccess file contents.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)