Last active
December 21, 2019 16:28
-
-
Save jamieschmid/da2991b297e8e6e7be1f338b19eefac1 to your computer and use it in GitHub Desktop.
WordPress block template function with ACF and Gravity Forms blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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