WordPress.org

Ready to get started?Download WordPress

Forums

User Submitted Posts
[resolved] Is this compatible with version 3.6.1 (6 posts)

  1. rich8
    Member
    Posted 10 months ago #

    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 ?

  2. Jeff Starr
    Member
    Plugin Author

    Posted 10 months ago #

    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; ?>
  3. rich8
    Member
    Posted 10 months ago #

    Which file do I put this code into ?

  4. RaPhiuS
    Member
    Posted 10 months ago #

    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

  5. rich8
    Member
    Posted 10 months ago #

    That solves my problem, awesome, thanks RaPhuiS

  6. Jeff Starr
    Member
    Plugin Author

    Posted 10 months ago #

    Thanks for the shortcode RaPhiuS. Closing thread!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.