Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/sitepres.../inc/post-tra...
File: wpml-wordpress-actions.class.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class WPML_WordPress_Actions
[3] Fix | Delete
* @package wpml-core
[4] Fix | Delete
* @subpackage post-translation
[5] Fix | Delete
*/
[6] Fix | Delete
class WPML_WordPress_Actions {
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* @param int $post_id
[10] Fix | Delete
*
[11] Fix | Delete
* @return bool
[12] Fix | Delete
*/
[13] Fix | Delete
public static function is_bulk_trash( $post_id ) {
[14] Fix | Delete
if ( self::is_trash_action() && self::post_id_in_bulk( $post_id ) ) {
[15] Fix | Delete
return true;
[16] Fix | Delete
} else {
[17] Fix | Delete
return false;
[18] Fix | Delete
}
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* @param int $post_id
[23] Fix | Delete
*
[24] Fix | Delete
* @return bool
[25] Fix | Delete
*/
[26] Fix | Delete
public static function is_bulk_untrash( $post_id ) {
[27] Fix | Delete
if ( self::is_untrash_action() && self::post_id_in_bulk( $post_id, true ) ) {
[28] Fix | Delete
return true;
[29] Fix | Delete
} else {
[30] Fix | Delete
return false;
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
public static function is_heartbeat( ) {
[35] Fix | Delete
return self::is_action( 'heartbeat', 'post' );
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
protected static function is_trash_action() {
[39] Fix | Delete
return self::is_action( 'trash' );
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
protected static function is_untrash_action() {
[43] Fix | Delete
return self::is_action( 'untrash' );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
/**
[47] Fix | Delete
* @param string $action
[48] Fix | Delete
*
[49] Fix | Delete
* @return bool
[50] Fix | Delete
*/
[51] Fix | Delete
protected static function is_action( $action, $type = 'get' ) {
[52] Fix | Delete
if ( $type == 'get' ) {
[53] Fix | Delete
return ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] == $action ) || ( isset( $_GET[ 'action2' ] ) && $_GET[ 'action2' ] == $action );
[54] Fix | Delete
} elseif ( $type == 'post' ) {
[55] Fix | Delete
return ( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == $action ) || ( isset( $_POST[ 'action2' ] ) && $_POST[ 'action2' ] == $action );
[56] Fix | Delete
} else {
[57] Fix | Delete
return false;
[58] Fix | Delete
}
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* @param int $post_id
[63] Fix | Delete
* @param bool $check_ids
[64] Fix | Delete
*
[65] Fix | Delete
* @return bool
[66] Fix | Delete
*/
[67] Fix | Delete
protected static function post_id_in_bulk( $post_id, $check_ids = false ) {
[68] Fix | Delete
if ( isset( $_GET[ 'post' ] ) && is_array( $_GET[ 'post' ] ) && in_array( $post_id, $_GET[ 'post' ] ) ) {
[69] Fix | Delete
return true;
[70] Fix | Delete
} elseif ( $check_ids ) {
[71] Fix | Delete
// We need to check the ids parameter when user clicks on 'undo' after trashing.
[72] Fix | Delete
return isset( $_GET[ 'ids' ] ) && is_string( $_GET[ 'ids' ] ) && in_array( $post_id, explode( ',', $_GET[ 'ids' ] ) );
[73] Fix | Delete
} else {
[74] Fix | Delete
return false;
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
}
[78] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function