{"id":1624,"date":"2012-08-21T11:00:46","date_gmt":"2012-08-21T17:00:46","guid":{"rendered":"https:\/\/2012.albuquerque.wordcamp.org\/?p=1624"},"modified":"2012-08-21T21:34:43","modified_gmt":"2012-08-22T03:34:43","slug":"hooked-on-actions","status":"publish","type":"post","link":"https:\/\/albuquerque.wordcamp.org\/2012\/hooked-on-actions\/","title":{"rendered":"Hooked on Actions"},"content":{"rendered":"<div class=\"alignright\"><img decoding=\"async\" src=\"https:\/\/2012.albuquerque.wordcamp.org\/files\/2012\/07\/bryce.jpg\" alt=\"Bryce Corkins\" style=\"width:150px\" \/><\/div>\n<p><em>Guest Post by WordCamp Albuquerque speaker <strong>Bryce Corkins<\/strong><\/em><\/p>\n<p>For any WordPress project, it can seem like there are a dozen methods to accomplish almost everything\u2014and there are! Unfortunately, there are a lot of wrong ways to write your code, and only a few right ones. (Or a lot of right ones, depending on who you talk to). In this talk, we&#8217;ll be looking specifically at the WordPress Hook, Action, and Filter process: what it is, how it works, and how it can make your life a lot easier.<\/p>\n<p>Hooks are functions provided by WordPress to allow your theme or plugin to &#8220;hook into&#8221; the rest of WordPress. There are two types of hooks: actions and filters (and they are different). Actions allow you to specify a custom function to be executed at a certain point during WordPress&#8217; execution, or when a specific event occurs. For example, you could execute a function whenever a post is published, whenever a new user registers, after the admin page has finished loading, or at many more points (there are, as of WordPress 3.4, 587 built in actions).<\/p>\n<p>Filters, on the other hand, are used to &#8220;filter&#8221; text as it&#8217;s moved between the user interface and the database. For example, you could change the length of a post excerpt, create a profanity filter, highlight search terms in your search results, and (again) much more.<\/p>\n<p>In this talk, we&#8217;ll go over ways in which hooks, actions, and filters can make your life as a developer a lot easier. We&#8217;ll go through some common use case scenarios, talk about how to selectively disable parts of plugins and themes without modifying their source code, and how to troubleshoot currently running hooks.<\/p>\n<p>A basic understanding of PHP and WordPress functionality is recommended for this presentation, but all are welcome.<\/p>\n<p><a href=\"https:\/\/2012.albuquerque.wordcamp.org\/session\/hooked-on-actions\/\">WordCamp Session<\/a>\u00bb |\u00a0<a href=\"https:\/\/2012.albuquerque.wordcamp.org\/speakers\/#bryce-corkins\">Speaker Profile<\/a>\u00bb<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guest Post by WordCamp Albuquerque speaker Bryce Corkins For any WordPress project, it can seem like there are a dozen methods to accomplish almost everything\u2014and there are! Unfortunately, there are a lot of wrong ways to write your code, and &hellip; <a href=\"https:\/\/albuquerque.wordcamp.org\/2012\/hooked-on-actions\/\">Continue reading <span class=\"screen-reader-text\">Hooked on Actions<\/span>  <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5583229,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1624","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2hGK7-qc","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/posts\/1624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/users\/5583229"}],"replies":[{"embeddable":true,"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/comments?post=1624"}],"version-history":[{"count":3,"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/posts\/1624\/revisions"}],"predecessor-version":[{"id":1626,"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/posts\/1624\/revisions\/1626"}],"wp:attachment":[{"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/media?parent=1624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/categories?post=1624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/albuquerque.wordcamp.org\/2012\/wp-json\/wp\/v2\/tags?post=1624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}