What is the difference between `add_action()` and `add_filter()` in WordPress?

WordPress Fundamental Medium

WordPress Fundamental — Medium

What is the difference between `add_action()` and `add_filter()` in WordPress?

Key points

  • `add_action()` executes functions without returning data
  • `add_filter()` modifies and returns data passed through hooks
  • Understanding the distinction helps in utilizing hooks effectively

Ready to go further?

Related questions