<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function get_calender_events() { $params = array(); /*Get current date*/ $current_date = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key = "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...
<?php /* Plugin Name: Google Calender Event Plugin Plugin URI: Description: This plugin provides add event on google calender Version: 1.0 Author: Samrat Author URI: http://www.edreamztech.com */ global $samrat_db_version; $samrat_db_version = '1.0'; function samrat_install() { global $wpdb; global $samrat_db_version; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE IF NOT EXISTS `wp_google_calender_event_list` ( `id` int(11) NOT NULL AUTO_INCREMENT, `google_event_id` varchar(255) NOT NULL, `booking_id` int(11) NOT NULL, `booking_type` int(11) NOT NULL, PRIMARY KEY (`id`) ) $charset_collate;"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); dbDelta( $sql ); add_option( 'samrat_db_version', $samrat_db_version ); } register_activation_hook( __FILE__, 'samrat_install' ); //add_menu_page( $page_title, $menu_title, $capa...