{"id":714,"date":"2022-04-10T15:05:05","date_gmt":"2022-04-10T15:05:05","guid":{"rendered":"https:\/\/jmrowe.com\/blog\/?p=714"},"modified":"2022-04-10T15:05:05","modified_gmt":"2022-04-10T15:05:05","slug":"adding-acf-options-page-via-a-plugin","status":"publish","type":"post","link":"https:\/\/jmrowe.com\/blog\/adding-acf-options-page-via-a-plugin\/","title":{"rendered":"Adding ACF Options page via a plugin"},"content":{"rendered":"<p>Because of the possibility of plugin loading order error, it is best to use the init hook to search for acf existence and adding the options page. i.e:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:php decode:true \">add_action('init', 'add_acf_options_page');\r\nfunction add_acf_options_page() {\r\n    if (function_exists('acf_add_options_page')) {\r\n        acf_add_options_page(array(\r\n            'page_title' \t=&gt; 'Site Settings',\r\n            'menu_title'\t=&gt; 'Site Settings',\r\n            'menu_slug' \t=&gt; 'site-settings',\r\n            'capability'\t=&gt; 'edit_posts',\r\n            'redirect'\t\t=&gt; false,\r\n            'position' =&gt; '6'\r\n        ));\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Because of the possibility of plugin loading order error, it is best to use the init hook to search for acf existence and adding the options page. i.e: &nbsp; add_action(&#8216;init&#8217;, &#8216;add_acf_options_page&#8217;); function add_acf_options_page() { if (function_exists(&#8216;acf_add_options_page&#8217;)) { acf_add_options_page(array( &#8216;page_title&#8217; =&gt; &#8216;Site Settings&#8217;, &#8216;menu_title&#8217; =&gt; &#8216;Site Settings&#8217;, &#8216;menu_slug&#8217; =&gt; &#8216;site-settings&#8217;, &#8216;capability&#8217; =&gt; &#8216;edit_posts&#8217;, &#8216;redirect&#8217; =&gt; false, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-714","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/comments?post=714"}],"version-history":[{"count":1,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/714\/revisions"}],"predecessor-version":[{"id":715,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/714\/revisions\/715"}],"wp:attachment":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/media?parent=714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/categories?post=714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/tags?post=714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}