Hi again.
I finally got into the code and could make it work, though I’m not sure these tricks are stable enough. Anyway, this is what I did, in case it can help somebody:
Basically, I converted each instance of icl_object_id
function that appears on the plugin with the wpml_object_id
filter, and removed all the conditional statements that were checking if icl_object_id
exist.
So:
if ( function_exists( 'icl_object_id' ) ) {
$rating_result['post_id'] = icl_object_id( $temp_post_id , get_post_type( $temp_post_id ), true, ICL_LANGUAGE_CODE );
}
became:
$rating_result['post_id'] = apply_filters('wpml_object_id', $temp_post_id, get_post_type( $temp_post_id ), true, ICL_LANGUAGE_CODE );
Another example:
if ( function_exists( 'icl_object_id' ) ) {
global $sitepress;
$post_id = icl_object_id ( $post_id , get_post_type( $post_id ), true, $sitepress->get_default_language() );
}
Became:
$defaultlanguage = pll_default_language();
$post_id = apply_filters('wpml_object_id', $post_id, get_post_type( $post_id ), true, $defaultlanguage );
You just need to replace the parameters of the filter with the parameters of the old function ($post_id
or $temp_post_id
, etc.)
The files that need to be changed as they contain these functions are:
includes/class-rating-form.php
includes/class-api.php
includes/admin/tools.php
includes/admin/class-rating-results-table.php
includes/admin/class-rating-entry-table.php
Hope that helps, regards!
Pilar