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_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
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 | |
add_action( 'wpseo_opengraph', 'my_gv_wpseo_opengraph_image', 10, 1); | |
function my_gv_wpseo_opengraph_image( $img ) { | |
if( ! function_exists('gravityview_is_single_entry') || ! function_exists( 'gravityview_get_entry') ) { | |
return $img; | |
} | |
// get single entry id | |
$entry_id = gravityview_is_single_entry(); | |
if( empty( $entry_id ) ) { | |
return $img; |
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 | |
/** The defaults below are just for reference to use with the filter: | |
$defaults = array( | |
'fields' => $fields, | |
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Review', 'noun', 'gravityview-ratings-reviews' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', | |
// This filter is documented in wp-includes/link-template.php | |
'must_log_in' => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.', 'gravityview-ratings-reviews' ), wp_login_url( $permalink ) ) . '</p>', | |
// This filter is documented in wp-includes/link-template.php | |
'logged_in_as' => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'gravityview-ratings-reviews' ), get_edit_user_link(), $user_identity, wp_logout_url( $permalink ) ) . '</p>', | |
'comment_notes_befo |
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
<?php | |
add_shortcode( 'gv_tag', 'gv_tag_shortcode' ); | |
function gv_tag_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'field' => '', | |
), $atts ) | |
); | |
$links = ""; |
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( 'gform_merge_tag_filter', function ( $value, $merge_tag, $modifier, $field, $raw_value ) { | |
if( 'all_fields' !== $merge_tag && 'maxwords2' === $modifier ) { | |
/* Number of words to display */ | |
$max = 4; | |
$more_placeholder = '…'; | |
/** |
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 // remove this whole line when copying this code to your theme's function.php file | |
add_shortcode( 'gvgravatar', 'gv_gravatar_shortcode' ); | |
function gv_gravatar_shortcode( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'email' => '', | |
), $atts ) | |
); | |
$md5 = md5($email); | |
$image = '<img src="https://secure.gravatar.com/avatar/'.$md5.'?s=55">'; |
OlderNewer