mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- Transposh integration;
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user