Which hook if user profile information is updated?

From Codex: Plugin API – Action Reference – profile_update: Note: This hook is not used on user edit/profile pages. To hook into the admin’s user edit pages, use the hook edit_user_profile_update which is located in /wp-includes/user-edit.php instead. From Codex: Plugin API – Action Reference – edit_user_profile_update: This hook only triggers when a user is viewing … Read more

Auto-retrieve YouTube Image for Thumbnail?

Hi @Jonathan Sampson: While this is not exactly what you asked for it might actually be a viable solution and it comes for free from WordPress.com thanks to @yoast‘s tweet this morning when he referenced this blog post: An Automated Way to Take Screenshots of any Website – Free Basically you can use WordPress.com’ screenshot … Read more

Hook *after* user password change?

I wonder if you’re looking for this one: /** * Fires after the user’s password is reset. * * @since 4.4.0 * * @param object $user The user. * @param string $new_pass New user password. */ do_action( ‘after_password_reset’, $user, $new_pass ); It was introduced in WordPress 4.4 and lives within the reset_password() function. The after_password_reset … Read more

Hook on trash post

The wp_trash_post hook might be what you’re looking for: Fires before a post is sent to the trash. Also, there’s the trashed_post hook: Fires after a post is sent to the trash. Here’s some untested code to get you started: function my_wp_trash_post( $post_id ) { $post_type = get_post_type( $post_id ); $post_status = get_post_status( $post_id ); … Read more

add_action(‘wp_ajax_[action name]’, myfunction) problem

In my projects I do it like that PHP function foo() { echo ‘bar’; } add_action(‘wp_ajax_foo’, ‘foo’ ); // executed when logged in add_action(‘wp_ajax_nopriv_foo’, ‘foo’ ); // executed when logged out Javascript data = { action: ‘foo’, avalue: ‘some value’, ‘anothervalue’: ‘another value’ }; jQuery.post(ajaxurl, data, function(response){ alert(response); });

Hook that fires when admin setting is saved

There is the filter ‘pre_update_option_’ . $option. You have to know the option name. Options can be updated from front-end too, so WordPress doesn’t make a difference here. Then there is an action: ‘update_option’, you get the arguments $option, $oldvalue and $_newvalue. Finally, if the update went successful, you get two further actions: do_action( “update_option_{$option}”, … Read more

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