Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [7.4]
php: [8.2]

steps:
- name: Checkout code
Expand All @@ -26,7 +26,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## v3.8.3

- Fix: Restore default expiration dates feature

## v3.8.3

- Chore: Revert to wp-packagist version of 10up/elasticpress due to psr/container conflicts

## v3.8.2
Expand Down
2 changes: 1 addition & 1 deletion openpub-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Yard | OpenPub Base
* Plugin URI: https://www.openwebconcept.nl/
* Description: Acts as foundation for other OpenPub related content plugins. This plugin implements actions to allow for other plugins to add and/or change Custom Posttypes, Metaboxes, Taxonomies, en Posts 2 posts relations.
* Version: 3.8.3
* Version: 3.8.4
* Author: Yard | Digital Agency
* Author URI: https://www.yard.nl/
* License: GPL-3.0
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Foundation/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Plugin
{
public const NAME = 'openpub-base';
public const VERSION = '3.8.3';
public const VERSION = '3.8.4';

protected string $rootPath;
public Config $config;
Expand Down
9 changes: 7 additions & 2 deletions src/Base/Metabox/MetaboxServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ protected function registerMetaboxFields(CMB2 $metabox, array $fields): void

protected function addExpirationDefaultValue(array $configMetaboxes): array
{
$configMetaboxes['base']['fields']['general']['expiration']['std'] = (new \DateTime('now', new \DateTimeZone('Europe/Amsterdam')))->modify('+' . $this->plugin->settings->expireAfter() . ' days')->format('Y-m-d H:i');
$configMetaboxes['base']['fields']['general']['expiration']['desc'] = __('Items with an expiration date will be excluded from the search results and on news overview page from this date forward.', 'openpub-base');
$configMetaboxes['base']['fields']['general']['expiration']['default_cb'] = function( $field_args, $field ) {
$post = get_post( $field->object_id );
if ( ! $post || $post->post_status !== 'auto-draft' ) {
return '';
}
return strtotime( 'midnight', strtotime( '+' . $this->plugin->settings->expireAfter() . ' days' ) );
};

return $configMetaboxes;
}
Expand Down
Loading