Exemple #1
0
 /**
  * Head.
  *
  * @return string
  */
 public function wp_head()
 {
     global $post;
     if (isset($post) && isset($post->post_content) && has_shortcode($post->post_content, 'gmaps')) {
         Wabbr::view('maps/head');
     }
 }
Exemple #2
0
 /**
  * Related posts.
  *
  * @param  array  $atts
  * @param  string $content
  * @return string
  */
 public function related($atts, $content = null)
 {
     global $post;
     extract(shortcode_atts(array('class' => '', 'show_thumbnail' => true, 'thumbnail_size' => 'medium', 'thumbnail_class' => 'img-responsive', 'post_type' => isset($post) ? $post->post_type : '', 'posts_per_page' => 5, 'offset' => 0, 'category' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => 'publish', 'suppress_filters' => true), $atts));
     $posts = new WP_Query(array('post_type' => $post_type, 'posts_per_page' => $posts_per_page, 'offset' => $offset, 'category' => $category, 'orderby' => $orderby, 'order' => $order, 'include' => $include, 'exclude' => $exclude, 'meta_key' => $meta_key, 'meta_value' => $meta_value, 'post_mime_type' => $post_mime_type, 'post_parent' => $post_parent, 'post_status' => $post_status, 'suppress_filters' => $suppress_filters));
     Wabbr::view('posts/recent', array('class' => $class, 'show_thumbnail' => $show_thumbnail, 'thumbnail_size' => $thumbnail_size, 'thumbnail_class' => $thumbnail_class, 'posts' => $posts));
 }
Exemple #3
0
 /**
  * Table row.
  *
  * @param  array  $atts
  * @param  string $content
  * @return string
  */
 public function row($atts, $content = null)
 {
     extract(shortcode_atts(array('class' => '', 'data' => ''), $atts));
     // Build row based on its data
     $data = $this->_build_row($content);
     // View
     Wabbr::view('table/row', array('class' => $class, 'content' => $content, 'responsive' => $responsive, 'data' => $data));
 }
Exemple #4
0
 /**
  * Create instance.
  *
  * @return object
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
         self::$instance->setup_constants();
         self::$instance->includes();
         self::$instance->add_hooks();
         self::$instance->execute();
         self::$instance->options();
     }
     return self::$instance;
 }
 /**
  * Iframe.
  *
  * @param  array  $atts
  * @param  string $content
  * @return string
  */
 public function iframe($atts, $content = null)
 {
     $atts = shortcode_atts(array('src' => '#', 'width' => '100%', 'height' => '480', 'scrolling' => 'no', 'class' => 'wabbr-iframe', 'frameborder' => '0'), $atts);
     Wabbr::view('iframe', array('atts' => $atts));
 }
 /**
  * Sidebar.
  *
  * @param  array  $atts
  * @param  string $content
  * @return string
  */
 public function sidebar($atts, $content = null)
 {
     extract(shortcode_atts(array('name' => '', 'class' => ''), $atts));
     // View
     Wabbr::view('sidebar', array('name' => $name, 'class' => $class));
 }