private function __construct() { $this->setup_constants(); add_action('init', array($this, 'add_localization'), 1); include_once 'includes/ecwd-shortcodes.php'; $this->includes(); $cpt_instance = ECWD_Cpt::get_instance(); $this->user_info(); add_filter('body_class', array($this, 'theme_body_class')); add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'), 5); add_action('wp_enqueue_scripts', array($this, 'enqueue_styles')); }
public static function get_instance() { if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }
<?php /** * Register all settings needed for the Settings API. * */ // Exit if accessed directly. if (!defined('ABSPATH')) { exit; } if (isset($_GET[ECWD_PLUGIN_PREFIX . '_clear_cache']) && $_GET[ECWD_PLUGIN_PREFIX . '_clear_cache'] == 1) { $cpt = ECWD_Cpt::get_instance(); $cleared = $cpt->delete_transient(); if ($cleared) { try { echo '<div class= "updated" ><p> ' . __('Cache has been deleted.', 'ecwd') . '</p></div>'; } catch (Exception $e) { } } } if (isset($_GET['ecwd_start_tour']) && $_GET['ecwd_start_tour'] == 1) { delete_user_meta(get_current_user_id(), 'ecwd_calendar_tour'); wp_redirect('edit.php?post_type=ecwd_calendar'); } if (isset($_GET[ECWD_PLUGIN_PREFIX . '_clear_autogen']) && $_GET[ECWD_PLUGIN_PREFIX . '_clear_autogen'] == 1) { $posts = get_option('auto_generated_posts'); if ($posts) { $calen_id = $posts[0]; $venue_id = $posts[1]; $org_ids = $posts[2]; $ev_ids = $posts[3];