Support » Plugin: User Submitted Posts » Is this compatible with version 3.6.1

  • Resolved rich8

    (@rich8)


    Hi This plugin looks just what I want – fantastic work, but the http://wordpress.org/plugins/user-submitted-posts/ link says that compatibility is up to 3.5.2 only. However, some people asking questions posted their version as 3.6.1. So I’ve installed it but it’s not forcing the user to login. I’ve added the line to the theme functions.php

    Is it officially working with 3.6.1 ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Starr

    (@specialk)

    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; ?>

    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

    That solves my problem, awesome, thanks RaPhuiS

    Plugin Author Jeff Starr

    (@specialk)

    Thanks for the shortcode RaPhiuS. Closing thread!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is this compatible with version 3.6.1’ is closed to new replies.