Last active
November 27, 2020 21:30
-
-
Save anythinggraphic/6106f321a6c1e92b5fe7 to your computer and use it in GitHub Desktop.
Revisions
-
anythinggraphic revised this gist
May 12, 2017 . 2 changed files with 14 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ <?php //* OPTIONAL STEP - Keep the form disappearing. //* Gravity Forms notification popup instead of the page redirect or AJAX notification. //* Props to @WilliamAlexander in the comments //* @link https://anythinggraphic.net/gravity-forms-notification-popup add_filter( 'gform_confirmation', 'ag_custom_confirmation', 10, 4 ); function ag_custom_confirmation( $confirmation, $form, $entry, $ajax ) { add_filter( 'wp_footer', 'ag_overlay'); $thisform = $form['id']; return '[gravityform id=' . $thisform . ' title=false description=false]' . $confirmation . '<a href="#" rel="nofollow">OK</a>'; } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,8 @@ display: block; float: left; height: 100%; position: fixed; top: 0; left: 0; width: 100%; z-index: 99; } -
anythinggraphic revised this gist
Aug 3, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <?php //* Gravity Forms notification popup instead of the page redirect or AJAX notification //* @link https://anythinggraphic.net/gravity-forms-notification-popup /* Override the default Gravity Forms confirmation behavior, displaying it in a popup. Remember to style the divs. ----------------------------------------------------------------------------------------*/ -
anythinggraphic revised this gist
Aug 3, 2015 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ #overlay { background: #000; background: rgba(0, 0, 0, 0.3); display: block; float: left; height: 100%; left: 0; position: fixed; top: 0; width: 100%; z-index: 99; } #gform-notification { -
anythinggraphic revised this gist
Aug 1, 2015 . 1 changed file with 32 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #overlay { background: #000; background: rgba(0, 0, 0, 0.3); display: block; float: left; height: 100%; left: 0; position: fixed; top: 0; width: 100%; z-index: 99; } #gform-notification { background: #fff; border-radius: 10px; display: block; margin: auto; max-height: 237px; max-width: 520px; padding: 61px; position: absolute; top: 0; left: 0; right: 0; bottom: 0; text-align: center; width: 100%; z-index: 101; } #gform-notification .button { margin: 20px 0 0; padding: 12px 24px; } -
anythinggraphic created this gist
Aug 1, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ <?php //* Gravity Forms notification pop-up instead of the page redirect or AJAX notification //* @link https://anythinggraphic.net/gravity-forms-notification-pop-up /* Override the default Gravity Forms confirmation behavior, displaying it in a popup. Remember to style the divs. ----------------------------------------------------------------------------------------*/ add_filter( 'gform_confirmation', 'ag_custom_confirmation', 10, 4 ); function ag_custom_confirmation( $confirmation, $form, $entry, $ajax ) { add_filter( 'genesis_after_footer', 'ag_overlay'); return '<div id="gform-notification">' . $confirmation . '<a class="button" href="#">OK</a></div>'; } /* Add script to remove the overlay and confirmation message once the button in the popup is clicked. ----------------------------------------------------------------------------------------*/ function ag_overlay() { echo '<div id="overlay"></div>'; echo ' <script type="text/javascript"> jQuery("body").addClass("message-sent"); jQuery("#gform-notification a").click(function() { jQuery("#overlay,#gform-notification").fadeOut("normal", function() { $(this).remove(); }); }); </script> '; }