WordPress plugin intelligence profile

Blog Time

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

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 5.8
Current version4.0.1
WordPress coverageTested up to WordPress 5.8
Minimum stackWP 4.6 · PHP —
Directory statusactive
Last directory update29 Jul 20215y ago
Active installations600Adoption metric — not a quality score
WordPress.org rating3.6 / 5 from 8 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Blog Time version 4.0.1 as active, updated 5y ago and tested up to WordPress 5.8.

Overview

About this plugin

This plugin adds a dynamic, functional clock to the admin bar (at top of all admin pages) to show the server time for the blog. The clock automatically updates as time passes, as you would expect of a digital clock.

This plugin also supports a static mode which puts a timestamp string at the top of all admin pages instead of the dynamic clock. This static admin time widget can be clicked to update the time in-place (without a page reload) to show the new current server time.

Also provided is a “Blog Time” widget providing the same functionality as the admin widget, but for your sidebars. You may also utilize the plugin’s functionality directly within a theme template via use of the template tag c2c_blog_time().

” configuration option is unchecked, this plugin generates a timestamp and NOT a clock. The time being displayed is the time of the page load, or if clicked, the time when the widget last retrieved the time. It won’t actively increment time on the display.

By default the widget displays a dynamic clock that does increment time.

e. such as monitoring for when to close comments on a contest post, or just accounting for the server being hosted in a different timezone). Or, when used statically as a timestamp and not a clock, it can indicate/preserve when the page was loaded.

js for the JavaScript date handling library.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Template Tags

php, or plugins.

Functions

  • <?php function c2c_blog_time( $time_format = '', $echo = true )?>

Returns and/or displays the formatted time for the site.

Arguments

-

$time_format (string)

Optional. PHP-style time format string. php for more info.

Default is ” (which, unless otherwise modified, uses the default time forat: ‘g:i A’).

-

$echo (bool)

Optional. Echo the template info? Default is true.

Examples

-

php // Output the site's current time.

c2c_blog_time();

>

-

php // Retrieve the value for use in code, so don't display/echo it.

$site_date = c2c_blog_time( 'M d, Y', false );

>

Hooks

The plugin exposes four filters for hooking. Code using these filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain). php file.

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:

>

Do:

>

c2c_blog_time_format (filter)

The 'c2c_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).

Arguments:

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

Example:

/** * Change the default blog time string * * @param string $format The default time format. * @return string */ function change_blog_time_format( $format ) { return 'b, g:i A'; } add_filter( 'c2c_blog_time_format', 'change_blog_time_format' );

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. * * @param $show bool Status of whether the admin toolbar clock should be shown. * @return bool */ function restrict_blog_time_widget_appearance( $show ) { return 'boss' === get_current_user()->user_login; } add_filter( 'c2c_blog_time_toolbar_widget_for_user', 'restrict_blog_time_widget_appearance' );

c2c_blog_time_active_clock (filter)

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' );

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • blog
  • clock
  • datetime
  • server
  • time
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 5.8

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 5.8.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to5.8
Minimum requirementsWordPress 4.6 · PHP not listed
Update activity29 Jul 20215y ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.