Skip to content

Instantly share code, notes, and snippets.

@cameronjonesweb
Last active October 15, 2020 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cameronjonesweb/8f270951dbf71a288965599299acc8f8 to your computer and use it in GitHub Desktop.
Save cameronjonesweb/8f270951dbf71a288965599299acc8f8 to your computer and use it in GitHub Desktop.
<?php
function cameronjonesweb_acf_setup() {
acf_add_options_page(
array(
'page_title' => 'Theme Settings',
'menu_slug' => 'cameronjonesweb-theme-settings',
)
);
acf_add_local_field_group(
array(
'key' => 'group_cameronjonesweb_theme_settings',
'title' => 'Theme Settings',
'fields' => array(
array(
'key' => 'field_cameronjonesweb_default_image',
'label' => 'Default Featured Image',
'name' => 'default_featured_image',
'type' => 'image',
),
),
'location' => array (
array (
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'cameronjonesweb-theme-settings',
),
),
),
)
);
}
add_action( 'acf/init', 'cameronjonesweb_acf_setup' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment