May 2017
Beginner to intermediate
536 pages
14h 25m
English
The admin list provides another useful feature for filtering custom post types. By default, we can filter the custom post types by date. In web applications, we can use this feature to create our own filters by using a technique similar to the custom action creation. Let's see how we can add a filter for topic statuses:
function wpwaf_topic_list_filters() { global $typenow,$wpwaf; $topic_sticky_status = isset($_GET['wpwaf_topic_sticky_status']) ? $_GET['wpwaf_topic_sticky_status'] : ''; if( $typenow == $wpwaf->topic->post_type ){ $display = "<select name='wpwaf_topic_sticky_status' id='wpwaf_topic_sticky_status' class='postform'>"; $display .= "<option value=''>"__('Show All Topics', 'wpwaf')."</option>"; ...Read now
Unlock full access