Why does wp_enqueue_style() in plugin not load stylesheet?

First thing to mention is that you don’t need to use wp_register_style if enqueuing within the same function. You can replace it with wp_enqueue_style and remove the duplicate. As for why your stylesheet isn’t loading, start by checking the file path. Try this instead: wp_enqueue_style(‘cl-chanimal-styles’, plugin_dir_url( __FILE__ ) . ‘css/cl-chanimal-styles.css’ ); https://codex.wordpress.org/Function_Reference/plugin_dir_url

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

Execute a function when admin changes the user role

You can use the set_user_role hook, that will only fire when the user role changes: add_action( ‘set_user_role’, function( $user_id, $role, $old_roles ) { // Your code … }, 10, 3 ); If you want to restrict this to a profile update, you can use: add_action( ‘set_user_role’, function( $user_id ) { add_action( ‘profile_update’, function( $user_id ) … 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

Remove action from plugin on other plugin

There are two things that confuse people when trying to remove a hook: The remove_action() or remove_filter() calls must take place after the add_action() or add_filter() calls, and before the hook is actually fired. This means that you must know the hook when the calls were added and when the hook is fired. The remove_action() … Read more

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