Skip to content

Action and Filter Hooks

kevinfodness edited this page Oct 23, 2020 · 57 revisions

There are numerous action and filter hooks throughout the plugin to allow for advanced users to customize virtually any aspect of the article before it's sent to Apple News. Many larger publishers have used these hooks to create detailed custom templates or modify the post content specifically for Apple News. If you're unfamiliar with hooks in WordPress, the core documentation on actions and filters is a great place to start.

We're providing documentation here on these hooks so everyone is aware of what's available, but as always it's best to view them in the source code and see them in action if you need more clarity on how they can be used. We've listed all hooks below alphabetically, but if you click through for more details on a hook, there is a link to the source file to make it easy for you to find them if needed.

Action hooks

Action hooks are used to trigger custom functions that rely on knowing when a specific piece of code executes or to insert additional content on template pages. They sometimes are accompanied by parameters that are relevant to the specific action. Click on the name of an action hook for more information about that specific hook.

Optional actions to be taken after an async push completes.

Allows for custom HTML to be printed after the bulk export table.

Actions to be taken after postmeta is cleaned up for a post.

Actions to be taken after an article is deleted via the API.

Allows for custom HTML to be printed after the article list table.

Actions to be taken after an article was pushed to Apple News.

Allows custom HTML to be printed after the end of an individual setting on the theme edit page.

Allows custom HTML to be printed after the end of a setting group on the theme edit page.

Allows custom HTML to be printed after the publish single article form.

Optional actions to be taken before an async push starts.

Allows for custom HTML to be printed before the bulk export table.

Actions to be taken before postmeta is cleaned up for a post.

Actions to be taken before an article is deleted via the API.

Allows for custom HTML to be printed before the article list table.

Actions to be taken before an article is pushed to Apple News.

Allows custom HTML to be printed before the start of an individual setting on the theme edit page.

Allows custom HTML to be printed before the start of a setting group on the theme edit page.

Allows custom HTML to be printed before the publish single article form.

Actions to be fired before the Exporter class is created and returned.

Allows theme and plugin authors to add additional Apple News list table filters.

Filter hooks

Filter hooks are used to modify a variable. The first parameter is always the data to be modified and additional parameters may also be provided that are relevant to that specific filter. If you're hooking a filter your function must return the data, even if unmodified, or it will simply delete the value. Click on the name of a filter hook for more information about that specific hook.

Filters custom metadata for the article before being sent to Apple.

Overrides whether Apple News thinks the block editor is active or not.

Clone this wiki locally