Created
January 16, 2017 20:58
-
-
Save elimn/246387b2167e80120423478fae7d09ef to your computer and use it in GitHub Desktop.
MT | ET | Remove Tickets row actions from Admin WP tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove Tickets row actions from Admin WP tables, except for post_types selected in Settings > Tickets | |
*/ | |
function tribe_remove_row_actions() { | |
if ( ! function_exists( 'tribe_get_option' ) ) { | |
return; | |
} | |
$post_types = tribe_get_option( 'ticket-enabled-post-types', array() ); | |
if ( ! in_array( $_GET['post_type'], $post_types ) ) { | |
$handler = Tribe__Tickets__Tickets_Handler::instance(); | |
remove_filter( 'post_row_actions', array( $handler, 'attendees_row_action' ) ); | |
remove_filter( 'page_row_actions', array( $handler, 'attendees_row_action' ) ); | |
} | |
} | |
add_action( 'init', 'tribe_remove_row_actions' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment