/**
 * Register ACF Pro options page.
 */
function dorzki_register_options_page() {

	if ( function_exists( 'acf_add_options_page' ) ) {

		acf_add_options_page( [
			'page_title' => __( 'Theme Options', 'dorzki' ),
			'menu_title' => __( 'Theme Options', 'dorzki' ),
			'menu_slug'  => 'dorzki-theme-options',
			'parent'     => 'themes.php',
		] );

	}

}

add_action( 'acf/init', 'dorzki_register_options_page' );

How to use it?

Usually adding functionality to a WordPress site is by creating a plugin.
However you can simply copy the code and paste it in your child theme’s functions.php file at the end of the file, just before ?>.

For JavaScript code you will need to add them to your theme’s main JavaScript file.

Having issues with the code?

If the code doesn’t work or you get an error please let us know in the comments section.
We will do our best to fix it as-soon-as-possible and update the code on this page.

Comments

Leave a Reply