public function display() { $args = array('post_type' => $this->settings['post_type'], 'posts_per_page' => $this->settings['num'], 'post_status' => $this->settings['post_status'], 'orderby' => $this->settings['orderby'], 'order' => $this->settings['order']); $posts = get_posts($args); $this->settings['options'] = array(); foreach ($posts as $post) { $this->settings['options'][$post->ID] = $post->post_title; } parent::display(); }
public function display() { $args = array('orderby' => $this->settings['orderby'], 'order' => $this->settings['order'], 'taxonomy' => $this->settings['taxonomy'], 'hide_empty' => $this->settings['hide_empty'] ? '1' : '0'); $categories = get_categories($args); $this->settings['options'] = array(); foreach ($categories as $category) { $this->settings['options'][$category->term_id] = $category->name . ($this->settings['show_count'] ? " (" . $category->count . ")" : ''); } parent::display(); }
public function display() { // Remember the pages so as not to perform any more lookups if (!isset(self::$allPages)) { self::$allPages = get_pages(); } $this->settings['options'] = array(); foreach (self::$allPages as $page) { $this->settings['options'][$page->ID] = $page->post_title; } parent::display(); }
public function display() { $args = array('post_type' => $this->settings['post_type'], 'posts_per_page' => $this->settings['num'], 'post_status' => $this->settings['post_status'], 'orderby' => $this->settings['orderby'], 'order' => $this->settings['order']); $posts = get_posts($args); $this->settings['options'] = array(); foreach ($posts as $post) { $title = $post->post_title; if (empty($title)) { $title = sprintf(__('Untitled %s', TF_I18NDOMAIN), '(ID #' . $post->ID . ')'); } $this->settings['options'][$post->ID] = $title; } parent::display(); }
public function display() { // Remember the pages so as not to perform any more lookups if (!isset(self::$allPages)) { self::$allPages = get_pages(); } $this->settings['options'] = array(); foreach (self::$allPages as $page) { $title = $page->post_title; if (empty($title)) { $title = sprintf(__('Untitled %s', 'gossip'), '(ID #' . $page->ID . ')'); } $this->settings['options'][$page->ID] = $title; } parent::display(); }
public function display() { // Fetch post types. $post_types = tf_get_post_types($this->settings['public'], $this->settings['value']); $this->settings['options'] = array(); foreach ($post_types as $post_type) { $slug = $post_type->name; $slugname = true == $this->settings['slug'] ? ' (' . $slug . ')' : ''; $name = $post_type->name; if (!empty($post_type->labels->singular_name)) { $name = $post_type->labels->singular_name . $slugname; } $this->settings['options'][$slug] = $name; } parent::display(); }