This new update for the Options Page Add-on allows for more control over sub page permissions and positions!
Firstly, I would like to give a big thank you to Edir Pedro (http://edirpedro.com.br) for his contribution to this version. Edir has offered his time to develop, share and test this new version with me, and for that I am extremely grateful.
The main feature is the ability to customize a sub page’s parent value. This means you can position a sub page under the ‘General Options’ or perhaps even a ‘Custom Post type’ menu item!
Here’s what’s new:
Version 1.1.0 adds 3 new functions to allow for easier customization to the Options Page Add-on. Previously in ACF v3, this Add-on offered similar functions, however, they were then stripped out during the ACF v4.0.0 release. I hope you enjoy them being back at your disposal!
/*
* acf_add_options_sub_page
*
* this function is used to add a sub page to the options page menu
*
* @type function
* @date 13/07/13
*
* @param {mixed} $page either a string for the sub page title, or an array with more information.
* The array can contain the following args:
* + {string} title - required
* + {string} slug - not required
* + {string} parent - not required
* + {string} capability - not required
* @return N/A
*/
acf_add_options_sub_page( 'footer' );
// or
acf_add_options_sub_page(array(
'title' => 'footer',
'parent' => 'options-general.php',
'capability' => 'manage_options'
));
/*
* acf_set_options_page_title
*
* this function is used to customize the options page admin menu title
*
* @type function
* @date 13/07/13
*
* @param {string} $title
* @return N/A
*/
acf_set_options_page_title( __('Theme Options') );
/*
* acf_set_options_page_capability
*
* this function is used to customize the options page capability. Defaults to 'edit_posts'
* Read more: http://codex.wordpress.org/Roles_and_Capabilities
*
* @type function
* @date 13/07/13
*
* @param {string} $capability
* @return N/A
*/
acf_set_options_page_capability( 'manage_options' );
This release also includes an updated ‘updater’. The new updater can be removed from the folder when distributing the Add-on within a premium theme / plugin. This will not cause any errors in the Add-on, but will prevent it from receiving updates.
I believe this is a good solution to the current ‘will there be a Developer License’? questions. The answer is No, there will be no developer license, but you must remove the updater from the add-on if you choose to distribute an ACF add-on. This will then prevent the Add-on from updating on the customer’s website.
That’s it for now. I hope you enjoy the new update!
Cheers Elliot
Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.
Elliot is a web developer working "down under" in Australia, and is the founder of the Advanced Custom Fields WordPress plugin. Having a previous life in design, Elliot is passionate about all things interactive. Enjoys skateboarding, coffee and building things.
View other posts by Elliot Condon
For plugin support, please contact our support team directly, as comments aren't actively monitored.
Sign up for the latest Advanced Custom Fields news, updates, and developer tutorials
Build smarter, faster, better with ACF®
© 2024 WPEngine, Inc. All rights reserved.
1WP Engine is a proud member and supporter of the community of WordPress® users. The WordPress® trademarks are the intellectual property of the WordPress Foundation, and the Woo® and WooCommerce® trademarks are the intellectual property of WooCommerce, Inc. Uses of the WordPress®, Woo®, and WooCommerce® names in this website are for identification purposes only and do not imply an endorsement by WordPress Foundation or WooCommerce, Inc. WP Engine is not endorsed or owned by, or affiliated with, the WordPress Foundation or WooCommerce, Inc.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.