public static function get_instance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
/** * @return WP_SpotIM */ public static function instance() { if (is_null(self::$_instance)) { self::$_instance = new self(); self::$_instance->setup_constants(); self::$_instance->includes(); self::$_instance->dependencies(); } return self::$_instance; }
public static function action_wp_head() { $spot_id = WP_SpotIM::instance()->admin->get_option('spot_id', 'sp_foo'); ?> <!-- wp-spotim vars --> <script type="text/javascript"> var WP_SpotIM = { spot_id: '<?php echo esc_js($spot_id); ?> ' }; // spot.im embed !function (t, e, n) { function p() { var p = e.createElement("script"); p.type = "text/javascript", p.async = !0, p.src = ("https:" === e.location.protocol ? "https" : "http") + ":" + n, t.parentElement.appendChild(p) } function a() { var t = e.getElementsByTagName("script"), n = t[t.length - 1]; return n.parentNode } t.spotId = WP_SpotIM.spot_id, t.parentElement = a(), p() }(window.SPOTIM = {}, document, "//v2.spot.im/launcher/bundle.js"); </script> <?php }
private static function _set_name_and_value(&$args) { if (!isset($args['name'])) { $args['name'] = sprintf('%s[%s]', esc_attr($args['page']), esc_attr($args['id'])); } if (!isset($args['value'])) { $args['value'] = WP_SpotIM::instance()->admin->get_option($args['id']); } }
public function handle_update_comment_cron() { $this->spot_id = WP_SpotIM::instance()->admin->get_option('spot_id', 'sp_foo'); $this->spot_token = WP_SpotIM::instance()->admin->get_option('spot_token', 'sp_foo'); self::run_update_comment_cron(); }