/** * Update or create the custom stylesheet * * @since 1.0.0 */ public function add_css_rules() { foreach ($this->_post_types as $post_type => $args) { $posts = $this->get_posts_types($post_type); foreach ($posts as $post) { foreach ($args['typography_options'] as $option) { $value = $this->get_setting($option['id'], $post->ID); if (!empty($value)) { $replaces = array('%s' => $post->post_name); $option['style']['selectors'] = str_replace(array_keys($replaces), array_values($replaces), $option['style']['selectors']); yit_add_css_by_option($option, $value); } } } } }
/** * Register the complete css to generate the dynamic css file * * @since 1.0.0 */ public function add_css_rules() { foreach ($this->panel as $page => $page_options) { if (empty($page_options)) { continue; } foreach ($page_options as $tab_path => $options) { if (empty($options)) { continue; } foreach ($options as $option) { if (isset($option['id'])) { yit_add_css_by_option($option, $this->get_option($option['id'])); } } } } }