'.__('Create the FAQ','ad-sliding-faq').'' ); return array_merge( $links, $mylinks ); } // Nothing else so far :) /* ------------------------------------------ // FAQ Post Type Output --------------------- --------------------------------------------- */ function ad_slfq_get_faq($o) { ?> = 0 ) { $t = explode( ',', $t ); } $faq_query = array( 'post_type' => 'faq-item', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'tax_query' => array( array( 'taxonomy' => 'faq-topic', 'terms' => $t, 'field' => 'name', ), ), ); } else { $faq_query = array( 'post_type' => 'faq-item', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC' ); } $query = new WP_Query($faq_query); ?> have_posts()) : ?>
have_posts()) : $query->the_post(); ?>
< class="faq-list--question"> >
'h2', 'topic' => null, 'size' => 'thumbnail' ), $atts ); // Output ad_slfq_get_faq($o); return ob_get_clean(); } add_shortcode('sliding_faq', 'ad_slfq_insert_faq'); /* ------------------------------------------ // FAQ Template tag ------------------------ --------------------------------------------- */ function sliding_faq($heading='h2', $topic=null, $size='thumbnail') { echo do_shortcode('[sliding_faq heading="'.$heading.'" topic="'.$topic.'" size="'.$size.'"]'); } /* ------------------------------------------ // FAQ Roles ------------------------------- --------------------------------------------- */ function ad_slfq_role() { $role = get_role('administrator'); $role->add_cap('edit_faq'); $role->add_cap('edit_others_faq'); $role->add_cap('publish_faq'); $role->add_cap('read_private_faq'); $role->add_cap('delete_faq'); $role->add_cap('delete_private_faq'); $role->add_cap('delete_published_faq'); $role->add_cap('delete_others_faq'); $role->add_cap('edit_private_faq'); $role->add_cap('edit_published_faq'); } add_action('admin_init','ad_slfq_role');