Retrieving via slug conflicts with Polylang
-
Using slug (id=”slug”) bugs due to application of:
$id = apply_filters( ‘wpml_object_id’, $page->ID, ‘text-blocks’ );
(text-blocks.php:266)Polylang implementation of icl_object_id is registered to the hook wpml_object_id, and the implementation always returns null, because the post type of text-blocks is not registered as translated post type, and the function doesn’t return the original ID if no translation is found.
Proposed fixes:
1) Remove the application of the filter (why is it only applied to slug retrieval, and not retrieval by ID anyway?)
2) Add a filter to control the application of the filter
3) Pass true as third parameter (default for $return_original_if_missing is false atleast in Polylangs implementation)
- The topic ‘Retrieving via slug conflicts with Polylang’ is closed to new replies.