/** * * add custom css classes to body tag * * @param array $classes * @return array * @static * @link https://codex.wordpress.org/Function_Reference/body_class#Add_Classes_By_Filters example */ public static function body_class($classes) { if (is_page_template('contact-page.php') && \SilverWp\Helper\Option::get_theme_option('use_google_maps') === '1') { $classes[] = 'google-map'; } return $classes; }
/** * * Connect with Tweeter API * * @return \SilverWp\Ajax\TwitterOAuth */ private function connect() { $cons_key = Option::get_theme_option('twitter_oauth_key'); $cons_secret = Option::get_theme_option('twitter_oauth_secret'); $token = Option::get_theme_option('twitter_oauth_access_token'); $secret = Option::get_theme_option('twitter_oauth_access_secret'); $connection = new TwitterOAuth($cons_key, $cons_secret, $token, $secret); return $connection; }
/** * Class constructor initialize class * * @access protected * @todo implements re_insert_custom_css */ protected function __construct() { $this->user_name = Option::get_theme_option('tf_user_name'); $this->api_key = Option::get_theme_option('tf_api_key'); $this->author = Theme::getThemeInfo('Author'); $this->theme_name = Theme::getThemeInfo('Name'); $this->version = Theme::getThemeInfo('Version'); add_action('admin_notices', array($this, 'backendHtml')); add_action('update_bulk_theme_complete_actions', array($this, 'updateComplete'), 10, 2); //add_action( 'upgrader_process_complete', array( $this, 're_insert_custom_css' ) ); //add_action( 'load-update.php', array( $this, 'temp_save_custom_css' ), 20 ); $this->includes(); }
/** * * Check the current post or page have a sidebar * * @static * @access public * @return boolean */ public static function isDisplayed() { //fix Ticket #220 if (is_search() && is_home() || is_tag() || is_date() || is_archive()) { $post_id = Option::get_option('page_for_posts'); $post_type = 'page'; } else { $page_object = get_queried_object(); $post_id = get_queried_object_id(); $post_type = isset($page_object->post_type) ? $page_object->post_type : 'posts'; } $sidebar = MetaBox::isSidebar($post_type, $post_id); if ((is_search() || is_author() || is_tag() || is_date() || is_archive()) && Option::get_theme_option('blogposts_sidebar') != '0') { $sidebar = true; } $display = apply_filters('sage/display_sidebar', $sidebar); return $display; }
function avia_get_option($name) { return \SilverWp\Helper\Option::get_theme_option($name); }
/** * get fonts settings * * @return array */ public function set_font() { $fonts_body = Option::get_theme_option('style_fonts_body', true); unset($fonts_body['preview']); $fonts_heading = Option::get_theme_option('style_fonts_heading', true); unset($fonts_heading['preview']); $fonts_main_menu = Option::get_theme_option('style_fonts_main_menu', true); unset($fonts_main_menu['preview']); self::$_fonts = array_merge($fonts_body, $fonts_heading, $fonts_main_menu); foreach (self::$_fonts as $key => $value) { if (strpos($key, 'family')) { $font = explode(',', trim($value, ',')); $font[0] = strpos($font[0], ' ') ? '\'' . $font[0] . '\'' : $font[0]; self::$_fonts[$key] = implode(',', $font); } } $this->_set_value(self::$_fonts); return self::$_css_variable; }
/** * Short cut to SilverWp\Helper\Option::get_theme_option() * * @param string $option_name * * @return string * @access public * @author Marcin Dobroszek <marcin at silversite.pl> * @since 0.2 */ function get_theme_option($option_name) { return Option::get_theme_option($option_name); }