Skip to content

Commit

Permalink
added setting for blog
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipsesrl committed Sep 30, 2019
1 parent ab8a339 commit 04fb4c0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions includes/Blog/Blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
{

Expand Down
5 changes: 4 additions & 1 deletion includes/Dashboard/Views/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ private static function blog_tab()
<?php _e('Author Title', UDESLY_TEXT_DOMAIN); ?>
</Help>
</Material-Input>
<Checkbox
name="blog.hide_password_protected"><?php _e("Hide Password Protected posts from Archive", UDESLY_TEXT_DOMAIN); ?></Checkbox>
</Expansion-Panel>
<Expansion-Panel>
<template v-slot:header>
Expand Down Expand Up @@ -585,7 +587,8 @@ public static function get_blog_settings()
"excerpt_length" => 20,
"excerpt_more" => "...",
"show_categories" => "all",
"general_archive_title" => "Archives: %s"
"general_archive_title" => "Archives: %s",
"hide_password_protected" => false,
));
}

Expand Down
4 changes: 2 additions & 2 deletions udesly-adapter-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Udesly Adapter
* Plugin URI: https://www.udesly.com
* Description: This is a support plugin for Udesly (Webflow to WordPress converter) that allows you to enable additional features for your theme.
* Version: 2.0.0.30
* Version: 2.0.0.31
* Author: Udesly
* Author URI: https://www.udesly.com
* License: GPL-2.0+
Expand All @@ -29,7 +29,7 @@
// Constants
defined('UDESLY_ADAPTER_PLUGIN_DIRECTORY_PATH') ?: define('UDESLY_ADAPTER_PLUGIN_DIRECTORY_PATH', plugin_dir_path(__FILE__));
defined('UDESLY_ADAPTER_PLUGIN_DIRECTORY_URL') ?: define('UDESLY_ADAPTER_PLUGIN_DIRECTORY_URL', plugin_dir_url(__FILE__));
defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.0.30");
defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.0.31");
defined('UDESLY_TEXT_DOMAIN') ?: define('UDESLY_TEXT_DOMAIN', "udesly-adapter-plugin");

defined('UDESLY_ADAPTER_PLUGIN_MISC_PATH') ?: define('UDESLY_ADAPTER_PLUGIN_MISC_PATH', plugin_dir_path(__FILE__) . 'includes/misc/');
Expand Down

0 comments on commit 04fb4c0

Please sign in to comment.