public function load_feature_options_file(ICE_Feature $feature, $filename) { // try to parse the options file into INI sections $sections = parse_ini_file($filename, true); // get any sections? if (is_array($sections) && count($sections)) { // inject required feature directive into every option config foreach ($sections as $name => &$config) { // set the feature $config['feature'] = $feature->property('name'); } } // load the sections as normal return $this->load_config_sections($sections); }
/** */ protected function init() { // run parent init method parent::init(); // register actions as late as possible (this may need to be tweaked later) add_action('init', array($this, 'register_actions')); }
/** */ protected function init() { // run parent init method parent::init(); // add actions add_action('open_head', array($this, 'viewport_meta')); add_action('wp_head', array($this, 'render')); }
/** */ public function configure() { // RUN PARENT FIRST! parent::configure(); // init properties $this->import_property('custom_selector', 'string'); $this->import_property('target_selector', 'string'); }
/** * Check if BuddyPress is active * * @return boolean */ public function supported() { // is buddypress active? if (class_exists('BP_Component')) { return parent::supported(); } return false; }
/** */ public function configure() { // RUN PARENT FIRST! parent::configure(); // css title class if ($this->config()->contains('image_class')) { $this->image_class = (string) $this->config('image_class'); } }
/** */ protected function init() { // run parent init method parent::init(); // init properties $this->title = __('BuddyPress Protect', infinity_text_domain); $this->description = __('Restrict access to your BuddyPress components to members only', infinity_text_domain); // add action to get_header add_action('wp', array($this, 'maybe_redirect'), 1); }
/** * @internal copied from bp-default/functions.php */ public function init_scripts() { parent::init_scripts(); // Bump this when changes are made to bust cache $version = '20120110'; // the global BuddyPress JS - Ajax will not work without it wp_enqueue_script('dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery'), $version); // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'view' => __('View', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress')); wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params); }
/** */ public function renderable() { // determine if template should be rendered if (true === parent::renderable()) { // grab toggle option from registry $opt_toggle = $this->get_suboption('toggle'); // check if toggle is on if ($opt_toggle && true == $opt_toggle->get()) { return true; } } // toggle is not set or set to false; return false; }
/** */ public function renderable() { // check parent if (true === parent::renderable()) { // get toggle option $opt_toggle = (bool) $this->get_suboption('toggle')->get(); // enabled? if (true === $opt_toggle) { // yep, check image url if (null != $this->image_url()) { // there is an image url return true; } } } return false; }
/** * @internal copied from bp-default/functions.php */ public function init_scripts() { parent::init_scripts(); // Enqueue various scripts wp_enqueue_script('bp-jquery-query'); wp_enqueue_script('bp-jquery-cookie'); // Enqueue scrollTo only on activity pages if (bp_is_activity_component()) { wp_enqueue_script('bp-jquery-scroll-to'); } // Enqueue members widget JS just in case if (is_active_widget(false, false, 'bp_core_members_widget') && !is_admin() && !is_network_admin()) { wp_enqueue_script('bp-widget-members'); } // Bump this when changes are made to bust cache $version = '20120110'; // the global BuddyPress JS - Ajax will not work without it wp_enqueue_script('dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery'), bp_get_version()); // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_x_comments' => __('Show all %d comments', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'view' => __('View', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress'), 'unsaved_changes' => __('Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress')); wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params); }
/** */ public function configure() { // RUN PARENT FIRST! parent::configure(); // init properties $this->import_property('combine', 'boolean'); $this->import_property('group_page_text', 'string'); $this->import_property('nested', 'boolean'); $this->import_property('prepend_to', 'string'); $this->import_property('switch_width', 'integer'); $this->import_property('target_selector', 'string'); $this->import_property('top_option_text', 'string'); }
/** */ public function init_styles() { parent::init_styles(); // add static logo styles and callback $this->style()->cache('logo', 'logo.css')->cache('logo-gen', 'logo_styles'); }
/** */ public function configure() { // RUN PARENT FIRST! parent::configure(); // init properties $this->import_property('tip_location', 'string'); $this->import_property('scroll_speed', 'integer'); $this->import_property('timer', 'integer'); $this->import_property('start_timer_on_click', 'boolean'); $this->import_property('next_button', 'boolean'); $this->import_property('tip_animation', 'string'); $this->import_property('tip_animation_fade_speed', 'integer'); $this->import_property('cookie_monster', 'boolean', true); $this->import_property('cookie_domain'); $this->import_property('cookie_name', 'string'); $this->import_property('tip_container', 'string'); $this->import_property('inline', 'boolean'); $this->import_property('tip_content', 'string', '#' . $this->id); $this->import_property('post_ride_callback', 'string'); $this->import_property('post_step_callback', 'string'); }