WP School Calendar paid version allows your website visitor to send the calendar important date directly to their Google Calendar account. To use this feature, you have to configure Google Calendar API settings on your plugin.
In this step by step guide, we will walk you through how to register your website for Google Calendar API in Google API Console and configure the settings on your WordPress site.
Inside the WordPress admin dashboard, go to School Calendar > Settings.
Here, you’ll see fields for Client Secret and Client ID. To get the information for these fields, you’ll need to create a web application through your Google account. This doesn’t require any coding, and we’ll show you exactly what to do.
To create an application, you’ll first need to sign into your Google account and access Google’s application registration. Clicking that link should open this Google page in a new tab or window, and you’ll want to keep your site settings open (we’ll return to those later).
Once you’ve followed that link and logged into your Google account, you should see a form named “Register your application for Google Calendar API in Google API Console”.
In the dropdown labeled Select a project where your application will be registered, leave the default option of Create a project. Choose your Country of residence and check Google API Terms of Service. Then, go ahead and click the Agree and Continue button.
Next, you should see a screen that says “The API is enabled”. To proceed to the setup page, click the Go to credentials button.
In the next page, you’ll be prompted to determine the credentials you need. Here are the fields on this page and the options you’ll need to select:
- Which API are you using? Google Calendar API
- Where will you be calling the API from? Web server (e.g. node.js, Tomcat)
- What data will you be accessing? User data
Once you’ve made these selections, click the What credentials do I need? button to go to the next step.
For this step, you’ll be creating an OAuth client ID. OAuth, or Open Authorization, is what will provide permission for your website to use your Google account to create calendar event.
For the Name field, enter anything you like or leave the default name. This is only for reference within your Google account.
Last, we need to fill out the Authorized redirect URIs field. To get the URI for your site, you’ll need to go back to the tab or window with your WordPress site. Still on the School Calendar > Settings page, you’ll need to look under the Google Calendar tab for the field labeled Authorized Redirect URI.
The value in this field should be your site’s URL followed by some extra details. You’ll need to copy this value, which is easily done by clicking the button labelled Copy URI.
After copying the URI, return to the Google APIs page and paste it into the field under Authorized Redirect URIs.
After that, you can click the Create OAuth client ID button.
For the last step in the app creation process, you’ll need to set up the consent screen. This screen will never be seen by your users since you’re only granting permission for your own site to use the Google account you own.
You’ll just need to check your email address and then enter a Product name shown to users (such as the title of your website). When you’ve completed these fields, click Continue.
You’ve now successfully created a Google web application!
Now we need to see the full details. On the last screen, click I’ll do this later to go to the Credentials page.
On the Credentials page, you can now see the details of the web application you just created. To view Client ID and Client Secret, click the edit icon.
This will open all of the details for your app. On this page, you’ll need to copy the Client ID and Client secret values.
Each of these will need to be copied into your School Calendar settings back in your WordPress admin.
Note: Be very careful not to copy any extra text or spaces with your Client ID or Client Secret, as this will result in an error in the next step.