Skip to content

Instantly share code, notes, and snippets.

@robincornett
Created March 14, 2017 18:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robincornett/02fe22a79ccda87902283b09c0bd8b7e to your computer and use it in GitHub Desktop.
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.
<?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