Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter( 'gravityview/field/notes/email_content', 'gv_modify_notes_email_content', 10, 4 );
/**
* Modify the values passed when sending a note email
* @see GVCommon::send_email
* @since 1.17
* @param array $email_settings Values being passed to the GVCommon::send_email() method: 'from', 'to', 'bcc', 'reply_to', 'subject', 'message', 'from_name', 'message_format', 'entry', 'email_footer'
*
* @return array $email_settings
@zackkatz
zackkatz / gv_modify_notes_email_content.php
Last active March 29, 2018 04:13 — forked from rafaehlers/gv_modify_notes_email_content.php
Modify the body content of a note
<?php
add_action( 'plugins_loaded', function() {
add_filter( 'gravityview/field/notes/email_content', 'gv_modify_notes_email_content', 10, 4 );
}, 20 );
/**
* Modify the email content
*
* @param array $email_settings
@zackkatz
zackkatz / gravityview-pagination.php
Last active January 27, 2017 19:05 — forked from Jeradin/pagination for GravityView
Entry Next / Prev pagination for GravityView (NOT PRODUCTION READY)
<?php
/**
* Get single entry pagination links
* to use: echo gravityview_entry_pagination();
*/
/**
* NOT FINAL CODE. Use at your own risk! This will be incorporated soon into core.
*
* This will use GravityView filters to generate the entry links.
@zackkatz
zackkatz / gravityview-calculations-in-custom-content-field.php
Last active May 17, 2018 22:30 — forked from luistinygod/gist:7594392d3a474cf93df0
GravityView: Show the result of a calculation using a Custom Content field
<?php
/**
* Referenced in this article: http://docs.gravityview.co/article/235-how-to-make-calculations-using-the-custom-content-field
*/
/** Modify the content returned from the Custom Content field */
add_filter( 'gravityview/fields/custom/content_before', 'my_gv_custom_content_before', 10, 2 );
/**
* Replaces the %CALC% placeholder by the result of a calc operation between entries' fields
@zackkatz
zackkatz / gv-success-update-message.php
Created November 10, 2015 00:54 — forked from luistinygod/gv-success-update-message.php
GravityView: Change the Update Entry success message
<?php
/**
* Change the update entry success message, including the link
*
* @param $message string The message itself
* @param $view_id int View ID
* @param $entry array The Gravity Forms entry object
* @param $back_link string Url to return to the original entry
*/
function gv_my_update_message( $message, $view_id, $entry, $back_link ) {
<?php
/**
* Disable the State Saving on your DataTables view
* @link https://datatables.net/reference/option/stateSave
*/
add_filter( 'gravityview_datatables_js_options', 'my_gv_state_save', 20, 2 );
/**
* @param array $config Holds the DataTables table configuration
* @param string $view_id The current view id
<?php
/*
* Supported on GravityView 1.6
*
* Add this to your theme's functions.php file
*
* Replace the string 'MY NEW LABEL' for your own
*/
<?php
/**
* Place this in your theme's functions.php
* Please adapt the form_id and the field key to your own case.
* This is intended to force GravityView to search for the exact value instead of be more relaxed (default search uses operator LIKE)
*
*/
add_filter( 'gravityview_fe_search_criteria', 'my_gv_exact_search', 20, 2 );
<?php
/*
* Supported on GravityView 1.6
*
* Add this to your theme's functions.php file
*
* Replace the string 'MY NEW LABEL' for your own
*/
@zackkatz
zackkatz / gravityview-modify-custom-content.php
Last active May 17, 2018 19:05 — forked from luistinygod/gist:9dce30ca1fd146dd31bc
GravityView - Modify the content returned from the Custom Content field
<?php
/** Modify the content returned from the Custom Content field */
add_filter( 'gravityview/fields/custom/content_before', 'my_gv_custom_content_before', 10, 2 );
/**
* Removes the custom content field's content in case a certain entry field is empty
* Replace the MY_FIELD_ID by the field id (check it on the Gravity Forms form definition)
*
* @param string $content Custom Content field content
* @param \GV\Template_Context $context