class WPML_WordPress_Actions {
public static function is_bulk_trash( $post_id ) {
if ( self::is_trash_action() && self::post_id_in_bulk( $post_id ) ) {
public static function is_bulk_untrash( $post_id ) {
if ( self::is_untrash_action() && self::post_id_in_bulk( $post_id, true ) ) {
public static function is_heartbeat( ) {
return self::is_action( 'heartbeat', 'post' );
protected static function is_trash_action() {
return self::is_action( 'trash' );
protected static function is_untrash_action() {
return self::is_action( 'untrash' );
protected static function is_action( $action, $type = 'get' ) {
return ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == $action ) || ( isset( $_GET[ 'action2' ] ) && $_GET[ 'action2' ] == $action );
} elseif ( $type == 'post' ) {
return ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == $action ) || ( isset( $_POST[ 'action2' ] ) && $_POST[ 'action2' ] == $action );