What’s hook to use immediately after a user is authentcated [duplicate]

juste before testing login and password, you have the action wp_authenticate: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_authenticate juste after test and only if logging is successful, the action wp_login: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_login and after logging, you can also modify the URL with the filter login_redirect: https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect

Can not set custom title on some WordPress setups

This is most likely due to difference in your theme’s support. Some themes render the title by using the wp_title filter, some by using pre_get_document_title. If your theme has this line in its functions.php file: add_theme_support(‘title-tag’); Then you need to use the pre_get_document_title filter, as follows: add_filter(‘pre_get_document_title’, ‘my_title’); function my_title() { return ‘Some title’; } … Read more

How to remove scripts/style added to customize_controls_enqueue_scripts hook by current active theme

You can use the global $wp_scripts and global $wp_styles; to get all registerd scripts and styles. Eg. All Scripts // All Scripts global $wp_scripts; $all_scripts = array(); foreach( $wp_scripts->registered as $script ) : $all_scripts[$script->handle] = $script->src; endforeach; // echo ‘<pre>’; // print_r( $all_scripts ); // echo ‘</pre>’; All Styles // All Styles global $wp_styles; $all_styles … Read more

How to debug user_register hook

Rafael, (as requested, turning comments into answer) ‘user_register’ fires when a user registers, not when a user is edited or updated. Try something like https://codex.wordpress.org/edit_user_profile_update Wrt output in hooks. It depends when/how the hook is being executed. The user profile ones are tricky because wp does stuff to prevent a double submission. One could use … Read more

Featured Image Action Hook

If you wanna catch the event before saving the post, you won’t be able to do this with PHP – setting the featured image is done with JavaScript (there is a hidden field and it’s value is populated with JS when user picks a thumbnail from Media Uploader. Also the thumb preview is rendered with … Read more

How to properly setup an activation hook

You first example looks corrent. There is however a typo, hence class ‘MyPluginAdmin’ not found. You include myplugin-admin.php, but then your question seems to suggest the page holding the class is in fact my-plugin-admin.php (with a hypen). If I correct the typo and run the code there are no warnings. Edit (this works correctly): my-plugin.php: … Read more

Delay an action until current action is completed

Note that the third input argument for the save_post callback, tells us whether it’s an update or not. That could be helpful here, I think. Taking your example as is, one suggestion could be: add_action( ‘save_post’, function( $post_ID, $post, $update ) { postUpdate( $post_ID ); if ( $update ) { deleteCacheOnCloudfront( $post_ID, $post, $update ); … Read more

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