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
add_filter( 'gravityview/edit_entry/success', 'gv_edit_entry_success', 10, 4 ); | |
function gv_edit_entry_success( $entry_updated_message , $view_id, $entry, $back_link ) { | |
$message = 'Product Updated. <a href="'.$back_link .'">Return to product's details page.</a>'; | |
return $message; | |
} |
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
add_filter( 'gravityview/field/notes/email_content', 'gv_modify_notes_email_content', 10, 4 ); | |
function gv_modify_notes_email_content( $email_settings ) { | |
extract( $email_settings ); | |
$email_settings['message'] = '<h2>'.$message.'</h2>'; | |
return $email_settings; | |
} |
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 | |
add_filter( 'gravityview/field/notes/email_content', 'gv_modify_notes_email_content', 10, 4 ); | |
function gv_modify_notes_email_content( $email_settings ) { | |
extract( $email_settings ); | |
$email_settings['from'] = $from; //[email protected] | |
$email_settings['to'] = $to; //[email protected] | |
$email_settings['bcc'] $bcc; //[email protected] | |
$email_settings['reply_to'] = $reply_to; //[email protected] | |
$email_settings['subject'] = $subject; //subject of the email | |
$email_settings['message'] = $message; //body of the email (already in HTML format) |
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
add_filter( 'gravityview_map_link', 'gv_change_map_it', 10, 5 ); | |
function gv_change_map_it( $link, $address, $url ){ | |
$link = str_replace('Map It','View on Google Maps',$link); | |
return $link; | |
} |
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 | |
add_shortcode( 'gv_age', 'gv_calculate_age' ); | |
/** | |
* Calculate age in years based on entry data | |
* | |
* Usage inside a Custom Content field (Replace "2" with the ID of the date field): | |
* | |
* <code> |
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 | |
add_shortcode( 'gv_days', 'gv_calculate_days' ); | |
function gv_calculate_days( $atts ) { | |
global $gravityview_view; | |
extract($gravityview_view->field_data); // create a $entry variable with current entry data array | |
extract( shortcode_atts( | |
array( | |
'start_date_id' => '', | |
'end_date_id' => '', |
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
add_shortcode( 'gv_wordstrip', 'gv_wordstrip' ); | |
function gv_wordstrip( $atts ) { | |
global $gravityview_view; | |
extract($gravityview_view->field_data); // create a $entry variable with current entry data array | |
extract( shortcode_atts( | |
array( | |
'field_id' => '', | |
), $atts ) | |
); |
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 | |
add_action( 'gravityview/edit_entry/after_update', 'gravityview_redirect_after_update', 10, 2 ); | |
function gravityview_redirect_after_update( $form, $entry_id ) { | |
// Get the current View ID | |
$view_id = GravityView_View::getInstance()->getViewId(); | |
// Replace the 105 below to your specific View ID, otherwise, without this check all your Views will be affected | |
if($view_id == 105){?> | |
<script> | |
jQuery(document).ready( function() { | |
window.location.replace( "http://your-new-URL-here/" ); |
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 | |
/** | |
* Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps | |
* Replace 'MY_LATITUDE_FIELD_ID' and 'MY_LONGITUDE_FIELD_ID' by the form field ids containing the latitude and longitude | |
* @param array $fields Gravity Forms fields IDs containing the latitude and longitude | |
* @param GravityView_View object $view Current View object | |
*/ | |
function my_gv_maps_lat_long_fields( $fields, $view ) { | |
return array( 'MY_LATITUDE_FIELD_ID', 'MY_LONGITUDE_FIELD_ID' ); | |
} |
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 | |
add_action( 'gravityview/edit_entry/after_update', 'gravityview_redirect_after_update', 10, 2 ); | |
function gravityview_redirect_after_update( $form, $entry_id ) { | |
// Get the current View ID | |
$view_id = GravityView_View::getInstance()->getViewId(); | |
if ( $view_id == 105 ) {?> | |
<script> | |
jQuery(document).ready( function() { | |
window.location.replace( "http://localhost/gravity/" ); | |
}); |
OlderNewer