$post_data ) { // Get tralated post id here. $wpml_filter_id = apply_filters( 'wpml_object_id', $post_id, 'astra-advanced-hook', true ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound if ( null !== $wpml_filter_id ) { if ( $post_id !== $wpml_filter_id && isset( $wpml_filter_posts[ $post_id ] ) ) { $wpml_filter_posts[ $wpml_filter_id ] = $wpml_filter_posts[ $post_id ]; $wpml_filter_posts[ $wpml_filter_id ]['id'] = $wpml_filter_id; unset( $wpml_filter_posts[ $post_id ] ); } } } $current_posts = $wpml_filter_posts; } return $current_posts; } } endif; /** * Initiate the class. */ Astra_Wpml_Compatibility::instance();