Yes the plugin works fine with 3.6.1. The plugin doesn’t “force” anyone to log in (or out), that is left to the theme template. It’s pretty easy to implement, something like this:
<?php if(current_user_can('read')) : // user is logged in ?>
<?php if (function_exists('user_submitted_posts')) user_submitted_posts(); ?>
<?php else : // user is not logged in ?>
<p>Please register or whatever</p>
<?php endif; ?>
Thread Starter
rich8
(@rich8)
Which file do I put this code into ?
Hello rich8,
A clean way to do this is to edit the functions.php in your theme directory and add at the very end the following code:
add_shortcode( 'forcemember', 'member_check_shortcode' );
function member_check_shortcode( $atts, $content = null ) {
if ( is_user_logged_in() && !is_null( $content ) && !is_feed() )
return do_shortcode($content);
return wp_register('<strong>To submit a post you should be a registered user, please ','.</strong>');
}
After this is done, in any of your pages you could simply use the shortcode created above like this:
[forcemember][user-submitted-posts][/forcemember]
Simple, work and 1 minute fix to do.
Cheers,
RaPhiuS
Thread Starter
rich8
(@rich8)
That solves my problem, awesome, thanks RaPhuiS
Thanks for the shortcode RaPhiuS. Closing thread!