$sql_parts['select'][] = ', p.post_title, p.post_status';
$sql_parts['join'][] = " LEFT JOIN {$this->sitepress->get_wpdb()->posts} p ON wpml_translations.element_id=p.ID";
if ( ! $this->all_statuses && 'post_attachment' !== $element_type && ! is_admin() ) {
// the current user may not be the admin but may have read private post/page caps!
if ( current_user_can( 'read_private_pages' ) || current_user_can( 'read_private_posts' ) ) {
$sql_parts['where'][] = " AND (p.post_status IN ('publish', 'draft', 'private', 'pending' ))";
} else {
$sql_parts['where'][] = ' AND (';
$sql_parts['where'][] = "p.post_status = 'publish' ";
if ( $uid = $this->sitepress->get_current_user()->ID ) {
$sql_parts['where'][] = $this->sitepress->get_wpdb()->prepare( " OR (post_status in ('draft', 'private', 'pending') AND post_author = %d)", $uid );
}
$sql_parts['where'][] = ') ';
}
}
return $sql_parts;
}
/**
* @param $sql_parts
*
* @return mixed
*/
private function get_sql_parts_for_taxonomy( $sql_parts ) {
$sql_parts['select'][] = ', tm.name, tm.term_id, COUNT(tr.object_id) AS instances';
$sql_parts['join'][] = " LEFT JOIN {$this->sitepress->get_wpdb()->term_taxonomy} tt ON wpml_translations.element_id=tt.term_taxonomy_id
LEFT JOIN {$this->sitepress->get_wpdb()->terms} tm ON tt.term_id = tm.term_id
LEFT JOIN {$this->sitepress->get_wpdb()->term_relationships} tr ON tr.term_taxonomy_id=tt.term_taxonomy_id
";
$sql_parts['group_by'][] = 'GROUP BY tm.term_id';
return $sql_parts;
}
/**
* @param stdClass $translation
*
* @return bool
*/
private function must_ignore_translation( stdClass $translation ) {
return $this->skip_empty
&& (
! $translation->element_id
|| $this->must_ignore_translation_for_taxonomy( $translation )
);
}
/**
* @param stdClass $translation
*
* @return bool
*/
private function must_ignore_translation_for_taxonomy( stdClass $translation ) {
return $this->wpml_element_type_is_taxonomy( $translation->element_type )
&& $translation->instances === 0
&& ( ! $this->skip_recursions && ! _icl_tax_has_objects_recursive( $translation->element_id ) );
}
/**
* @param string $wpml_element_type
*
* @return int
*/
private function wpml_element_type_is_taxonomy( $wpml_element_type ) {
return preg_match( '#^tax_(.+)$#', $wpml_element_type );
}
/**
* @param string $wpml_element_type
*
* @return bool
*/
private function wpml_element_type_is_post( $wpml_element_type ) {
return 0 === strpos( $wpml_element_type, 'post_' );
}
}
Fatal error: Uncaught Error: Class 'WPML_Translations' not found in /home/wyrcom/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals.php:201
Stack trace:
#0 /home/wyrcom/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals.php(40): WPML_Canonicals->init_wpml_translations()
#1 /home/wyrcom/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals.php(63): WPML_Canonicals->must_filter_permalink(1713)
#2 /home/wyrcom/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/url-handling/wpml-url-filters.class.php(183): WPML_Canonicals->permalink_filter('https://wyr.com...', 1713)
#3 /home/wyrcom/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/url-handling/wpml-url-filters.class.php(203): WPML_URL_Filters->permalink_filter('https://wyr.com...', 1713)
#4 /home/wyrcom/public_html/wp-includes/class-wp-hook.php(288): WPML_URL_Filters->page_link_filter('https://wyr.com...', in /home/wyrcom/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/canonicals/class-wpml-canonicals.php on line 201
The site is experiencing technical difficulties.