How to change image atributes right before an image to be saved?

If the import function you’re using uses wp_insert_post() (used also by wp_insert_attachment()) to add the new images (attachment posts) to your site, then you could perhaps use the wp_insert_attachment_data( array $data, array $postarr ) filter, which is defined inside wp_insert_post(). According to the docs it, Filters attachment post data before it is updated in or … Read more

Change Password Confirmed Email Text

Use like this. add_filter( ‘password_change_email’, ‘wpse207879_change_password_mail_message’, 10, 3 ); function wpse207879_change_password_mail_message( $pass_change_mail, $user, $userdata ) { $new_message_txt = __( ‘Some text ###USERNAME### more text even more text ###EMAIL### more text after more text last bit of text ###SITENAME###’ ); $pass_change_mail[ ‘message’ ] = $new_message_txt; return $pass_change_mail; } Reference of the above code is: Change Password … Read more

Add nofollow to custom widget posts

Solved it.. copied the class to functions.php renamed the class and used this call function wpmic_register_custom_widgets() { register_widget( ‘mic_WP_Widget_Recent_Posts’ ); } add_action( ‘widgets_init’, ‘wpmic_register_custom_widgets’ );

Post Meta Emtpy on Publish Using Transition

I got it working by looking at this post/answer: https://wordpress.stackexchange.com/a/134283/17126 Seems it can’t be done, and I changed the get_post_meta line to: $message .= ‘Email: ‘ . sanitize_text_field($_POST[‘_email’]) . ‘<br>’; Also, I could see the $_POST data coming in from post.php on submission over dev tools. And finally, I changed my hook to publish_cpt which … Read more