diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 924532e6..c83a0d29 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -213,15 +213,29 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { ) ) ); - $all_post_types = get_post_types( array( 'public' => true ) ); + $post_types_options = array(); + $all_post_types = get_post_types( array( 'public' => true ), 'objects' ); + foreach ( $all_post_types as $key => $post_type_data ) { + $post_types_options[ $key ] = $post_type_data->labels->singular_name; + } - $all_taxonomies = get_taxonomies( array( 'public' => true ) ); + $taxonomies_options = array(); $exclude_taxonomies = UM()->excluded_taxonomies(); - + $all_taxonomies = get_taxonomies( array( 'public' => true ), 'objects' ); + $duplicates = array(); foreach ( $all_taxonomies as $key => $taxonomy ) { - if( in_array( $key , $exclude_taxonomies ) ) { - unset( $all_taxonomies[ $key ] ); + if ( in_array( $key , $exclude_taxonomies ) ) { + continue; } + + if ( ! in_array( $taxonomy->labels->singular_name, $duplicates ) ) { + $duplicates[] = $taxonomy->labels->singular_name; + $label = $taxonomy->labels->singular_name; + } else { + $label = $taxonomy->labels->singular_name . ' (' . $key . ')'; + } + + $taxonomies_options[ $key ] = $label; } $restricted_access_post_metabox_value = array(); @@ -320,7 +334,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'type' => 'multi_checkbox', 'label' => __( 'Restricted Access to Posts','ultimate-member' ), 'tooltip' => __( 'Restriction content of the current Posts','ultimate-member' ), - 'options' => $all_post_types, + 'options' => $post_types_options, 'columns' => 3, 'value' => $restricted_access_post_metabox_value, 'default' => UM()->options()->get_default( 'restricted_access_post_metabox' ), @@ -330,7 +344,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { 'type' => 'multi_checkbox', 'label' => __( 'Restricted Access to Taxonomies','ultimate-member' ), 'tooltip' => __( 'Restriction content of the current Taxonomies','ultimate-member' ), - 'options' => $all_taxonomies, + 'options' => $taxonomies_options, 'columns' => 3, 'value' => $restricted_access_taxonomy_metabox_value, 'default' => UM()->options()->get_default( 'restricted_access_taxonomy_metabox' ), diff --git a/includes/core/class-external-integrations.php b/includes/core/class-external-integrations.php index 1cca0896..fee141a5 100644 --- a/includes/core/class-external-integrations.php +++ b/includes/core/class-external-integrations.php @@ -28,6 +28,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_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 ); @@ -139,6 +140,15 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) { remove_filter( 'template_include', 'bbp_template_include' ); } + /** + * Fixed bbPress access to Forums message + */ + function forumwp_fix() { + if ( function_exists( 'FMWP' ) ) { + remove_filter( 'single_template', array( FMWP()->shortcodes(), 'cpt_template' ) ); + } + } + /** * @param $profile_url