Skip to content

Instantly share code, notes, and snippets.

/**
* Replace the link text with a PDF image.
*
* Only for an anchor link to a PDF file in field output.
*
* Place this code (after <?php) at the bottom of your theme's functions.php file to enable it.
*
* @param string $html Existing HTML output
* @param array $args Arguments passed to the function
*/
<?php
/*
Plugin Name: Gravity Forms MailChimp Custom Export
Plugin URI: http://gravityview.co/
Description: Custom plugin to force updated entries to be exported with the GF MailChimp add-on
Author: Katz Web Services, Inc.
Version: 1.1.0
Author URI: http://www.katzwebservices.com
Copyright 2014 Katz Web Services, Inc. (email: info@katzwebservices.com)
@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
<?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
*/
<?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
@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 ) {
@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 / 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.