user_login ;
$my_user_level = $current_user->user_level ;
$my_user_id = $current_user->ID;
echo '
'.__("Welcome, ","adv-private-area") .$my_user.'
';
//Query post private areas
$args = array(
'post_type' => 'adv_privatearea',
'meta_query' => array(
array(
'key' => 'adv_user_account',
'value' => $my_user_id,
'compare' => '='
),
)
);
$the_query = new WP_Query( $args );
//Display content Area
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
$content = do_shortcode( get_the_content() );
echo '' . get_the_title() . '
';
echo ''.__("Uploaded on ","adv-private-area") .get_the_date('j F Y'). '
';
echo ''.$content.'
';
$attached_document = get_post_meta(get_the_ID(), 'adv_document', true );
echo '';
}
} else {
echo ''.__("No content avalaible.", "adv-private-area").'
';
}
/* Restore original Post Data */
wp_reset_postdata();
}else{
//LOGIN FORM
echo ''.__("Reserved Area","adv-private-area").'
';
echo '