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

WP 6.0 update #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: 99robots, charliepatel, DraftPress
Donate link:
Tags: limit posts, limit number of posts, limit author posts, custom post limits, post creation limits, cpt limits, limit pages, limit user, limits, post limit, posts per user, user post limit, page limit, publish limit
Requires at least: 4.9
Tested up to: 5.8.1
Stable tag: 2.1.2
Tested up to: 6.0
Stable tag: 2.1.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -55,6 +55,9 @@ Rather than force the user to delete their post, such posts will be submitted fo

== Changelog ==

= 2.1.3 = 2022-06-07
* UPDATED: Compatibility with WordPress 6.0


= 2.1.2 = 2021-09-14
* Made compatible with WordPress 5.8.1
Expand Down
46 changes: 23 additions & 23 deletions wpsite-limit-posts.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php

/**
* Plugin Name: Limit Posts
* Plugin URI: https://draftpress.com/products
* Description: Limit the number of posts or custom post types that can be published based on role (i.e, author) or user.
* Version: 2.1.2
* Version: 2.1.3
* Author: DraftPress
* Author URI: https://draftpress.com/
* License: GPL2
Expand All @@ -21,7 +22,7 @@
* WPsiteLimitPosts main class
*
* @since 1.0.0
* @using Wordpress 5.7.2
* @using Wordpress 5.9.3
*/
class WPsite_Limit_Posts
{
Expand All @@ -30,7 +31,7 @@ class WPsite_Limit_Posts
* WPsite_Limit_Posts version.
* @var string
*/
public $version = '2.1.2';
public $version = '2.1.3';

/**
* The single instance of the class.
Expand Down Expand Up @@ -105,7 +106,6 @@ public static function instance()
*/
private function __construct()
{

}

/**
Expand Down Expand Up @@ -366,25 +366,25 @@ public function extend_submitdiv_post_status()
$options .= "<option{$selected} value='{$status->name}'>{$status->label}</option>";
}
}
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
<?php
// Add the selected post status label to the "Status: [Name] (Edit)"
if (!empty($display)):
?>
$( '#post-status-display' ).html( '<?php echo $display; ?>' )
<?php
endif;

// Add the options to the <select> element
?>
var select = $( '#post-status-select' ).find( 'select' );
$( select ).append( "<?php echo $options; ?>" );
} );
</script>
<?php
}
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
<?php
// Add the selected post status label to the "Status: [Name] (Edit)"
if (!empty($display)) :
?>
$('#post-status-display').html('<?php echo $display; ?>')
<?php
endif;

// Add the options to the <select> element
?>
var select = $('#post-status-select').find('select');
$(select).append("<?php echo $options; ?>");
});
</script>
<?php
}

// Helpers -----------------------------------------------------------

Expand Down