Skip to content

Commit

Permalink
Merge branch 'release/4.17.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mecha committed Dec 12, 2019
2 parents 2f7ba7e + 2b139d6 commit abc0cfa
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 63 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [4.17.1] - 2019-12-12
### Fixed
* The new slug option was appearing on the edit pages for posts of all types.

## [4.17] - 2019-12-11
### Added
* New "Tools" that replaces the "Blacklist", "Import/Export" and "Debugging" pages.
Expand Down
10 changes: 5 additions & 5 deletions src/Entities/Properties/WpPostPermalinkProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
/**
* A property for WordPress post permalinks. Read-only.
*
* @since [*next-version*]
* @since 4.17
*/
class WpPostPermalinkProperty implements PropertyInterface
{
/**
* @since [*next-version*]
* @since 4.17
*
* @var PropertyInterface
*/
Expand All @@ -22,7 +22,7 @@ class WpPostPermalinkProperty implements PropertyInterface
/**
* Constructor.
*
* @since [*next-version*]
* @since 4.17
*
* @param PropertyInterface $idProp The property for the WP Post instance or ID.
*/
Expand All @@ -34,7 +34,7 @@ public function __construct(PropertyInterface $idProp)
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function getValue(EntityInterface $entity)
{
Expand All @@ -44,7 +44,7 @@ public function getValue(EntityInterface $entity)
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function setValue(EntityInterface $entity, $value)
{
Expand Down
14 changes: 7 additions & 7 deletions src/Entities/Properties/WpraItemSourceProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
* no value for the property, the feed source property is used instead. All set operations will be handled using the
* feed item property.
*
* @since [*next-version*]
* @since 4.17
*/
class WpraItemSourceProperty implements PropertyInterface
{
/**
* @since [*next-version*]
* @since 4.17
*
* @var PropertyInterface
*/
protected $itemProp;

/**
* @since [*next-version*]
* @since 4.17
*
* @var PropertyInterface
*/
protected $sourceProp;

/**
* @since [*next-version*]
* @since 4.17
*
* @var string
*/
Expand All @@ -43,7 +43,7 @@ class WpraItemSourceProperty implements PropertyInterface
/**
* Constructor.
*
* @since [*next-version*]
* @since 4.17
*
* @param PropertyInterface $itemProp The feed item property.
* @param PropertyInterface $sourceProp The feed source property.
Expand All @@ -62,7 +62,7 @@ public function __construct(
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function getValue(EntityInterface $item)
{
Expand All @@ -85,7 +85,7 @@ public function getValue(EntityInterface $item)
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function setValue(EntityInterface $entity, $value)
{
Expand Down
24 changes: 20 additions & 4 deletions src/Handlers/RenderMetaBoxTemplateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,45 @@ class RenderMetaBoxTemplateHandler
*/
protected $entityKey;

/**
* @since 4.17.1
*
* @var string[]|null
*/
protected $postTypes;

/**
* Constructor.
*
* @since [*next-version*]
* @since 4.17
*
* @param TemplateInterface $template
* @param CollectionInterface $collection
* @param string $entityKey
*/
public function __construct(TemplateInterface $template, CollectionInterface $collection, $entityKey = 'entity')
{
public function __construct(
TemplateInterface $template,
CollectionInterface $collection,
$postTypes = [],
$entityKey = 'entity'
) {
$this->template = $template;
$this->collection = $collection;
$this->entityKey = $entityKey;
$this->postTypes = $postTypes;
}

/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function __invoke($post, $args = [])
{
if (!empty($this->postTypes) && !in_array($post->post_type, $this->postTypes)) {
return;
}

$entity = isset($this->collection[$post->ID])
? $this->collection[$post->ID]
: [];
Expand Down
30 changes: 15 additions & 15 deletions src/Modules/BlacklistToolModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
/**
* The module that adds the "Blacklist" tool to WP RSS Aggregator.
*
* @since [*next-version*]
* @since 4.17
*/
class BlacklistToolModule implements ModuleInterface
{
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function getFactories()
{
return [
/*
* Information about the "Blacklist" tool.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/info' => function (ContainerInterface $c) {
return [
Expand All @@ -39,7 +39,7 @@ public function getFactories()
/*
* The context to add to the "Tools" page.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/page/context' => function (ContainerInterface $c) {
ob_start();
Expand All @@ -55,15 +55,15 @@ public function getFactories()
/*
* The list table to show on the "Blacklist" tool page.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/page/list_table' => function (ContainerInterface $c) {
return new BlacklistTable($c->get('wpra/admin/tools/blacklist/collection'));
},
/*
* The notice to show when a URL is being added to the blacklist with an empty URL.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/empty_url_notice' => function () {
return sprintf(
Expand All @@ -74,7 +74,7 @@ public function getFactories()
/*
* The notice to show when a URL has been added to the blacklist.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/added_notice' => function () {
return sprintf(
Expand All @@ -85,7 +85,7 @@ public function getFactories()
/*
* The handler that listens to requests for adding URLs to the blacklist.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/add_handler' => function (ContainerInterface $c) {
return function () use ($c) {
Expand Down Expand Up @@ -125,7 +125,7 @@ public function getFactories()
/*
* The handler that listens to blacklist deletion requests.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/delete_handler' => function (ContainerInterface $c) {
return function () use ($c) {
Expand All @@ -145,7 +145,7 @@ public function getFactories()
/*
* The handlerthat listens to bulk blacklist deletion requests.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/bulk_delete_handler' => function (ContainerInterface $c) {
return function () use ($c) {
Expand All @@ -170,7 +170,7 @@ public function getFactories()
/*
* Alias for the blacklist entity collection, if it exists.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/blacklist/collection' => function (ContainerInterface $c) {
return $c->has('wpra/feeds/blacklist/collection')
Expand All @@ -183,23 +183,23 @@ public function getFactories()
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function getExtensions()
{
return [
/*
* Registers the "Blacklist" tool.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools' => function (ContainerInterface $c, $tools) {
return $tools + ['blacklist' => $c->get('wpra/admin/tools/blacklist/info')];
},
/*
* Adds the context for the "Blacklist" tool on the "Tools" page.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/admin/tools/page/context' => function (ContainerInterface $c, $ctx) {
return $ctx + ['blacklist' => $c->get('wpra/admin/tools/blacklist/page/context')];
Expand All @@ -210,7 +210,7 @@ public function getExtensions()
/**
* @inheritdoc
*
* @since [*next-version*]
* @since 4.17
*/
public function run(ContainerInterface $c)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Modules/FeedSourcesModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,24 +307,26 @@ public function getFactories()
/*
* The handler that renders the source info meta box on the edit page.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/feeds/sources/meta_boxes/save/renderer' => function (ContainerInterface $c) {
return new RenderMetaBoxTemplateHandler(
$c->get('wpra/twig/collection')['admin/feeds/save-meta-box.twig'],
$c->get('wpra/feeds/sources/collection'),
['wprss_feed'],
'feed'
);
},
/*
* The handler that renders the shortcode on the edit page.
*
* @since [*next-version*]
* @since 4.17
*/
'wpra/feeds/sources/meta_boxes/shortcode/renderer' => function (ContainerInterface $c) {
return new RenderMetaBoxTemplateHandler(
$c->get('wpra/twig/collection')['admin/feeds/shortcode.twig'],
$c->get('wpra/feeds/sources/collection'),
['wprss_feed'],
'feed'
);
},
Expand Down
Loading

0 comments on commit abc0cfa

Please sign in to comment.