GCal Days

GCal Days

Wordpress plugin

Install on Wordpress

App Details

This plugin provides a shortcode and a set of functions to return the number of days since the most recent past event in your Google Calendar matching specified search terms. The shortcode can also be used to return the number of days until the closest upcoming event matching specified search terms.

The Shortcode

[gcal-days search="" type="" id=""] 

The shortcode name is gcal-days. It has three attributes, but only one of which is absolutely necessary:

  • search: (Required.) The search term.
  • type: (Optional.) The direction in time to search. Defaults to “since”, which searches past events. “until” will search future events.
  • id: (Conditionally optional.) The ID of the calendar to search. You can discover the IDs of calendars via the plugin’s settings page. This shortcode attribute can only be optionally omitted from shortcodes if you define a default calendar in the plugin’s settings.

The shortcode outputs a number representing the number of days until a matching event. If no event is found, a -1 will be displayed.

Examples: [gcal-days search="dentist"], [gcal-days type="until" search="vacation" id="[email protected]"]

Links: Plugin Homepage | Plugin Directory Page | Author Homepage

Functions

The plugin provides two functions for use in your theme templates, functions.php, or in plugins.

Functions

  • <?php function gcal_days_since( $search, $calendar_id = '' ) ?>
  • <?php function gcal_days_until( $search, $calendar_id = '' ) ?>

Arguments

  • $search (string)
    Required. The word or phrase to search for

  • $calendar_id (string)
    Optional. The ID for the Google Calendar. Check the plugin’s settings page for calendar IDs. This argument is only optional if you have defined a default calendar via the plugin’s settings.

Return Value

An integer value of the number of days since/until the matching event. -1 is returned if no event was found or an error was encountered.

Examples

  • <?php // Days until next dentist appointment
    $days_until = gcal_days_until( 'dentist' );
    ?>

  • <?php
    // Get the days since my last day off
    $days_since = gcal_days_since( 'day off' );
    // Echo a message using that number
    if ( -1 == $days_since ) {
    echo "You've never had a day off?! Take one soon!";
    } else {
    printf( _n( 'Your last day off was %d day ago.', 'Your last day off was $d days ago.', $days_since ), $days_since );
    }
    ?>

Pricing

Starting from $0 per month.

Check Out the Facebook Feed Widget

By Common Ninja

Facebook FeedTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

calendar
gcal
google
shortcode

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

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

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Facebook Feed for Wordpress logo

Facebook Feed

Show Facebook posts in a live Facebook feed that keeps content fresh, boosts social proof, and helps visitors engage more with your brand.

App Store Reviews for Wordpress logo

App Store Reviews

Show Apple App Store reviews to build trust, strengthen credibility, and help visitors make confident download decisions that support app growth.

Vimeo Feed for Wordpress logo

Vimeo Feed

Show Vimeo videos in a Vimeo feed that keeps content fresh and helps visitors discover more of your video library.

Support Form for Wordpress logo

Support Form

Use a support form that lets customers submit tickets, saves each request, sends notifications, and helps you manage support more efficiently.

FAQ for Wordpress logo

FAQ

Add an FAQ section to your site to answer common questions, reduce support requests, and give visitors a smoother and more confident user experience.

Contact Form for Wordpress logo

Contact Form

Use a contact form so visitors can send messages, submit inquiries, and help you collect leads and improve user experience.

Scroll Progress for Wordpress logo

Scroll Progress

Use a scroll progress bar that visually tracks reading on the page, improves navigation, and keeps visitors aware of their position.

Linkedin Feed for Wordpress logo

Linkedin Feed

Show LinkedIn posts in a live feed that keeps updates current, builds credibility, and helps visitors engage with your brand.

Slide-In Panel for Wordpress logo

Slide-In Panel

Slide in panel that appears from the top or bottom to highlight offers, capture attention, and guide visitors toward more conversions.

Mastodon Feed for Wordpress logo

Mastodon Feed

Show Mastodon posts in a live Mastodon feed that keeps content fresh, strengthens your social presence, and helps visitors engage with your updates.

Charts & Graphs for Wordpress logo

Charts & Graphs

Add charts and graphs to your site to present data clearly, help visitors understand insights faster, and support more confident decision making.

Wake Up Notifications for Wordpress logo

Wake Up Notifications

Use wake up notifications to re engage visitors with custom alerts that capture attention, boost interaction, and help increase conversions across your site.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

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!

Multiple platforms