New hooks in WordPress 3.8

WordPress 3.8 introduced one new action and five new filters:

  • automatic_updates_complete
    Action triggered after all automatic updates have run.
    (wp-admin/includes/class-wp-upgrader.php)

  • automatic_updates_debug_email
    Filter the debug email that can be sent following an automatic background core update.
    (wp-admin/includes/class-wp-upgrader.php)
  • comment_notification_notify_author
    Filter whether to notify comment authors of their comments on their own posts.
    (wp-includes/pluggable.php)
  • dashboard_glance_items
    Include additional elements in the 'At a Glance' dashboard widget. This widget was previously 'Right Now'.
    (wp-admin/includes/dashboard.php)
  • user_{$name}_label
    Filter a user contactmethod label.
    (wp-admin/user-edit.php)
  • wp_prepare_themes_for_js
    Filter the themes prepared for JavaScript, for themes.php. Could be useful for changing the order, which is by name by default.
    (wp-admin/includes/theme.php)
  • A list of all new hooks can you also find in the hot list of WP Seek.

Filename cache busting for WordPress styles and scripts

To embed custom CSS styles and scripts in WordPress you should use the wp_enqueue_script(), wp_enqueue_style(), wp_register_script() and/or wp_register_style() functions. Each of these functions allows you to define a version. By default it's the version of WordPress. The version identifier will be in the URL to the script as a query string.

The version identifier is used to expire the URL. Since the browser detects the new URL as a new resource, it will use the new instead of the cached resource.

Sadly not all endpoints respect the query string. From Google Developers:

Most proxies, most notably Squid up through version 3.0, do not cache resources with a "?" in their URL even if a Cache-control: public header is present in the response. To enable proxy caching for these resources, remove query strings from references to static resources, and instead encode the parameters into the file names themselves.

So the goal is to encode the version identifier into the filename without renaming the resource on the filesystem. This is where the following plugin comes in.
Continue reading …

Change content of WordPress Editor Buttons

Not every user likes the default settings how some buttons are displayed on the WordPress editor. As of right now, there is no possibility to adjust it directly via a filter. The following source code describes a solution to change the link buttons and their content to easily set links with custom values. The small Plugin changes the values with the help of Javascript and returns a popup for set links with custom values inside the Plugin.

Continue reading …

WordPress-Christmas-2010-21

Register Settings on WordPress Multisite

The use of WordPress for several blogs in the network can be useful to simplify several steps and is becoming increasingly popular. Whether you want the classical scenarios of blog hosting service or like to create multilingual websites or other ideas. Therefore, it is also important for plugin developers to use the functions and to expand or develop their own Plugins for it specifically.

Much is the same, but not all, and in this small article I would like to briefly explain how you set settings in the database when you activate a Plugin. Continue reading …