str_replace css meta tag?

Don’t do that, use wp_enqueu_style with wp_register_style and wp_deregister_style http://codex.wordpress.org/Function_Reference/wp_enqueue_style http://codex.wordpress.org/Function_Reference/wp_register_style Also a $priority of 20k..why would you pick such an arbitrary number.

Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]

Please go through the code below. I have tried and tested 🙂 /** * Adds a box to the side column on the Order edit screens. * It checks if the order status is completed & then adds meta box. */ function add_drivers_meta_box() { global $current_screen; /* In the second condistion below, please change it … Read more

How to display before H1 Title

Try to use filter like add_filter(‘the_title’, ‘new_title’, 10, 2); function new_title($title, $id) { if(‘your-post-type’ == get_post_type($id)) $title=”Add your DIV block here”; $title .= $title; return $title; }

How to use the password_reset hook to validate new password and display error

You can try using hook the validate_password_reset to validate password. Following code can be used to validate alphanumeric password. add_action(‘validate_password_reset’,’wdm_validate_password_reset’,10,2); function wdm_validate_password_reset( $errors, $user) { $exp = ‘/^(?=.*\d)((?=.*[a-z])|(?=.*[A-Z])).{6,32}$/’; if(strlen($_POST[‘pass1’])<6 || !preg_match($exp, $_POST[‘pass1’]) ) $errors->add( ‘error’, ‘Password must be alphanumeric and contain minimum 6 characters.’,”); }

How to filter part of a variable if it is no array?

The documentation is well explicable of the topic, let’s have a look here https://developer.wordpress.org/reference/functions/apply_filters/. In your specific case my_filter is applied no matter what, even if there is no value it. To apply the filter only if is_array() you could insert a specific instruction directly into your filter like: function example_callback( $output ) { if(is_array($output)){ … Read more

Send a custom notification to customer on WooCommerce cancelled order status

A better solution will be to use all arguments included in woocommerce_order_status_cancelled hooked function, so the missing $order variable. Also as the action hook woocommerce_order_status_cancelled is triggered when order status change to “cancelled”, so in your code, if ($order->has_status(‘cancelled’)) { is not needed. Then your code will be: add_filter(‘woocommerce_order_status_cancelled’, ‘woocommerce_send_mail_abandonned_order’, 10, 2 ); function woocommerce_send_mail_abandonned_order( … Read more

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