WordPress default contact form

While Jetpack is a plugin, it’s developed by WordPress and has contact forms as standard. There are some other useful features such as stats, etc. so it’s definitely worth a look. https://jetpack.com/

Role exception for a settings sub menu

You can see here a list of roles and capabilities, if you want to check if the user has a certain role, you can: $the_user = wp_get_current_user();//we get the current user if ( in_array( ‘the_name_of_your_role’, (array) $the_user->roles ) ) { //the user has the rol, add the submenu here } you can use current_user_can if … Read more

Getting Member Data From WhishList Member on Register

Please refer to the link below and read on how to use add_action correctly. https://developer.wordpress.org/reference/functions/add_action/ add_action(‘wishlistmember_shoppingcart_register’, ‘get_member_info’)); function get_member_info() { // Debug $_POST. echo ‘<pre>’; var_dump($_POST); exit; }

str_replace not preserving whitespace

Did you clear cache after making changes with trim()? Try with: str_replace( trim( $parent->name ), $link, $intro_text ); Are you sure that the term is Upbeat Electronic music and not UpbeatElectronic music? Try with this to be sure: str_replace( trim( $parent->name ), ‘ ‘ . $link, $intro_text );

Display text of price (minus 20%) on every product page in a sentence.

Assuming you would put this in a woocommerce template file, wherever you want it to display: <?php global $product; $regular_price = esc_attr( $product->get_display_price() ); $discount = 20; $currency = esc_attr( get_woocommerce_currency() ); $new_price = ($regular_price * $discount) / 100; echo ‘Get this product for ‘.$new_price.$currency.’ with (Promo code)’; ?> Untested, but should do the trick.