acf_set_options_page_capability()

Overview

This function is outdated. Please use the acf/options_page/settings filter instead.

This function is used in combination with the Options Page Add-on to change the capability of the main options page title. This function is to be used inside your functions.php file and must be run before the ‘init’ action.

The term ‘capability’ refers to the user roles and permissions that grant access to the options page. You can learn more about capability settings here

Warning: During the updating process, this function will not be available to your functions.php file. To ensure your website does not break, you MUST wrap the function in an if function_exists statement. Please see below for code examples.

Requirements

Parameters

<?php acf_set_options_page_capability( $capability ); ?>
  • $capability: {string} (required) the name for the parent Options Page menu capability. Defaults to ‘edit_posts’

Usage

<?php 

/*
*  Change the Options Page capability to 'manage_options'
*/

if( function_exists('acf_set_options_page_capability') )
{
    acf_set_options_page_capability( 'manage_options' );
}
?>

Related