/** * Initialize the class and set its properties. * * @access public * @since 0.9.0 * @return void */ public function __construct($field_id, $field) { parent::__construct(); $this->field_id = $field_id; $this->field = $field; $this->existing_settings = get_option($this->plugin_settings_name); }
/** * Define the core functionality of the plugin. * * Set the plugin name and the plugin version that can be used throughout the plugin. * Load the dependencies, define the locale, and set the hooks for the Dashboard and * the public-facing side of the site. * * @since 0.9.0 */ public function __construct($plugin_basename) { parent::__construct(); $this->plugin_basename = $plugin_basename; $this->load_dependencies(); $this->set_locale(); $this->define_admin_hooks(); }
/** * Initialize the class and set its properties. * * @since 0.9.0 */ public function __construct() { parent::__construct(); $settings = get_option($this->plugin_settings_name); $this->subdomain = $settings['subdomain']; $this->username = $settings['credentials']['username']; $this->password = $this->decrypt($settings['credentials']['password']); if (isset($settings['groups-enabled']) && $settings['groups-enabled'] == 1) { $this->enabled_apis['group_profiles'] = true; } if (isset($settings['calendar-enabled']) && $settings['calendar-enabled'] == 1) { $this->enabled_apis['public_calendar_listing'] = true; // use sane defaults if this advanced setting isn't set if (!isset($settings['calendar-date-range-type'])) { $this->calendar_start_date = date('Y-m-d', strtotime('1 weeks ago')); $this->calendar_end_date = date('Y-m-d', strtotime('+16 weeks')); } elseif ($settings['calendar-date-range-type'] == 'relative') { $this->calendar_start_date = date('Y-m-d', strtotime($settings['calendar-relative-weeks-past'] . ' weeks ago')); $this->calendar_end_date = date('Y-m-d', strtotime('+' . $settings['calendar-relative-weeks-future'] . ' weeks')); } elseif ($settings['calendar-date-range-type'] == 'specific') { // TODO: Use localization for date formats other than U.S. if ($settings['calendar-specific-start']) { $last_year = strtotime('1 year ago'); $start_timestamp = strtotime($settings['calendar-specific-start']); if (abs($start_timestamp - $last_year) > 0) { $this->calendar_start_date = date('Y-m-d', $start_timestamp); } else { $this->calendar_start_date = date('Y-m-d', $last_year); } } else { $this->calendar_start_date = date('Y-m-d'); } if ($settings['calendar-specific-end']) { $next_year = strtotime('+1 year'); $end_timestamp = strtotime($settings['calendar-specific-end']); if (abs($next_year - $end_timestamp) > 0) { $this->calendar_end_date = date('Y-m-d', $end_timestamp); } else { $this->calendar_end_date = date('Y-m-d', $next_year); } } else { $this->calendar_end_date = date('Y-m-d', strtotime('+1 year')); } } } $this->valid_services = array(array('service_name' => 'api_status', 'service_friendly_name' => 'Credentials'), array('service_name' => 'group_profiles', 'params' => array('describe_api' => '1'), 'service_friendly_name' => 'Group Profiles API'), array('service_name' => 'public_calendar_listing', 'params' => array('describe_api' => '1'), 'service_friendly_name' => 'Public Calendar Listing API')); }
/** * Initialize the class and set its properties. * * @since 0.9.0 */ public function __construct() { parent::__construct(); }
/** * Initialize the class and set its properties. * * @access public * @since 0.9.0 * @return void */ public function __construct($page_id) { parent::__construct(); $this->page_id = $page_id; }
/** * Initialize the class and set its properties. * * @access public * @since 0.9.0 * @return void */ public function __construct($section_id, $section) { parent::__construct(); $this->section_id = $section_id; $this->section = $section; }