Adds an "options" page for a Custom Post Type and ACF

01/30/2024
Back to Blogs
<?php
/**
 * Add Options Page for Custom Post Type and ACF
 *
 * Adds an "options" page for a custom post type and Advanced Custom Fields (ACF).
 * It allows you to define custom options specific to the post type.
 *
 * Gist Keywords: wordpress, acf, cpt, custom post type, options
 * Author: Knol Aust
 */
if (function_exists('acf_add_options_page')) {
    acf_add_options_sub_page(
        array(
            'page_title' => 'Page Title',
            'menu_title' => 'Menu Title',
            'parent_slug' => 'edit.php?post_type=your_cpt_here',
        )
    );
}
?>