Using Hooks, Filters, and Actions with WP All Import and WP All Export

Using Hooks, Filters, and Actions with WP All Import and WP All Export

WordPress makes heavy use of filters and actions to allow for its extensible nature. Collectively called hooks, those filters and actions do the heavy lifting to allow WordPress to support plugins and themes. WP All Import and WP All Export both have their own set of filters and actions that allow for modifying how each import or export works.

How Do Actions Work?

Actions are essentially a simple means for custom code you write to be called automatically when some action/event takes place. For example, say an order is made in WooCommerce and you wanted to trigger an alert at a remote API endpoint. You could call your code with the appropriate hook to make that possible.

Here's the full explanation of Actions in WordPress: https://developer.wordpress.org/plugins/hooks/actions/

How Do Filters Work?

In simplest terms, filters are actions that expect some piece of data to be returned. These filters will include a piece of data, your code would be expected to manipulate that data, then it would be returned for further processing.

Here's the WordPress reference for Filters: https://developer.wordpress.org/plugins/hooks/filters/

What Else Should I Know?

Most of the filters and actions included in WP All Import can be used directly in the Function Editor. For those that can't, it will be noted in our Action Reference and any example snippets as appropriate.

What's Next?

WP All Import Action Reference

Helpful Example Code Snippets

Related

Inline PHP

Add-On API

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注