Skip to content

Commit

Permalink
Merge pull request #116 from alleyinteractive/feature/issue-113/updat…
Browse files Browse the repository at this point in the history
…e-wp-fieldmanager-remove-phpstan-ignores

Issue-113: Update WordPress Fieldmanager and remove unnecessary instances of `@phpstan-ignore-next-line the Fieldmanager doc block is incorrect.`
  • Loading branch information
nikkifurls authored May 6, 2024
2 parents 4653a1b + 70e9a1e commit 7e50d63
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `Newsletter Builder` will be documented in this file.

## 0.3.10 - 2024-05-06

- Removes instances of `@phpstan-ignore-next-line the Fieldmanager doc block is incorrect` which are unnecessary now that WordPress Fieldmanager doc blocks have been updated

## 0.3.9 - 2024-05-06

- Adds `wp_newsletter_builder_allowed_post_types` filter for filtering post types that appear in the post picker
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ For example, to allow a custom `podcast` post type to appear in the post picker,

```php
add_filter( 'wp_newsletter_builder_allowed_post_types',
function( array $allowed_post_types ) {
function( array $allowed_post_types ) {
$allowed_post_types[] = 'podcast';
return $allowed_post_types;
}
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Newsletter Builder
* Plugin URI: https://github.com/alleyinteractive/wp-newsletter-builder
* Description: Interface to manage email newsletters
* Version: 0.3.9
* Version: 0.3.10
* Author: Alley Interactive
* Author URI: https://github.com/alleyinteractive/wp-newsletter-builder
* Requires at least: 6.2
Expand Down
2 changes: 0 additions & 2 deletions src/class-breaking-recipients.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ public function maybe_register_settings_page(): void {
*/
public function register_fields(): void {
$settings = new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'name' => static::SETTINGS_KEY,
'label' => __( 'List', 'wp-newsletter-builder' ),
'children' => [
'list' => new \Fieldmanager_Autocomplete(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'datasource' => new \Fieldmanager_Datasource(
[
Expand Down
9 changes: 0 additions & 9 deletions src/class-email-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function register_fields(): void {
$plugin_settings = new Settings();
$from_names = $plugin_settings->get_from_names();
$settings = new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'name' => static::SETTINGS_KEY,
'children' => [
Expand All @@ -67,7 +66,6 @@ public function presave( $value, $current_value = [] ) {
},
'label' => new \Fieldmanager_TextField( __( 'Label', 'wp-newsletter-builder' ) ),
'image' => new \Fieldmanager_Media(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Image', 'wp-newsletter-builder' ),
'preview_size' => 'full',
Expand Down Expand Up @@ -95,7 +93,6 @@ public function presave( $value, $current_value = [] ) {
]
),
'safe_rtb' => new \Fieldmanager_TextArea(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'SafeRTB Ad Tag', 'wp-newsletter-builder' ),
'sanitize' => function ( $value ) {
Expand All @@ -104,12 +101,10 @@ public function presave( $value, $current_value = [] ) {
],
),
'ad_tags' => new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Tags', 'wp-newsletter-builder' ),
'children' => [
'tag_code' => new \Fieldmanager_TextArea(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Ad Tag', 'wp-newsletter-builder' ),
'sanitize' => function ( $value ) {
Expand All @@ -123,24 +118,20 @@ public function presave( $value, $current_value = [] ) {
]
),
'roadblock' => new \Fieldmanager_Checkbox(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Enable Ad Roadblock', 'wp-newsletter-builder' ),
]
),
'key_values' => new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Key/Value Pairs', 'wp-newsletter-builder' ),
'children' => [
'key' => new \Fieldmanager_TextField(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Key', 'wp-newsletter-builder' ),
]
),
'value' => new \Fieldmanager_TextField(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Value', 'wp-newsletter-builder' ),
]
Expand Down
8 changes: 0 additions & 8 deletions src/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function register_fields(): void {
'from_email' => new \Fieldmanager_TextField( __( 'From Email', 'wp-newsletter-builder' ) ),
'reply_to_email' => new \Fieldmanager_TextField( __( 'Reply To Email', 'wp-newsletter-builder' ) ),
'from_names' => new \Fieldmanager_TextField(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'From Names', 'wp-newsletter-builder' ),
'limit' => 0,
Expand All @@ -60,45 +59,38 @@ public function register_fields(): void {
]
),
'footer_settings' => new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Footer Settings', 'wp-newsletter-builder' ),
'collapsed' => true,
'collapsible' => true,
'children' => [
'facebook_url' => new \Fieldmanager_Link(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Facebook URL', 'wp-newsletter-builder' ),
]
),
'twitter_url' => new \Fieldmanager_Link(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Twitter URL', 'wp-newsletter-builder' ),
]
),
'instagram_url' => new \Fieldmanager_Link(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Instagram URL', 'wp-newsletter-builder' ),
]
),
'youtube_url' => new \Fieldmanager_Link(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'YouTube URL', 'wp-newsletter-builder' ),
]
),
'image' => new \Fieldmanager_Media(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Footer Image', 'wp-newsletter-builder' ),
'preview_size' => 'medium',
]
),
'address' => new \Fieldmanager_TextField(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'label' => __( 'Company Address', 'wp-newsletter-builder' ),
]
Expand Down
1 change: 0 additions & 1 deletion src/email-providers/class-campaign-monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function maybe_register_settings_page(): void {
*/
public function register_fields(): void {
$settings = new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'name' => static::SETTINGS_KEY,
'children' => [
Expand Down
1 change: 0 additions & 1 deletion src/email-providers/class-sendgrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public function maybe_register_settings_page(): void {
*/
public function register_fields(): void {
$settings = new \Fieldmanager_Group(
// @phpstan-ignore-next-line the Fieldmanager doc block is incorrect.
[
'name' => static::SETTINGS_KEY,
'children' => [
Expand Down

0 comments on commit 7e50d63

Please sign in to comment.