WordPress Hooks

  • View
    222

  • Download
    0

Embed Size (px)

Text of WordPress Hooks

  • Micah Wood @wpscholar https://wpscholar.com

    WordPress Hooks

    https://wpscholar.com

  • Actions

  • What is an action?An action is an event that occurs while WordPress is running.

  • Event TriggerWhen Jill comes by, send her to the store for milk.

  • Event ListenerWhen Jill comes by, send her to the store for milk.

  • Do ActionEvent Trigger

  • Add ActionEvent Listener

  • Remove Action

  • Remove All Actions

  • Has Action

  • Did Action

  • Current Action

  • Doing Action

  • Filters

  • What is a filter?A filter is a collection of functions through which variables are passed.

  • HandoffWhen Jack hands you his Rubix cube, solve it for him.

  • ManipulationWhen Jack hands you his Rubix cube, solve it for him.

  • Apply FiltersHandoff

  • Add FilterManipulation

  • Remove Filter

  • Remove All Filters

  • Has Filter

  • Current Filter

  • Doing Filter

  • Pop Quiz

  • Explain the difference between an action and filter.An action allows you to do something.A filter allows you to do something to something.

  • Demo

  • Register Post Type

  • Change Body Classes

  • Alter Content

  • Resources

  • http://docs.presscustomizr.com/article/26-wordpress-actions-filters-and-hooks-a-guide-for-non-developers

    http://blog.teamtreehouse.com/hooks-wordpress-actions-filters-examples https://codex.wordpress.org/Plugin_API/Action_Reference https://codex.wordpress.org/Plugin_API/Filter_Reference https://www.smashingmagazine.com/2011/10/definitive-guide-wordpress-

    hooks/ https://wordpress.org/plugins/wp-hooker/ https://wordpress.org/plugins/debug-bar-actions-and-filters-addon/ http://wiki.theoctaneagency.com/doku.php?id=wordpress:list-hooked-

    functions https://pantheon.io/blog/tracing-wordpress-actions-and-filters

    Resources

    http://docs.presscustomizr.com/article/26-wordpress-actions-filters-and-hooks-a-guide-for-non-developershttp://blog.teamtreehouse.com/hooks-wordpress-actions-filters-exampleshttps://codex.wordpress.org/Plugin_API/Action_Referencehttps://codex.wordpress.org/Plugin_API/Filter_Referencehttps://www.smashingmagazine.com/2011/10/definitive-guide-wordpress-hooks/https://wordpress.org/plugins/wp-hooker/https://wordpress.org/plugins/debug-bar-actions-and-filters-addon/http://wiki.theoctaneagency.com/doku.php?id=wordpress:list-hooked-functionshttps://pantheon.io/blog/tracing-wordpress-actions-and-filters

  • Micah Wood @wpscholar https://wpscholar.com

    Questions?

    https://wpscholar.com