- optimized restriction handlers;

This commit is contained in:
Nikita Sinelnikov
2021-08-18 14:04:21 +03:00
parent 8805d1fd6f
commit 41deba974a
2 changed files with 1206 additions and 1194 deletions
File diff suppressed because it is too large Load Diff
+26 -1
View File
@@ -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' ) ) {
}
}
}