Skip to content

Commit

Permalink
chore(release): merge in release v2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
matticbot committed Dec 18, 2024
2 parents 47f0e22 + ae030b6 commit 48c27e0
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.3.4](https://github.com/Automattic/newspack-network/compare/v2.3.3...v2.3.4) (2024-12-18)


### Bug Fixes

* Force Distributor to not override bylines ([#175](https://github.com/Automattic/newspack-network/issues/175)) ([efbc979](https://github.com/Automattic/newspack-network/commit/efbc9798cc7c13985e2a9a2e4920f485dbe8a11e))

## [2.3.3](https://github.com/Automattic/newspack-network/compare/v2.3.2...v2.3.3) (2024-12-16)


Expand Down
1 change: 1 addition & 0 deletions includes/class-distributor-customizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ public static function init() {
Distributor_Customizations\Author_Ingestion::init();
Distributor_Customizations\Authorship_Filters::init();
Distributor_Customizations\Comment_Status::init();
Distributor_Customizations\Force_Author_Byline::init();
}
}
51 changes: 51 additions & 0 deletions includes/distributor-customizations/class-force-author-byline.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* Newspack Distributor Force Author byline option.
*
* @package Newspack
*/

namespace Newspack_Network\Distributor_Customizations;

/**
* Class to enforce that the "Override Author Byline" option is always disabled.
*/
class Force_Author_Byline {

/**
* Initialize hooks
*/
public static function init() {
add_filter( 'option_dt_settings', [ __CLASS__, 'filter_dt_settings' ] );
add_filter( 'default_option_dt_settings', [ __CLASS__, 'filter_dt_settings' ] );
add_action( 'admin_init', [ __CLASS__, 'remove_setting' ], 11 );
}

/**
* Filter the Distributor settings to ensure that the "Override Author Byline" option is always disabled.
*
* @param array $settings The Distributor settings.
*/
public static function filter_dt_settings( $settings ) {
if ( ! is_array( $settings ) ) {
$settings = [];
}
$settings['override_author_byline'] = false;
return $settings;
}

/**
* Remove the "Override Author Byline" setting from the Distributor settings page.
*/
public static function remove_setting() {
global $wp_settings_fields;

if (
isset( $wp_settings_fields['distributor'] ) &&
isset( $wp_settings_fields['distributor']['dt-section-1'] ) &&
isset( $wp_settings_fields['distributor']['dt-section-1']['override_author_byline'] )
) {
unset( $wp_settings_fields['distributor']['dt-section-1']['override_author_byline'] );
}
}
}
2 changes: 1 addition & 1 deletion newspack-network.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Newspack Network
* Description: The Newspack Network plugin.
* Version: 2.3.3
* Version: 2.3.4
* Author: Automattic
* Author URI: https://newspack.com/
* License: GPL3
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newspack-network",
"version": "2.3.3",
"version": "2.3.4",
"description": "The Newspack Network plugin.",
"license": "GPL-3.0",
"browserslist": [
Expand Down

0 comments on commit 48c27e0

Please sign in to comment.