コード例 #1
0
 /**
  * Main Instance
  *
  * @return object
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self(dirname(dirname(__FILE__)));
     }
     return self::$_instance;
 }
コード例 #2
0
ファイル: Fac.class.php プロジェクト: RichyVN/RST-Intranet
 public function doSliderShortcode($atts, $content, $tag)
 {
     global $post;
     $content = '';
     $args = array('post_type' => 'fac-sliders', 'posts_per_page' => -1, 'meta_query' => array(array('key' => '_name', 'value' => array($tag), 'compare' => 'IN')));
     $query = new WP_Query($args);
     while ($query->have_posts()) {
         $query->the_post();
         $post_id = get_the_ID();
         $template = 'sliders/' . Fac()->getSlider()->getSliderType($post_id) . '/layout';
         $data = $this->slider->getData($post_id);
         $content .= $this->getTemplate($template, array('data' => $data, 'post_id' => $post_id));
     }
     wp_reset_query();
     return $content;
 }