alleyinteractive / apple-news

The Publish to Apple News plugin enables your WordPress blog content to be published to your Apple News channel.
https://wordpress.org/plugins/publish-to-apple-news/
GNU General Public License v3.0
152 stars 70 forks source link

apple_news_notice_message filter doesn't fire #1118

Open rversantos opened 1 month ago

rversantos commented 1 month ago

Description

I'm trying to use apple_news_notice_message filter to customize skip push messages for posts that are not pushed to apple news, but the filter is never trigged and we always the default message saying "Skipped push of article XXX due to the apple_news_skip_push filter."

I'm using like this:

    add_filter('apple_news_notice_message', [__CLASS__, 'filterSkipMessages'], 10, 2);

    public static function filterSkipMessages(string $message, string $type): string
    {
        <Logic to tweak the message here>

        return $message
    }

Am I doing something wrong? Found the filter here: https://github.com/alleyinteractive/apple-news/wiki/Filter:-apple_news_notice_message

kevinfodness commented 4 days ago

Where are you seeing the message? Is it in the post editor or in another area of the admin? If you're using the block editor (Gutenberg) and are seeing this on the post edit screen, I don't believe this filter fires in that context (it's using snackbar notifications via JavaScript instead).