May 2017
Beginner to intermediate
536 pages
14h 25m
English
We can find the actions list for custom post types in the top-left corner of the list in the Bulk Actions drop-down. The default actions for custom posts are Edit and Move To Trash. In web applications, we need custom actions to manage custom posts. So, let's see how we can create and execute custom actions for the topics list:
add_filter( 'bulk_actions-edit-wpwaf_topic', 'topic_action_buttons' ); function topic_action_buttons($bulk_actions) { $bulk_actions['wpwaf_topic_normal_switch'] = __( 'Mark Topic as Normal', 'wpwaf'); $bulk_actions['wpwaf_topic_sticky_switch'] = __( 'Mark Topic as Sticky', 'wpwaf'); $bulk_actions['wpwaf_topic_super_sticky_switch'] = __( 'Mark Topic as Super Sticky', 'wpwaf'); ...Read now
Unlock full access