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

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

Can plugins become obsolete?

I presume WordPress plugins are made by third parties. For the moment, yes; all except for “Hello Dolly!” and “Akismet”, which are part of the core distribution. Do plugins have to be kept up to date with WordPress upgrades? Certainly they should be; but they’re not required to be kept up-to-date. Can plugins become obsolete? … Read more

Overrides Plugin Files on WordPress Themes

If you’ve written the plugin, then I’d suggest you add something like this: // Define these constants once in your main plugin init file define( ‘YOUR_PLUGIN_SLUG’, ‘your-plugin-slug’ ); define( ‘YOUR_PLUGIN_DIR’, plugin_dir_path( __FILE__ ) ); define( ‘YOUR_PLUGIN_TEMPLATE_DIR’, trailingslashit( YOUR_PLUGIN_DIR ) . ‘templates’ ); define( ‘YOUR_PLUGIN_THEME_TEMPLATE_OVERRIDE_PATH_DIR’, trailingslashit( get_stylesheet_directory() . “https://wordpress.stackexchange.com/” . YOUR_PLUGIN_SLUG ); // Define a function … Read more

Plugin readme.txt and assets internationalization

You can use the translation option via “GlotPress” on each plugin in the official plugin repository. You find all relevant hints in this post of the make blog at wordpress.org. In short, on each plugin you have a translation link and that give all users the chance to contribute translations.