Пример #1
0
 /**
  * Display widget content on frontend
  *
  * @param array  $data
  * @param string $id
  * @param int    $number
  */
 public static function render_widget(array $data, $id, $number)
 {
     global $post;
     $post_id = !empty($data['post']['post_id']) ? absint($data['post']['post_id']) : 0;
     $post = Posts::get($post_id, static::$_post_type, "{$id}[post][post_id]");
     if (!empty($post)) {
         setup_postdata($post);
         the_title();
         the_excerpt();
         wp_reset_postdata();
     }
 }