How to turn off email you receive when registered?

The function that generates the new user notification is wp_new_user_notification(). It is called by another (similarly named) function wp_new_user_notifications() which is triggered by the action hook register_new_user in the register_new_user() function. If you follow that (or even if you don’t), all you need to do is remove the wp_new_user_notifications() filter from the register_new_user action: add_action( … Read more

Categories and products in random order

as suggested by kaiser, my last working edit as solution: ok, inspired by @s_ha_dum answer i manged to get a solution: //this 1. part is out of the woocommerce-template.php and part of the woocommerce_product_subcategories() $product_cat = get_term_by( ‘slug’, $product_cat_slug, ‘product_cat’ ); $product_category_parent = $product_cat->term_id; $pcat_args = array( ‘child_of’ => $product_category_parent, ‘hide_empty’ => 1, ‘hierarchical’ => … Read more

Error: “Cannot modify header information”

The basic problem you have is that you want to send a redirect header, and that redirection code is executed too late, namely in your shortcode handler. You can send HTTP headers only before any output has been sent, not later. So what you have to do, generally speaking, is separating the shortcode logic from … Read more

Specific post user permissions

You can conditionally control which user role has the capability to edit posts edit_posts By default, contributors can edit their posts however you can add or remove capabilities for different roles and user i.d’s. add_action( ‘init’, ‘new_role_edit_posts’ ); function new_role_edit_posts() { if ( is_single(‘007’) { $role = get_role( ‘new-role’ ); $role->add_cap( ‘edit_posts’ ); } } … Read more

How to update plugin without overwrite custom code

i just wanted know that how can i update the plugin without overwrite the my previous custom code. You don’t. Well, you do the same thing over and over and over again every time you want to update. Download the plugin. Hack your changes into it. Upload to your site. Repeat. Which is why you … Read more

Posts wont expire

create for these posts a customfield with the name expires and the value is the date for disabling the post. Use the following code in the Loop of your theme. //Loop-Start if (have_posts()) : while (have_posts()) : the_post(); $exTime = get_post_custom_values(‘expires’); if (is_array($exTime)) { $exString= implode($exTime); $seconds = strtotime($exString) – time(); } else { $secondes … Read more