Skip to content

Instantly share code, notes, and snippets.

@elimn
Created January 16, 2017 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elimn/246387b2167e80120423478fae7d09ef to your computer and use it in GitHub Desktop.
Save elimn/246387b2167e80120423478fae7d09ef to your computer and use it in GitHub Desktop.
MT | ET | Remove Tickets row actions from Admin WP tables
<?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