Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
* Fix possible cache expiration filter change.
* Fix compatibilities with keyword filtering on full content and Elementor context.
  • Loading branch information
selul authored Oct 26, 2022
2 parents 73cee51 + ddea53d commit 1eb69c0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
22 changes: 12 additions & 10 deletions includes/abstract/feedzy-rss-feeds-admin-abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ public function feedzy_feed_item_keywords_title( $continue, $sc, $item, $feed_ur
return true;
}

$inc_on = ! empty( $sc['keywords_inc_on'] ) ? $sc['keywords_inc_on'] : '';
$exc_on = ! empty( $sc['keywords_exc_on'] ) ? $sc['keywords_exc_on'] : '';
$inc_on = ! empty( $sc['keywords_inc_on'] ) ? $sc['keywords_inc_on'] : 'title';
$exc_on = ! empty( $sc['keywords_exc_on'] ) ? $sc['keywords_exc_on'] : 'title';

if ( isset( $sc['keywords_inc'] ) && ! empty( $sc['keywords_inc'] ) ) {
$keywords = $sc['keywords_inc'];
Expand Down Expand Up @@ -777,15 +777,17 @@ private function init_feed( $feed_url, $cache, $sc, $allow_https = FEEDZY_ALLOW_
if ( false === apply_filters( 'feedzy_disable_db_cache', false, $feed_url ) ) {
SimplePie_Cache::register( 'wp_transient', 'WP_Feed_Cache_Transient' );
$feed->set_cache_location( 'wp_transient' );
if ( ! has_filter( 'wp_feed_cache_transient_lifetime' ) ) {
add_filter(
'wp_feed_cache_transient_lifetime',
function( $time ) use ( $cache_time ) {
return $cache_time;
},
10,
1
);
}
$feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', $cache_time, $feed_url ) );
add_filter(
'wp_feed_cache_transient_lifetime',
function( $time ) use ( $cache_time ) {
return $cache_time;
},
10,
1
);
} else {
require_once ABSPATH . 'wp-admin/includes/file.php';
WP_Filesystem();
Expand Down
14 changes: 6 additions & 8 deletions includes/elementor/widgets/register-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,9 @@ protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDecl
'type' => Controls_Manager::SELECT,
'default' => 'title',
'options' => array(
'title' => __( 'Title', 'feedzy-rss-feeds' ),
'description' => __( 'Description', 'feedzy-rss-feeds' ),
'author' => __( 'Author', 'feedzy-rss-feeds' ),
'full-content' => __( 'Full Content', 'feedzy-rss-feeds' ),
'title' => __( 'Title', 'feedzy-rss-feeds' ),
'description' => __( 'Description', 'feedzy-rss-feeds' ),
'author' => __( 'Author', 'feedzy-rss-feeds' ),
),
'classes' => $this->upsell_class(),
)
Expand All @@ -181,10 +180,9 @@ protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDecl
'type' => Controls_Manager::SELECT,
'default' => 'title',
'options' => array(
'title' => __( 'Title', 'feedzy-rss-feeds' ),
'description' => __( 'Description', 'feedzy-rss-feeds' ),
'author' => __( 'Author', 'feedzy-rss-feeds' ),
'full-content' => __( 'Full Content', 'feedzy-rss-feeds' ),
'title' => __( 'Title', 'feedzy-rss-feeds' ),
'description' => __( 'Description', 'feedzy-rss-feeds' ),
'author' => __( 'Author', 'feedzy-rss-feeds' ),
),
'separator' => 'before',
'classes' => $this->upsell_class(),
Expand Down
3 changes: 2 additions & 1 deletion includes/views/js/import-metabox-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@
} )
.on( 'removeTag', function( e, tagData ) {
var target = $( e.target );
if ( tagData.index <= 0 ) {
var emptyTags = target.parents( '.tag-list' ).find( '.tagify--empty' ).length;
if ( emptyTags ) {
target.parents( '.tag-list' ).addClass( 'hidden' );
}
} );
Expand Down

0 comments on commit 1eb69c0

Please sign in to comment.