WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Blog Time

Version: 3.0 Display the time according to your blog via admin toolbar widget, a sidebar widget, and/or template tag.

Filters

The plugin exposes four filters for hooking. Typically, customizations utilizing these hooks would be put into your active theme's functions.php file, or used by another plugin.

c2c_blog_time (filter)

The 'c2c_blog_time' hook allows you to use an alternative approach to safely invoke c2c_blog_time() in such a way that if the plugin were deactivated or deleted, then your calls to the function won't cause errors in your site.

Arguments:

  • same as for c2c_blog_time()

Example:

Instead of:

`<?php c2c_blog_time(); ?>`

Do:

`<?php echo apply_filters( 'c2c_blog_time', '' ); ?>`

blog_time_format (filter)

The 'blog_time_format' hook allows you to customize the default format for the blog time. By default this is 'g:i A' (though this may be different if modified by localization). NOTE: This currently only applies to the static clock and not the dynamic clock.

Arguments:

  • $format (string): The default format for the blog time.

Example:

// Change the default blog time string
add_filter( 'blog_time_format', 'change_blog_time_format' );
function change_blog_time_format( $format ) {
    return 'b, g:i A';
}

c2c_blog_time_toolbar_widget_for_user (filter)

The 'c2c_blog_time_toolbar_widget_for_user' hook allows you to control if the admin toolbar clock widget should be shown, on a per-user basis. By default the admin toolbar clock is shown to everyone who can see the admin toolbar.

Arguments:

  • $shown (boolean): Whether the admin toolbar clock widget should be shown. Default of true.

Example:

// Only show the admin toolbar clock for the 'boss' user.
add_filter( 'c2c_blog_time_toolbar_widget_for_user', 'restrict_blog_time_widget_appearance' );
function restrict_blog_time_widget_appearance( $show ) {
    return 'boss' == get_current_user()->user_login;
}

c2c_blog_time_active_clock (filter)

The 'c2c_blog_time_active_clock' hook returns the boolean value indicating if the Javascript-powered dynamic clock introduced in v2.0 should be enabled or if instead the v1.x era behavior of a static timestamp that can be clicked to update the timestamp via AJAX should be enabled. By default the dynamic clock is enabled.

Arguments:

  • $allow (boolean): Boolean indicating if the admin widget should be a dynamic clock. Default is true.

Example:

// Disable the dynamic clock and use the static timestamp (whcih can be clicked to update the time via AJAX) instead.
add_filter( 'c2c_blog_time_active_clock', '__return_false' );

Requires: 3.3 or higher
Compatible up to: 3.3.2
Last Updated: 2011-7-21
Downloads: 6,143

Ratings

3 stars
3.4 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,4,4
0,1,0
100,2,2
100,1,1
0,1,0
100,1,1