How do I give access to create products to my users

Hi I am almost sure you guys will be able to help me with this with all your experience...

I would like to create users with access to create their own products, I don't want them to see any other options on the wordpress backend but the Products menu and to take it one step further I only want them to see the products they have created...

Is this possible?

Thanks

Gabriel

  • Zyniker

    I do not believe this will be possible without a fair bit of customization (and likely use of additional plugins). One possible way to accomplish (most) of this is to use a front-end form to submit the new products, instead of allowing access to the backend. You could then create a custom page which would display only posts of a certain type created by a certain user. You wouldn't even have to allow access to the backend if you did things this way.

  • Vaughan

    Hi @BePresence

    @Zyniker is correct. you can use a plugin for front end posting such as;

    http://mp-frontend.info/

    http://webnware.themetailors.com/tt/portfolio/tt-marketpress-frontend/

    But restricting backend to only products they have added would require quite a bit of custom coding.

    you can restrict backend use with plugins such as;

    http://wordpress.org/plugins/advanced-access-manager/

    or http://wordpress.org/plugins/adminimize/

    Hope this helps

  • Zyniker

    The first half of what you're attempting to accomplish should be fairly easy. Personally, I would recommend using Gravity Forms to create a front-end form to allow users to submit products.

    As for the second half of what you're attempting to accomplish, here is some code I use on the Fix {Code} website in order to return a list of all posts by the currently logged-in user:

    <?php if (!is_user_logged_in() ) : ?>
    
    			<div id="existing-account-warning">
    			<h4><strong>Read Me</strong></h4><br />
    			<span>If you have previously ordered a fix from <strong>Fix {Code}</strong>, then you have an account!  <a href="/wp-login.php">Log in here</a> (you can also request a password reset email if you've forgotten).  You must be logged in to view your support history.</span>
    			</div>
    
    		<?php endif; ?>
    
    		<?php if (is_user_logged_in() ) : ?>
    
    			<?php
    			//if a certain page, then display posts authored by the logged in user
    			$page_title = 'Support History';
    			if ( is_user_logged_in()  && is_page($page_title) ) {
    			global $current_user;
    			get_currentuserinfo();
    			$args=array(
    				'author' => $current_user->ID,
    				'post_type' => 'post',
    				'post_status' => 'publish, private',
    				'posts_per_page' => -1,
    				'caller_get_posts'=> 1
    			);
    			$my_query = null;
    			$my_query = new WP_Query($args);
    			if( $my_query->have_posts() ) {
    			echo 'Your Support History';
    			while ($my_query->have_posts()) : $my_query->the_post(); ?>
    			<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
    			<?php
    			endwhile;
    			}
    			wp_reset_query();  // Restore global post data stomped by the_post().
    			}
    			?>
    
    		<?php endif; ?>

    That code should be a good starting place for you to create a page to display only the posts by the current user, which should work as long as you don't also have users posting actual posts (i.e., users are posting products, but nothing else). If I am not mistaken, I do not believe that MarketPress currently uses a custom post type, so you'd have to do a bit more coding if your users create both posts and products to filter the page down to the products but not the posts.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.