What hooks do I need to hook into to capture ever wp_user creation/change?

Those first 2 actions you linked to from the codex, user_register and profile_update should be exactly what you need. user_register runs right after a user has successfully registered and gives you access to their $user_id which you can use to retrieve any user data you need, like name, email, etc. add_action( ‘user_register’, ‘wse_custom_register_action’, 10, 1 … Read more

How to access page variable inside action hook

There is method on product class that is called is_on_sale() which actually determines if the product is on sale or not. You can access it from global $product variable. And must echo the do_shortcode. So the whole code will be like- add_action(‘woocommerce_single_product_summary’,’add_product_signup’, 10, 2); function add_product_signup() { global $product; if( $product->is_on_sale() ) { echo do_shortcode(‘[contact-form-7 … Read more

How to add a HTML element in ADMIN edit post window?

This will work. It will add a meta box below the content editor window which outputs anything you put in the get_preview_image() function. I’ve included the $post argument so you can grab info from the post. If you need this to be on a custom post type instead of posts, edit where it says ‘post’ … Read more

Is There A WordPress Hook for Accessing Attachments for A Particular Page?

Here’s one way, out of many, where we use the the_content filter and loop through the get_attached_media( $type ) to construct the list of attached media. We can e.g. use $type=”image” for images or $type = null for all mime types. add_filter( ‘the_content’, function( $content ) { // Nothing to do – target single posts … Read more

WordPress wraps span tags into p tags

I have investigated this problem and recognized that it is not the TinyMCE fault, but the issue is caused by the the hook function wpautop instead. And tags are wrapped just before post is being displayed. So in order to fix this issue just remove the hook function like that. remove_filter( ‘the_content’, ‘wpautop’ ); This … Read more

What hook should I use that will fire whenever I open a post for editing in the WP back-end?

Don’t what you want to do but here is something that I did earlier on editor page of post type. function wpb_change_title_text( $title ){ $screen = get_current_screen(); if ( ‘post’ == $screen->post_type ) { //Specify post type $title=”New Placeholder text will come here “; //Enter new placeholder text } return $title; } add_filter( ‘enter_title_here’, ‘wpb_change_title_text’ … Read more