-
-
Save robincornett/02fe22a79ccda87902283b09c0bd8b7e to your computer and use it in GitHub Desktop.
Add the Gravity Forms button to the new editor in Genesis archive settings for custom content types and terms.
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
<?php | |
// Parse shortcodes on custom content type archives and term archives. | |
add_filter( 'genesis_cpt_archive_intro_text_output', 'do_shortcode', 20 ); | |
add_filter( 'genesis_term_intro_text_output', 'do_shortcode', 20 ); | |
add_filter( 'gform_display_add_form_button', 'prefix_add_form_button' ); | |
/** | |
* Tell Gravity Forms to add the "Add Form" button to custom content archive | |
* settings and term settings pages. | |
* | |
* @param $is_post_edit_page | |
* | |
* @return bool | |
*/ | |
function prefix_add_form_button( $is_post_edit_page ) { | |
if ( in_array( RG_CURRENT_PAGE, array( 'edit.php', 'term.php' ), true ) ) { | |
$is_post_edit_page = true; | |
} | |
return $is_post_edit_page; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment