Skip to content

Instantly share code, notes, and snippets.

@jamieschmid
Last active December 21, 2019 16:28
Show Gist options
  • Save jamieschmid/da2991b297e8e6e7be1f338b19eefac1 to your computer and use it in GitHub Desktop.
Save jamieschmid/da2991b297e8e6e7be1f338b19eefac1 to your computer and use it in GitHub Desktop.
WordPress block template function with ACF and Gravity Forms blocks
/**
* Adds block template to single custom post type Careers posts.
*/
function careers_block_template() {
$post_type_object = get_post_type_object( 'careers' );
$post_type_object->template = array(
array( 'acf/job-location' ),
array( 'acf/job-description' ),
array( 'acf/job-role' ),
array( 'gravityforms/form' ),
);
}
add_action( 'init', 'careers_block_template' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment