if (!defined('YIT')) { exit('Direct access forbidden.'); } $post_types = get_post_types(array('public' => true, 'publicly_queryable' => true), 'name'); $exclude_posts_type = array('attachment', 'revision', 'nav_menu_item'); $post_types['page'] = get_post_type_object('page'); $taxonomies = get_taxonomies(array('show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true), 'name'); $exclude_taxonomies = array('nav_menu'); $taxonomies['post_format'] = get_taxonomy('post_format'); ?> <div id="side-sortables" class="accordion-container"> <ul class="outer-border"> <?php YIT_Layout_Module_Site()->get_box(); foreach ($post_types as $name => $post_type) { if (!in_array($name, $exclude_posts_type)) { YIT_Layout_Module_Post_Type()->get_box($name); } } // YIT_Layout_Module_Static()->get_box(); foreach ($taxonomies as $name => $taxonomy) { if (!in_array($name, $exclude_taxonomies)) { YIT_Layout_Module_Taxonomy()->get_box($name); } } YIT_Layout_Module_Author()->get_box('author'); ?> </ul> </div>
$paged = isset($_POST['paged']) ? $_POST['paged'] : 1; $posts = $this->_get_content(array('taxonomy' => $_POST['item_object'], 'orderby' => 'name', 'order' => 'ASC', 'paged' => $paged)); $response = ''; foreach ($posts as $content) { $response .= '<li><a href="#" data-model="taxonomy" data-type="' . $taxonomy . '" data-id="' . $content->term_id . '">' . $content->name . '</a></li>'; } $paginate = paginate_links(array('base' => admin_url('admin-ajax.php') . '%_%', 'format' => '?paged=%#%', 'total' => $this->pagination['total_pages'], 'current' => $this->pagination['paged'], 'mid_size' => 2, 'end_size' => 1, 'prev_next' => true, 'prev_text' => 'prev', 'next_text' => 'next', 'add_args' => array('item_object' => $taxonomy))); $response = '<li class="paginate">' . $paginate . '</li>' . $response; echo json_encode($response); die; } } /** * Main instance of plugin * * @return object * @since 1.0 * @author Emanuela Castorina <*****@*****.**> */ function YIT_Layout_Module_Taxonomy() { return YIT_Layout_Module_Taxonomy::instance(); } /** * Instantiate Sidebar class * * @since 1.0 * @author Emanuela Castorina <*****@*****.**> */ YIT_Layout_Module_Taxonomy();