14 Jul

Options Page Add-on v1.1.0 released

By Elliot Condon

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:

  • Added function acf_add_options_sub_page()
  • Added function acf_set_options_page_title()
  • Added function acf_set_options_page_capability()
  • Improved sub page functionality to allow for individual title, capability, parent and slug. This allows you to place the sub page onto any parent page in the wp-admin menu!
  • Added lang folder including .pot file
  • Added Portuguese language – Thanks to Edir Pedro (http://edirpedro.com.br)

New functions

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()

/*
*  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()

/*
*  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()

/*
*  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' );

New uploader

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.

Wrapping up

That’s it for now. I hope you enjoy the new update!

Cheers
Elliot

About the Author