How to check post type when using sanitize_title hook?

As @Jacob mentioned, is an generic utility function used in many contexts and therefore, you might want to either use other approach or hook it selectively through other hook where you would have $post object (e.g. edit_post or other way to define if the post edited is of page type. Something along these lines: <?php … 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

Save User Meta Email Address in Lowercase

you can use this filter to do that add_filter(“sanitize_email”, function ($sanitized_email, $email, $message) { $sanitized_email = strtolower($sanitized_email); return $sanitized_email; }, 10, 3); but I am not sure if using “strtolower” is a good idea, does another readers know if it’s better to use “mb_strtolower” to handle multibyte characters ? https://www.php.net/manual/en/ref.mbstring.php

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