mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 13:43:38 +09:00
Fix access settings in front page and posts page
This commit is contained in:
+21
-10
@@ -61,10 +61,14 @@
|
||||
if ( is_admin() ) return;
|
||||
if ( ! is_front_page() ) return;
|
||||
|
||||
if ( ! isset( $um_post_id ) ){
|
||||
if ( ! isset( $um_post_id ) && isset( $post->ID ) ){
|
||||
$um_post_id = $post->ID;
|
||||
}
|
||||
|
||||
if( ! isset( $um_post_id ) ){
|
||||
return;
|
||||
}
|
||||
|
||||
$args = $ultimatemember->access->get_meta( $um_post_id );
|
||||
extract( $args );
|
||||
|
||||
@@ -163,19 +167,26 @@
|
||||
if ( is_admin() ) return;
|
||||
if ( ! is_home() ) return;
|
||||
|
||||
$show_on_front = get_option( 'show_on_front' );
|
||||
if( $show_on_front == "page" ){
|
||||
$um_post_id = get_option( 'page_for_posts' );
|
||||
}
|
||||
|
||||
$access = um_get_option('accessible');
|
||||
|
||||
if ( $access == 2 && ! is_user_logged_in() ) {
|
||||
$ultimatemember->access->allow_access = false;
|
||||
}else{
|
||||
$ultimatemember->access->allow_access = true;
|
||||
$show_on_front = get_option( 'show_on_front' );
|
||||
|
||||
if( $show_on_front == "page" ){
|
||||
|
||||
$um_post_id = get_option( 'page_for_posts' );
|
||||
|
||||
if ( $access == 2 && ! is_user_logged_in() ) {
|
||||
$ultimatemember->access->allow_access = false;
|
||||
}else{
|
||||
$ultimatemember->access->allow_access = true;
|
||||
}
|
||||
|
||||
}else if( $show_on_front == "posts" ){
|
||||
$ultimatemember->access->allow_access = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( isset( $um_post_id ) ){
|
||||
|
||||
$args = $ultimatemember->access->get_meta( $um_post_id );
|
||||
|
||||
Reference in New Issue
Block a user