예제 #1
0
 public static function maybe_redirect()
 {
     if (is_singular()) {
         if (($post_id = Genesis_Club_Utils::get_post_id()) && ($redirect = Genesis_Club_Options::validate_options(self::redirect_defaults(), Genesis_Club_Utils::get_meta($post_id, self::REDIRECT_METAKEY))) && $redirect['url']) {
             wp_redirect($redirect['url'], $redirect['status']);
             exit;
         }
     }
     return false;
 }
예제 #2
0
 function widget($args, $instance)
 {
     if (is_singular() && ($post_id = Genesis_Club_Utils::get_post_id()) && ($content = Genesis_Club_Utils::get_meta($post_id, self::WIDGET_CONTENT_META_KEY)) && !empty($content['text'])) {
         $instance['html_title'] = $content['html_title'];
         $args = $this->override_args($args, $instance);
         $text = do_shortcode($content['text']);
         extract($args);
         echo $before_widget;
         printf('<div class="textwidget">%1$s</div>', $content['autop'] ? wpautop($text) : html_entity_decode($text));
         echo $after_widget;
     }
 }
예제 #3
0
 function get_meta_form_data($metakey, $prefix, $values)
 {
     $content = array();
     if (($post_id = Genesis_Club_Utils::get_post_id()) && ($meta = Genesis_Club_Utils::get_meta($post_id, $metakey))) {
         $values = Genesis_Club_Options::validate_options($values, $meta);
     }
     foreach ($values as $key => $val) {
         $content[$key] = array();
         $content[$key]['value'] = $val;
         $content[$key]['id'] = $prefix . $key;
         $content[$key]['name'] = $metakey . '[' . $key . ']';
     }
     return $content;
 }
예제 #4
0
 public static function maybe_replace_category_images()
 {
     if (($post_id = Genesis_Club_Utils::get_post_id()) && ($terms = wp_get_post_terms($post_id, 'category')) && is_array($terms) && count($terms) > 0 && ($term = $terms[0]) && ($archive = self::get_archive($term->term_id))) {
         self::maybe_override_terms_archive_image($archive, true);
     }
 }