- Transposh integration;

This commit is contained in:
nikitasinelnikov
2019-01-24 15:12:44 +02:00
parent 2a6eba89c1
commit 53b688faa1
2 changed files with 11 additions and 6 deletions
+10 -6
View File
@@ -83,7 +83,7 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
* @see http://transposh.org/
*
* @global transposh_plugin $my_transposh_plugin
* @global WP_Query $wp_query Global WP_Query instance.
* @global \WP_Query $wp_query Global WP_Query instance.
*/
public function transposh_user_profile() {
global $my_transposh_plugin, $wp_query;
@@ -92,21 +92,25 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
return;
}
if ( !$wp_query->is_404() ) {
if ( ! $wp_query->is_404() ) {
return;
}
$profile_id = UM()->options()->get( 'core_user' );
$post = get_post( $profile_id );
if ( stripos( $_SERVER['REQUEST_URI'], "$my_transposh_plugin->target_language/$post->post_name" ) !== false ) {
preg_match( "#/$post->post_name/([^\/\?$]+)#", $_SERVER['REQUEST_URI'], $maches );
if ( empty( $post ) || is_wp_error( $post ) ) {
return;
}
if ( isset( $maches[1] ) ) {
if ( ! empty( $_SERVER['REQUEST_URI'] ) && stripos( $_SERVER['REQUEST_URI'], "$my_transposh_plugin->target_language/$post->post_name" ) !== false ) {
preg_match( "#/$post->post_name/([^\/\?$]+)#", $_SERVER['REQUEST_URI'], $matches );
if ( isset( $matches[1] ) ) {
query_posts( array(
'page_id' => $post->ID
) );
set_query_var( 'um_user', $maches[1] );
set_query_var( 'um_user', $matches[1] );
wp_reset_postdata();
}
}
+1
View File
@@ -137,6 +137,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
* Enhancements:
- Restored option for disable users cache
- Transposh plugin integration
* Bugfixes:
- Fixed delete users handlers on single/multisite installs