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.../classes/translat...
File: class-wpml-post-element.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* @author OnTheGo Systems
[3] Fix | Delete
*/
[4] Fix | Delete
class WPML_Post_Element extends WPML_Translation_Element implements WPML_Duplicable_Element {
[5] Fix | Delete
/**
[6] Fix | Delete
* @return WP_Post
[7] Fix | Delete
*/
[8] Fix | Delete
function get_wp_object() {
[9] Fix | Delete
return get_post( $this->id );
[10] Fix | Delete
}
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* @param WP_Post $post
[14] Fix | Delete
*
[15] Fix | Delete
* @return string
[16] Fix | Delete
*/
[17] Fix | Delete
function get_type( $post = null ) {
[18] Fix | Delete
if ( $post ) {
[19] Fix | Delete
return $post->post_type;
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
return $this->get_wp_object()->post_type;
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
public function get_wpml_element_type() {
[26] Fix | Delete
$element_type = '';
[27] Fix | Delete
if ( ! is_wp_error( $this->get_wp_element_type() ) ) {
[28] Fix | Delete
$element_type = 'post_' . $this->get_wp_element_type();
[29] Fix | Delete
}
[30] Fix | Delete
return $element_type;
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
function get_element_id() {
[34] Fix | Delete
return $this->id;
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
/**
[38] Fix | Delete
* @param null|stdClass $element_data null, or a standard object containing at least the `translation_id`, `language_code`, `element_id`, `source_language_code`, `element_type`, and `original` properties.
[39] Fix | Delete
*
[40] Fix | Delete
* @return WPML_Post_Element
[41] Fix | Delete
* @throws \InvalidArgumentException
[42] Fix | Delete
*/
[43] Fix | Delete
function get_new_instance( $element_data ) {
[44] Fix | Delete
return new WPML_Post_Element( $element_data->element_id, $this->sitepress, $this->wpml_cache );
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
function is_translatable() {
[48] Fix | Delete
return $this->sitepress->is_translated_post_type( $this->get_wp_element_type() );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
function is_display_as_translated() {
[52] Fix | Delete
return $this->sitepress->is_display_as_translated_post_type( $this->get_wp_element_type() );
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function