Skip to content

Instantly share code, notes, and snippets.

@zackkatz
zackkatz / gv-calendar-remove-time-display.php
Last active May 24, 2020 — forked from rafaehlers/gv_calendar_remove_time_display.php
Gravity Forms Calendar - Prevent time from being displayed in the calendar
View gv-calendar-remove-time-display.php
<?php // DO NOT COPY THIS LINE
/**
* Remove the time from being displayed on a GravityView calendar
*
* @see https://docs.gravityview.co/category/647-calendar
*
* @param array $calendar_options Array of FullCalendar options
*
* @return mixed
@zackkatz
zackkatz / maps-coordinates.php
Last active Mar 28, 2020 — forked from rafaehlers/maps-coordinates.php
Use the cordinates (Latitude and Longitude) instead of the address to position the markers over the Maps
View maps-coordinates.php
<?php
/**
* Use the coordinates (Latitude, Longitude) instead of the address to position the markers over the Maps
*
* Replace 'MY_LATITUDE_FIELD_ID', 'MY_LONGITUDE_FIELD_ID' with field ids containing the latitude and longitude values
*
* @param array $fields_array Gravity Forms fields IDs containing the latitude and longitude
* @param GravityView_View $gravityview_view Current View object
*
* @return array Array with field IDs of latitude and longitude fields (Example: [ 5, 6 ] ). Empty array if not the form we want to override.
@zackkatz
zackkatz / gv-change-back-link.php
Last active Jun 11, 2018 — forked from rafaehlers/gv-change-back-link.php
GravityView - Change the back link URL for a specific View ID
View gv-change-back-link.php
@zackkatz
zackkatz / gv_age.php
Last active May 21, 2018 — forked from rafaehlers/gv_age.php
GravityView - Calculate a person's age based on a date field
View gv_age.php
<?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>
@zackkatz
zackkatz / add-gf-to-admin-dashboard.php
Last active May 2, 2018 — forked from lukecav/functions.php
Add Gravity Forms to the Wordpress Dashboard as a Widget
View add-gf-to-admin-dashboard.php
<?php
add_action( 'wp_dashboard_setup', 'add_gf_to_dashboard_setup' );
function add_gf_to_dashboard_setup() {
wp_add_dashboard_widget( 'wp_gf_dashboard', 'My Gravity Form', 'add_gf_to_dashboard' );
}
function add_gf_to_dashboard() {
View gv-checkbox-bug-filter.php
<?php
add_filter( 'gravityview_entries', function( $entries, $criteria, $passed_criteria, &$total ) {
$view_id = GravityView_frontend::getInstance()->get_context_view_id();
if ( $view_id != 97 /** Augmented View ID here */ ) {
return $entries;
}
$_subtract = $criteria;
View gv-checkbox-bug-filter.php
<?php
add_filter( 'gravityview_entries', function( $entries, $criteria, $passed_criteria, &$total ) {
$view_id = GravityView_frontend::getInstance()->get_context_view_id();
if ( $view_id != 97 /** Augmented View ID here */ ) {
return $entries;
}
$_subtract = $criteria;
View gv_modify_notes_email_content.php
<?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
View gv_modify_notes_email_content.php
<?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 Jan 27, 2017 — forked from Jeradin/pagination for GravityView
Entry Next / Prev pagination for GravityView (NOT PRODUCTION READY)
View gravityview-pagination.php
<?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.