Skip to content

Commit

Permalink
added top level only filter
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipsesrl committed Sep 23, 2019
1 parent 5180854 commit a3f0e81
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: eclipsesrl
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.2
Stable tag: 2.0.0.24
Tested up to: 5.2.3
Stable tag: 2.0.0.25
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,8 @@ That's all!

Absolutely! You can use the Udesly Adapter to create more than one website.
== Changelog ==
= 2.0.0.25 =
* Added Term option top level category option

= 2.0.0.24 =
* Fixed wrong form submissions for radio and checkboxes
Expand Down
14 changes: 14 additions & 0 deletions includes/Query/Taxonomies.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ public static function query_configuration($post)
<?php _e("Name Like", UDESLY_TEXT_DOMAIN); ?>
</Help>
</Material-Input>
<Checkbox name="top_level">
<Help>
<template v-slot:help>
<?php _e("Select only terms that are Top Level", UDESLY_TEXT_DOMAIN); ?>
</template>
<?php _e("Top Level only", UDESLY_TEXT_DOMAIN); ?>
</Help>

</Checkbox>
</template>
</List-Option>
<List-Option name="<?php _e("Sort", UDESLY_TEXT_DOMAIN); ?>">
Expand Down Expand Up @@ -194,6 +203,7 @@ public static function query_configuration($post)
</Material-Input>
</template>
</List-Option>

</div>
<div class="actions">
<Material-Button action="previewTaxonomies" idle="<?php _e('Preview', UDESLY_TEXT_DOMAIN); ?>"
Expand Down Expand Up @@ -275,6 +285,10 @@ private static function clean_query_taxonomies_content($data)
unset($data['taxonomy']);
}

if (isset($data['top_level']) && $data['top_level'] == true) {
unset($data['top_level']);
$data['parent'] = 0;
}

return $data;
}
Expand Down
5 changes: 5 additions & 0 deletions includes/Query/TermsQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ private static function clean_query_post_content($data)
unset($data['name__like']);
}

if (isset($data['top_level']) && $data['top_level'] == true) {
unset($data['top_level']);
$data['parent'] = 0;
}

return $data;
}

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.24
* Version: 2.0.0.25
* 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.24");
defined('UDESLY_ADAPTER_VERSION') ?: define('UDESLY_ADAPTER_VERSION', "2.0.0.25");
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 a3f0e81

Please sign in to comment.