Register new user, assign custom role then send email

TO really fit your needs, I think it’s better to rewrite some part of wp_insert_user() function, some part can interrest you $user_email = apply_filters( ‘pre_user_email’, $raw_user_email ); And : $illegal_logins = (array) apply_filters( ‘illegal_user_logins’, array() ); if ( in_array( strtolower( $user_login ), array_map( ‘strtolower’, $illegal_logins ) ) ) { return new WP_Error( ‘invalid_username’, __( ‘Sorry, … Read more

How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit

You can count the number of words in your text to check if it’s greater than 15 using the str_word_count php function, and if not return your read more link also So i would modify your custom field excerpt thus: function custom_field_excerpt() { global $post; $text = get_field(‘description’); if (” != $text) { $text = … 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 edit/replace Parent functions.php function in Child Theme to add “Walker” class

Go to your functions.php in your child theme add this: function childtheme_override_tesseract_output_menu( $cont, $contClass, $location, $depth ) { //tesseract_output_menu function code modified as you wish here } In your parent theme functions.php, wrap the tesseract_output_menu function like this: if (function_exists(‘childtheme_override_tesseract_output_menu’)) { /** * run the child override */ function tesseract_output_menu() { childtheme_override_tesseract_output_menu(); } } else … Read more

WooCommerce coupon hook argument NULL when using filter woocommerce_get_shop_coupon_data

You need to tell add_filter how many arguments it accepts (2) example: add_filter(‘woocommerce_get_shop_coupon_data’, array( $this, ‘filter_woocommerce_get_shop_coupon_data’ ), 10, 2 ); Be sure to enable WP_Debug – http://wpexplorer-themes.com/total/docs/enabling-wp-debug/ – on your server, because you should have gotten an error when trying to do this without the added argument. Also I highly recommend using static classes when … Read more