diff --git a/README.txt b/README.txt index 366ed04..439a601 100644 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Donate link: https://www.udesly.com/ Tags: webflow to wordpress, editor, page builder, layout design, udesly, webflow Requires at least: 5.0 Tested up to: 5.2.3 -Stable tag: 2.0.0.30 +Stable tag: 2.0.0.31 License: GPLv3 or later License URI: https://www.udesly.com/terms-conditions-of-use/#udesly-wordpress-plugin Requires PHP: 5.6.0 @@ -80,6 +80,9 @@ That's all! Absolutely! You can use the Udesly Adapter to create more than one website. == Changelog == += 2.0.0.31 = +* Added hide protected posts from archive page setting + = 2.0.0.30 = * Added password protection page functionality diff --git a/includes/Blog/Blog.php b/includes/Blog/Blog.php index 9af9441..a211eda 100644 --- a/includes/Blog/Blog.php +++ b/includes/Blog/Blog.php @@ -31,6 +31,10 @@ public function public_hooks() add_action('wp_ajax_nopriv_udesly_get_posts', array($this, "udesly_get_posts")); add_filter( 'get_the_archive_description', array($this, "filter_archive_description") ); + if ($this->settings['hide_password_protected'] == true) { + add_filter( 'posts_where', array($this, "password_post_filter") ); + } + } public function filter_archive_description($description) { @@ -92,6 +96,14 @@ public function udesly_get_posts() } + public function password_post_filter( $where = '' ) { + if (!is_single() && !is_admin()) { + $where .= " AND post_password = ''"; + } + return $where; + } + + public function excerpt($length) { diff --git a/includes/Dashboard/Views/Settings.php b/includes/Dashboard/Views/Settings.php index f4f64c4..afbfabb 100644 --- a/includes/Dashboard/Views/Settings.php +++ b/includes/Dashboard/Views/Settings.php @@ -134,6 +134,8 @@ private static function blog_tab() +