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.

Allows you to add, edit or delete available bulk actions on the Apple News list table.

Filters the capability required to be able to access the Bulk Export page.

Filters the default value for a column in the article list table.

Filters the HTML of the title column in the article list table.

Filters the Exporter_Content_Settings object for this article.

Filters the delete capability required to delete posts from Apple News.

Allows you to add, edit or delete the columns on the Apple News list table.

Allows you to manipulate the $args sent to WP_Query to populate the posts on the Apple News list table.

Allows you to manipulate the arguments for paginating the Apple News list table.

Filters the byline of an article before it is sent to Apple News.

Filters the HTML of a post after the_content filter is called, but before the HTML is parsed into Apple News Format.

Filters the HTML of a post before the_content filter is called, and before the HTML is parsed into Apple News Format.

Filters the cover caption.

Filters the excerpt of an article before it is sent to Apple News.

Filters the language of the article.

Filters the cover image URL of an article before it is sent to Apple News.

Filters the title of an article before it is sent to Apple News.

Modifies the HTML output for the description of any field.

Filters the final article JSON before being sent to Apple News.

Filters the sections for a post.

Allows for custom logic to determine if a post is in sync or not.

Modifies the JSON editor theme.

Modifies the capability required to view the list of Apple News articles.

Allows for filtering of the merged settings before returning.

Modifies the post types available for selection on the settings page.

Changes the context (i.e. column) where the Apple News meta box appears by default on the post edit screen. Defaults to 'side'.

Changes the priority (i.e. vertical location) where the Apple News meta box appears by default on the post edit screen. Defaults to 'high'.

Filters the list of publish statuses available in the article list table.

Allows you to change any success, info, or error notice that appears in the dashboard.

Add headers (such as From:) to notification messages.

Filters the cache lifetime for API responses.

Filters the publish capability required to publish posts to Apple News.

Sets the default arguments for requests of any type.

Modifies the groups for the settings page.

Modifies the setting values for the settings page.

Allows for modification of the taxonomy used for section mapping.

Modifies the capability required to edit Apple News settings. Defaults to manage_options.

Modifies the available sections on the settings page.

Ability to override the autopublishing of posts on a per-post level.

Filters whether the post should be skipped and not pushed to Apple News.

Allow filtering of the default arguments for the request.

Clone this wiki locally