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.

Disable Flash Uploader

Not always is the Flashuploader of WordPress a blessing and several times I preferred to have it switched off. Usually if the blog is not online and is offline behind a proxy and firewall.

flash-uploader

With the help of the Browser uploaders there is less trouble and therefore easy to abandon the added value of Flash uploaders, like loading multiple files simultaneously. You can disable the Flash uploader by using a filter. This can be done either in your theme, stored in the functions.php or in a Plugin. I use the option of switching off with the help of the Plugin Adminimize. Alternatively, the following syntax helps and the browser uploader will be available only.

Continue reading …

Change the WordPress Message

The notifications of WordPress for the author of an article or comments are not always right on the spot according to the needs. WordPress also knew that and created these functions so that it's easy to adapt notifications to your needs or can completely be replaced. Therefore, I will briefly show how to adjust the mails to your needs.

The two functions wp_notify_postauthor() and wp_notify_moderator() are used to send messages, but can be replaced. You can find these two functions in wp-includes/pluggable.php and there are all the functions included, which WordPress queries (if ( !function_exists('set_current_user') )), so that you can replace it easily. Therefore, it is a simple task to adjust the notifications in your WordPress installation.

wp-mail
Continue reading …

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 …

WordPress Updates via FTP on Windows XAMPP installations

Sometimes I have the need to simulate an ordinary hoster environment that behaves the same way as a real one would do. This also includes the automatic update behavior WordPress shows for Core, Plugins or Themes. In most cases this is useful for testing purpose but also to create tutorial screencasts like "How to use WordPress."
But if you ever tried Windows XAMPP installations, you may know, that you are not able to show the FTP update mask like your hosting would do.

That's why I was searching a solution and was ending up with writing a new Plugin for internal testing purpose.
It extends the "Dashboard" -> "Settings" -> "General Settings" with following option:
admin-general-settings-extension

If you enable this option, your local Windows based installation of XAMPP (WordPress) will ask you now at every update with the well known FTP update mask about your credentials. But it's not done by enabling this option, you will need at least a well configured FileZilla FTP Server doing the required work for you too.
Once you have configured a user, his/her home dir and access rights, WordPress will update from now on all affected components as expected but now using FTP.

The Plugin has been tested only a few days, so we are still at QA phase, but we would share this, if there is any demand for it.
Please let us know, if you are interested in. If we get a significant amount of requests, we (or especially I) will publish it on my blog Code Styling Project. This would include also a complete description, how to configure the FileZilla Server based on a simple example.

This is my first article at WP Engineer as new member. It may be a bit technical but my main work is normally developing solutions. I hope, it's interesting for you nevertheless.