
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().
NOTE: For the front-end widget, if the “Use dynamic clock?” 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.
This is most useful to see the server/blog time to judge when a time sensitive post, comment, or action would be dated by the blog (i.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.
Thanks to Moment.js for the JavaScript date handling library.
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
The plugin provides one template tag for use in your theme templates, functions.php, or plugins.
$time_format (string)
Optional. PHP-style time format string. See https://www.php.net/manual/en/datetime.format.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.
<?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 );
?>
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). Less ideally, you could put them in your active theme’s functions.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:
Example:
Instead of:
<?php c2c_blog_time(); ?>
Do:
<?php echo apply_filters( 'c2c_blog_time', '' ); ?>
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:
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:
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)
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:
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' );
Starting from $0 per month.
Rating
Reviewers
8 reviews
Tags
Developed By
Scott Reilly
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Add an interactive scratch card to engage users, reveal offers, and support lead capture through gamified participation.
Showcase videos with a video carousel that rotates or slides clips, improves visual design, and keeps visitors watching and engaged.
Present your team with a structured team member list that builds trust, supports credibility, and helps visitors connect with the people behind your brand.
Display discounts with a coupon bar that highlights special offers, drives urgency, and helps convert visitors into paying customers.
Detect ad blockers on your site to maintain visibility into user behavior and support sustainable ad-based monetization.
Use a notification bar to alert users, highlight offers, and drive clicks that boost engagement, signups, and conversions.
Show posts in an X feed that keeps updates visible, improves content discovery, and helps visitors stay engaged with your latest activity.
Create interactive quizzes with a quiz maker that lets you build custom questions, collect responses, and increase engagement with easy site integration.
Create interactive maps with color coding and tooltips to visualize data clearly and embed engaging maps on your site.
Create custom forms with a form builder that offers advanced field types, easy layout control, and flexible options for any purpose.
Show Airbnb reviews to build trust, improve credibility, and help visitors make confident booking decisions that support higher property sales.
Add an Instagram slider to your site to display social posts dynamically and keep your visual content engaging and current.
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!
