Deactivate WordPress Default Widgets

You do not always want to have all the widgets active, which comes within the WordPress core.

You can disable the unneccessary Widgets in your functions.php of your theme with a small function. The following syntax will switch off all the standard widgets. It should therefore be adjusted depending on your requirements:

// unregister all default WP Widgets
function unregister_default_wp_widgets() {

	unregister_widget('WP_Widget_Pages');

	unregister_widget('WP_Widget_Calendar');

	unregister_widget('WP_Widget_Archives');

	unregister_widget('WP_Widget_Links');

	unregister_widget('WP_Widget_Meta');

	unregister_widget('WP_Widget_Search');

	unregister_widget('WP_Widget_Text');

	unregister_widget('WP_Widget_Categories');

	unregister_widget('WP_Widget_Recent_Posts');

	unregister_widget('WP_Widget_Recent_Comments');

	unregister_widget('WP_Widget_RSS');

	unregister_widget('WP_Widget_Tag_Cloud');
}

add_action('widgets_init', 'unregister_default_wp_widgets', 1);

The function unregister_widget() needs as parameters the class, therefore the code is working since version 2.8 only. In prior versions, Widgets were supported differently.

How to create your own Widgets since WordPress Version 2.8 is explained in Build A WordPress 2.8 Widget With The New Widget API.

Use WordPress Cache

WordPress has an internal cache, also for extensions can be used. There are various functions available and you don't have to create something new, you can easily use the cache functionality of WordPress.
To get to know and understand the features a little bit, I use a small example, therefore I cache in the following tutorial a feed, which should be displayed in the frontend.

All functions of cache are in the Codex by WordPress listed, so a look at the Codex is worthwhile if you deal with the syntax.

The first cache solution came with WordPress 2.3 and was file based. The cache was optional and had some parameters to configure.
You were able to activate via following constant: define ( 'ENABLE_CACHE', true);
Continue reading …

Change WordPress Mail Sender

WordPress makes it easy and fast to add new users in the backend. Since version 2.8 of WordPress, it can send the access information via email. A nice feature, with no additional settings to change the sender of this email. For example the email should be send from the administrator instead from WordPress.

Nevertheless, there is a possibility and with the help of two hooks, the sender can be changed. I created a small Plugin, where you can easy and simple adjust the sender name and sender email.
Continue reading …

Warning Message For Self Customized Plugins

Now and then you have to modify an existing Plugin for your own special needs. But you still get a message if an update exists for the original Plugin. If you modified the Plugin several month ago and you forgot about it, so you update the Plugin and all your modifications are gone. Most of the time you have a backup, but even though it's annoying to upload the customized Plugin again after you realized the original Plugin is not exactly what you want. Therefore you can paste a little function in the specified Plugin to display a warning right after the update message. So you won't forget, that you modified this Plugin a while ago.

plugin-modified-warning-small

function my_update_notice() {
	$info = __( 'ATTENTION! Plugin was modified.', MY_TEXTDOMAIN );
	echo '<span class="spam">' . strip_tags( $info, '<br><a><b><i><span>' ) . '</span>';
}

if ( is_admin() )
	add_action( 'in_plugin_update_message-' . plugin_basename(__FILE__), 'my_update_notice' );

Recents Drafts All Authors

It's not uncommon that a blog runs by different authors, so it may be useful if you can have a quick look at the drafts of all authors. In our joint blog WP Engineer we created a feed, which keeps us up to date if a new draft of all authors were created.

The work of every author is different and the dashboard is the center of information. Therefore we have decided to supplement a widget in the Dashboard, which shows the last five drafts of all authors. I enhanced the existing Plugin Draft Feed.

  • It provides a feed of all drafts
  • And the last 5 drafts of all authors in the Dashboard.

Continue reading …

More Memory For WordPress – More Information About WordPress

wp-system-health
WordPress is growing and growing, with the growing of WordPress the demand of memory is also growing. The standard use is WordPress 32MByte (see settings.php ), which is not even provided by every hoster today. This is a problem - therefore: Lovely Hoster, give users more memory!

But also to use the memory, it requires a small syntax extension in the configuration of WordPress.
Continue reading …