public static function getHTML($url, $atts = array()) { $args = gPluginUtils::recursiveParseArgs($atts, array('timeout' => 15)); $response = wp_remote_get($url, $args); if (!self::isError($response) && 200 == wp_remote_retrieve_response_code($response)) { return wp_remote_retrieve_body($response); } return FALSE; }
public function setup_globals($constants = array(), $args = array()) { $this->args = gPluginUtils::recursiveParseArgs($args, array('domain' => 'gplugin', 'title' => 'gPlugin', 'filter_prefix' => FALSE)); if (FALSE === $this->args['filter_prefix']) { $this->inject('args', array('filter_prefix' => $this->args['domain'])); } $this->constants = gPluginUtils::recursiveParseArgs($constants, array('plugin_dir' => GPLUGIN_DIR, 'plugin_url' => GPLUGIN_URL)); $this->filtered = array(); }
public function setup_globals($constants = array(), $args = array()) { $this->args = gPluginUtils::recursiveParseArgs($args, array('title' => 'gPlugin', 'domain' => 'gplugin', 'network' => TRUE, 'options' => array())); $this->constants = apply_filters($this->args['domain'] . '_network_constants', $constants); $this->current_blog = get_current_blog_id(); // $this->blog_map = get_site_option( $this->args['domain'].'_blog_map', array() ); // FIXME $this->root = FALSE; $this->remote = FALSE; if (isset($this->constants['class_filters'])) { gPluginFactory::get($this->constants['class_filters'], $constants, $args); } }
public function setup_globals($constants = array(), $args = array()) { $this->args = gPluginUtils::recursiveParseArgs($args, array('title' => 'gPlugin', 'domain' => 'gplugin', 'network' => FALSE, 'component' => 'default', 'options' => array(), 'option_group' => FALSE)); if (FALSE === $this->args['option_group']) { $this->inject('args', array('option_group' => $this->args['domain'])); } $this->current_blog = get_current_blog_id(); $constants = apply_filters($this->args['domain'] . '_constants', $constants); $this->constants = gPluginUtils::recursiveParseArgs($constants, array('plugin_dir' => GPLUGIN_DIR, 'plugin_url' => GPLUGIN_URL, 'class_filters' => 'gPluginFiltersCore', 'meta_key' => '_' . $this->args['domain'], 'theme_templates_dir' => 'gplugin_templates')); $this->options = $this->init_options(); $this->setup_settings(); // bail if the plugin is in network mode if ($this->args['network']) { return; } if (isset($this->constants['class_filters'])) { gPluginFactory::get($this->constants['class_filters'], $constants, $args); } }
public function setup_globals($constants = array(), $args = array()) { $this->args = gPluginUtils::recursiveParseArgs($args, array('domain' => 'gplugin', 'title' => 'gPlugin', 'logger_args' => array('name' => 'Logs', 'post_type' => 'gplugin_log', 'taxonomy' => 'gplugin_log_type', 'meta_prefix' => '_gplugin_log_', 'hook_prefix' => 'gplugin_log_', 'types' => array('error', 'event')))); $this->constants = gPluginUtils::recursiveParseArgs($constants, array('plugin_dir' => GPLUGIN_DIR, 'plugin_url' => GPLUGIN_URL)); }