Skip to content

Commit

Permalink
Release 1.6.2: resolve #28, resolve #8
Browse files Browse the repository at this point in the history
  • Loading branch information
mihdan committed Jul 29, 2023
1 parent 3d0efaa commit 769a1af
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 53 deletions.
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
"php": ">=7.4",
"composer/installers": "*",
"wptrt/admin-notices": "*",
"wpackagist-plugin/advanced-custom-fields": "^5.8",
"wpackagist-plugin/advanced-custom-fields": "6.1.7",
"stoutlogic/acf-builder": "^1.9",
"ext-json": "*"
"ext-json": "*",
"wpackagist-plugin/acf-multiple-taxonomy": "^1.0"
},
"extra": {
"installer-paths": {
Expand Down
15 changes: 14 additions & 1 deletion includes/class-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,20 @@ public function alter_query( $args ) {
),
);

// TODO: потеряли категории и теги.
// Исключить записи, прикреплённые к указанным термам.
$excluded_terms = $this->settings->get_option( 'exclude_terms' );

if ( $excluded_terms ) {
$args['tax_query']= [];

foreach ( $excluded_terms as $term ) {
$args['tax_query'][] = [
'taxonomy' => $term->taxonomy,
'terms' => [ $term->term_id ],
'operator' => 'NOT IN',
];
}
}

return $args;
}
Expand Down
10 changes: 10 additions & 0 deletions includes/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Mihdan\YandexTurboFeed;

use StoutLogic\AcfBuilder\FieldNameCollisionException;
use StoutLogic\AcfBuilder\FieldsBuilder;

class Settings {
Expand Down Expand Up @@ -366,6 +367,15 @@ public function add_local_field_groups() {
'required' => true,
)
)
->addField(
$this->utils->get_slug() . '_exclude_terms',
'multiple_taxonomy',
array(
'label' => __( 'Exclude terms', 'mihdan-yandex-turbo-feed' ),
'multiple' => true,
'return_format' => 'object',
)
)
->addRadio(
$this->utils->get_slug() . '_use_excerpt',
array(
Expand Down
6 changes: 3 additions & 3 deletions includes/class-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,15 @@ public function create_related( $url, $src, $title ) {
*/
public function insert_related() {

if ( ! $this->settings->get_option( 'related_posts_enable', $this->feed_id ) ) {
if ( ! $this->settings->get_option( 'related_posts_enable', $this->get_feed_id() ) ) {
return;
}

$related = $this->get_related();

if ( $related->have_posts() ) {
// Если включена бесконечная лента.
if ( $this->settings->get_option( 'related_posts_infinity', $this->feed_id ) ) {
if ( $this->settings->get_option( 'related_posts_infinity', $this->get_feed_id() ) ) {
echo '<yandex:related type="infinity">';
} else {
echo '<yandex:related>';
Expand All @@ -592,7 +592,7 @@ public function get_related() {
$post = get_post();

$args = array(
'post_type' => $this->utils->get_post_type(),
'post_type' => $this->settings->get_option( 'post_type', $this->get_feed_id() ),
'posts_per_page' => 10,
'ignore_sticky_posts' => true,
'no_found_rows' => true,
Expand Down
9 changes: 5 additions & 4 deletions mihdan-yandex-turbo-feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
* Plugin Name: Mihdan: Yandex Turbo Feed
* Plugin URI: https://www.kobzarev.com/projects/yandex-turbo-feed/
* Description: Плагин создаёт настраиваемые ленты для сервиса Яндекс Турбо
* Version: 1.6.1
* Version: 1.6.2
* Author: Mikhail Kobzarev
* Author URI: https://www.kobzarev.com/
* License: GNU General Public License v2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: mihdan-yandex-turbo-feed
* GitHub Plugin URI: https://github.com/mihdan/mihdan-yandex-turbo-feed/
* GitHub Branch: master
* Requires WP: 5.0
* Requires PHP: 7.4
* Requires WP: 5.1
* Requires PHP: 7.0
*/

if ( ! defined( 'ABSPATH' ) ) {
Expand All @@ -35,7 +35,7 @@

// Слаг плагина
define( 'MIHDAN_YANDEX_TURBO_FEED_SLUG', 'mihdan_yandex_turbo_feed' );
define( 'MIHDAN_YANDEX_TURBO_FEED_VERSION', '1.6.1' );
define( 'MIHDAN_YANDEX_TURBO_FEED_VERSION', '1.6.2' );
define( 'MIHDAN_YANDEX_TURBO_FEED_PATH', __DIR__ );
define( 'MIHDAN_YANDEX_TURBO_FEED_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
define( 'MIHDAN_YANDEX_TURBO_FEED_FILE', __FILE__ );
Expand All @@ -48,5 +48,6 @@
if ( ! isset( $plugin ) ) {
require_once MIHDAN_YANDEX_TURBO_FEED_PATH . '/vendor/autoload.php';
require_once MIHDAN_YANDEX_TURBO_FEED_PATH . '/vendor/advanced-custom-fields/acf.php';
require_once MIHDAN_YANDEX_TURBO_FEED_PATH . '/vendor/acf-multiple-taxonomy/acf-multiple-taxonomy.php';
$plugin = new Main();
}
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Contributors: mihdan
Donate link: https://www.kobzarev.com/donate/
Tags: wordpress, feed, yandex, turbo, rss, yandex-turbo, yandex-turbo-pages, rss-feed, seo, seo-friendly, yoast, google, webmaster, schema, sitemap
Requires at least: 5.0
Requires PHP: 7.4
Requires PHP: 7.0
Tested up to: 6.2
Stable tag: 1.6.1
Stable tag: 1.6.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -174,6 +174,11 @@ add_filter( 'mihdan_yandex_turbo_feed_taxonomy', function( $taxonomy ) {

== Changelog ==

= 1.6.2 (2023-07-29) =
* Добавлена возможность исключать записи, прикреплённые к выбранным термам
* Обновлены зависимости плагина
* Исправлена ошибка показа похожих записей

= 1.6.1 (2023-05-16) =
* Добавлена колонка со статусом ленты в списке RSS-лент
* Добавлена колонка со статусом турбо-страниц в списке записей
Expand Down

0 comments on commit 769a1af

Please sign in to comment.