

{"id":853,"date":"2018-11-03T10:32:27","date_gmt":"2018-11-03T09:32:27","guid":{"rendered":"https:\/\/codeermeneer.nl\/?p=853"},"modified":"2018-11-03T10:32:27","modified_gmt":"2018-11-03T09:32:27","slug":"codex-auto-updater","status":"publish","type":"post","link":"https:\/\/wijzijnqreative.nl\/web\/documentation\/codex-auto-updater\/","title":{"rendered":"Companion Auto Update Hooks: Actions and filters"},"content":{"rendered":"\n<p class=\"has-medium-font-size\">If\u00a0 you&#8217;re a plugin or theme developer and would like to extend the features of <a href=\"https:\/\/plugins.wijzijnqreative.nl\/portfolio\/plugin\/companion-auto-update\/\">Companion Auto Update<\/a> you can do so by using custom action hooks and filters. If you have any idea on new hooks that should be added to this plugin please <a href=\"https:\/\/plugins.wijzijnqreative.nl\/contact\/\">reach out to me<\/a> and I&#8217;ll see what I can do.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"section-2\">Using hooks<\/h2>\n\n\n\n<p>If you use a hook to add or manipulate code, you can add your custom code in a variety of ways:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To a\u00a0custom child theme\u2019s\u00a0<code>functions.php<\/code>\u00a0file.<\/li>\n\n\n\n<li>Using a plugin such as\u00a0<a href=\"https:\/\/wordpress.org\/plugins\/code-snippets\/\">Code Snippets<\/a>.<\/li>\n<\/ul>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"after-plugin-updates\"><sub><mark style=\"color:#8b57ff\" class=\"has-inline-color\">Action Hook:<br><\/mark><\/sub><strong>After plugin updates<\/strong><\/h2>\n\n\n\n<p>This function runs after a plugin has been succesfully updated.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark class=\"has-inline-color has-pale-cyan-blue-color\">function <\/mark><mark class=\"has-inline-color has-vivid-green-cyan-color\">your_function<\/mark>() {\n     <code><mark class=\"has-inline-color has-cyan-bluish-gray-color\">\/\/ Your custom code goes here <\/mark><\/code>\n}\n<mark class=\"has-inline-color has-pale-cyan-blue-color\">add_action<\/mark>( <mark class=\"has-inline-color has-luminous-vivid-amber-color\">'cau_after_plugin_update', 'your_function'<\/mark> );<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"after-plugin-updates\"><sub><mark style=\"color:#8b57ff\" class=\"has-inline-color\">Action Hook:<br><\/mark><\/sub><strong>After theme updates<\/strong><\/h2>\n\n\n\n<p>This function runs after a theme has been succesfully updated.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark class=\"has-inline-color has-pale-cyan-blue-color\">function <\/mark><mark class=\"has-inline-color has-vivid-green-cyan-color\">your_function<\/mark>() {\n     <code><mark class=\"has-inline-color has-cyan-bluish-gray-color\">\/\/ Your custom code goes here <\/mark><\/code>\n}\n<mark class=\"has-inline-color has-pale-cyan-blue-color\"><mark class=\"has-inline-color has-pale-cyan-blue-color\">add_action<\/mark><\/mark>( <mark class=\"has-inline-color has-luminous-vivid-amber-color\">'cau_after_plugin_update', 'your_function'<\/mark> );<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"after-plugin-updates\"><sub><mark style=\"color:#8b57ff\" class=\"has-inline-color\">Action Hook:<br><\/mark><\/sub><strong>After <strong>core <\/strong>updates<\/strong><\/h2>\n\n\n\n<p>This function runs after the core has been succesfully updated.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark class=\"has-inline-color has-pale-cyan-blue-color\">function <\/mark><mark class=\"has-inline-color has-vivid-green-cyan-color\">your_function<\/mark>() {\n     <code><mark class=\"has-inline-color has-cyan-bluish-gray-color\">\/\/ Your custom code goes here <\/mark><\/code>\n}\n<mark class=\"has-inline-color has-pale-cyan-blue-color\"><mark class=\"has-inline-color has-pale-cyan-blue-color\">add_action<\/mark><\/mark>( <mark class=\"has-inline-color has-luminous-vivid-amber-color\">'cau_after_core_update', 'your_function'<\/mark> );<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If\u00a0 you&#8217;re a plugin or theme developer and would like to extend the features of Companion Auto Update you can do so by using custom action hooks and filters. If you have any idea on new hooks that should be added to this plugin please reach out to me and I&#8217;ll see what I can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":857,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,30],"tags":[],"class_list":["post-853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-auto-updater","category-documentation"],"_links":{"self":[{"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/posts\/853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/comments?post=853"}],"version-history":[{"count":0,"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/posts\/853\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/media\/857"}],"wp:attachment":[{"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/media?parent=853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/categories?post=853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wijzijnqreative.nl\/web\/wp-json\/wp\/v2\/tags?post=853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}