Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added limit posts by post type #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgratch
Copy link

@mgratch mgratch commented Mar 29, 2015

No description provided.

@kjbenk
Copy link
Contributor

kjbenk commented Mar 29, 2015

Thanks for the contribution :) I will have a look at the code to see if everything works ok and then I will merge commit the pull request.

@@ -40,6 +40,8 @@
<input name="wpsite_limit_posts_settings_all_users" type="radio" value="capability" <?php echo isset($settings['all']) && $settings['all'] == 'capability' ? 'checked="checked"' : ''; ?>><label><?php _e('Role', self::$text_domain); ?></label><br />

<input name="wpsite_limit_posts_settings_all_users" type="radio" value="user" <?php echo isset($settings['all']) && $settings['all'] == 'user' ? 'checked="checked"' : ''; ?>><label><?php _e('User', self::$text_domain); ?></label>

<input name="wpsite_limit_posts_settings_all_users" type="radio" value="post_type" <?php echo isset($settings['all']) && $settings['all'] == 'post_type' ? 'checked="checked"' : ''; ?>><label><?php _e('Post Type', self::$text_domain); ?></label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this line since the Limit by Post Type option should be independent from the Limit by User

@kjbenk kjbenk assigned kjbenk and unassigned kjbenk Mar 30, 2015
@kjbenk
Copy link
Contributor

kjbenk commented Mar 30, 2015

This feature enhancement seems to only check if the current post is of a certain post type before a user tries to publish the post. Was this the intention of this feature, or did you want a certain user to be limited in number to the amount of posts they can publish of a certain post type?

@mgratch
Copy link
Author

mgratch commented Mar 30, 2015

I wrote the code to limit post type creation gracefully for all users, I really like your approach.

But I agree that for it to be ready to push to the repository it should also allow limitation of post type creation by users and caps.

@kjbenk
Copy link
Contributor

kjbenk commented Mar 30, 2015

To really make this feature great I think we will need to add this functionality:

  1. Admin can select which users are limited by their roles or capabilities
  2. Admin can select which post types are limited on a per user basis
  3. Limiting by Post Type and Limiting by User role and capabilities are both exclusive to each other in saving the settings, but they build off each other determining if the user is able to publish another post or not

Once you have built in this functionality I will be happy to merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants