mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- optimized restriction handlers;
This commit is contained in:
+1180
-1193
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,7 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
|
||||
|
||||
add_action( 'um_access_fix_external_post_content', array( &$this, 'bbpress_no_access_message_fix' ), 10 );
|
||||
add_action( 'um_access_fix_external_post_content', array( &$this, 'forumwp_fix' ), 11 );
|
||||
add_action( 'um_access_fix_external_post_content', array( &$this, 'woocommerce_fix' ), 12 );
|
||||
|
||||
add_filter( 'um_localize_permalink_filter', array( &$this, 'um_localize_permalink_filter' ), 10, 2 );
|
||||
add_filter( 'icl_ls_languages', array( &$this, 'um_core_page_wpml_permalink' ), 10, 1 );
|
||||
@@ -151,6 +152,30 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fixed Woocommerce access to Products message
|
||||
*/
|
||||
function woocommerce_fix() {
|
||||
if ( UM()->dependencies()->woocommerce_active_check() ) {
|
||||
add_filter( 'single_template', array( &$this, 'woocommerce_template' ), 9999999, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $single_template
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function woocommerce_template( $single_template ) {
|
||||
if ( is_product() ) {
|
||||
remove_filter( 'template_include', array( 'WC_Template_Loader', 'template_loader' ) );
|
||||
}
|
||||
|
||||
return $single_template;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $profile_url
|
||||
* @param $page_id
|
||||
@@ -558,4 +583,4 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user