Skip to content

Instantly share code, notes, and snippets.

@zackkatz
zackkatz / gravityview-prevent-row-striping.php
Created December 17, 2014 05:06
GravityView - Prevent Row Striping: Don't all `alt` class to alternating table rows.
<?php
/**
* Plugin Name: GravityView - Prevent Row Striping
* Plugin URI: https://gravityview.co
* Description: Disable alternate row stripes.
* Version: 1.0
* Author: Katz Web Services, Inc.
* Author URI: https://katz.co
*/
@zackkatz
zackkatz / gv-ratings-reviews-netflix-scale.php
Last active August 29, 2015 14:13
Use the Netflix scale in the GravityView Ratings & Reviews Extension
<?php
/**
* Change the titles displayed when hovering over a star to use the Netflix scale
* @param array $stars Star titles
* @return array Modified titles
*/
function gv_ratings_reviews_use_netflix_scale( $stars ) {
// Make sure to keep the array key numbers intact; they map with the star rating.
@zackkatz
zackkatz / gravityview-enable-custom-css-class-for-widgets.php
Created January 29, 2015 01:02
Enable custom class for GravityView widgets. Requires GravityView 1.5.4 or higher.
<?php
/**
* Enable custom class for GravityView widgets. Requires GravityView 1.5.4 or higher.
*
* @param boolean False by default. Return true if you want to enable.
* @param GravityView_Widget Current instance of GravityView_Widget
*/
add_filter('gravityview/widget/enable_custom_class', '__return_true' );
<?php
/*
* Plugin Name: IDX+ - Insert Ribbon HTML Into Listings
* Description: Print the ribbon HTML inside the listing wrapper for search results
* Version: 1.0
* Author: Katz Web Services, Inc.
* Author URI: http://www.idxplus.net
*/
// Available since IDX+ 2.4
@zackkatz
zackkatz / gravityview-modify-success-message.php
Last active August 29, 2015 14:14
Modify the message shown after successfully editing an entry in GravityView
<?php
/**
* Code example for GravityView ( https://gravityview.co )
*
* Add the following code to the end of your theme's functions.php file.
*
* Make sure it's inside the ?> if ?> is at the end of the file!!!
*
*/
@zackkatz
zackkatz / gravityview-modify-search-mode.php
Created February 3, 2015 19:51
Force searches to match all parameters, not any.
<?php
/**
* Force searches to match all parameters, not any.
*
* @link http://docs.gravityview.co/article/55-how-do-i-modify-the-search-mode
* @param string $mode 'any' or 'all'
*/
function gv_my_modify_search_mode ( $mode ) {
return 'all'; // by default is 'any'
@zackkatz
zackkatz / use-idx_plus_data-filter.php
Last active August 29, 2015 14:14
Use the `idx_plus_data` filter to define another variable.
<?php
// We want to add a new value for %%short_excerpt%%
add_filter( 'idx_plus_data_short_excerpt', 'add_short_excerpt_data_to_idx_plus', 10, 2 );
/**
* Modify the data output
*
* @param mixed $data Data to return
* @param string|null $key Data key, if set
@zackkatz
zackkatz / edd-gf-restore-base-product.php
Created February 9, 2015 18:14
Restore base product links being included in the customer purchase.
<?php
/** Add the line below to your functions.php file after <?php and before ?> */
add_filter('edd_gf_variable_products_include_base', '__return_true');
@zackkatz
zackkatz / gravityview-datatables-translate-script.php
Created February 10, 2015 15:57
Translate the DataTables script in the GravityView DataTables extension
<?php
/**
* Add this code to your theme's functions.php file
*/
add_filter( 'gravityview/datatables/config/language', 'translate_gv_datatables' );
/**
* If you want to translate DataTables, you can use some of the existing translations
*
@zackkatz
zackkatz / idx-plus-larger-gallery-thumbnails.php
Created February 18, 2015 22:39
IDX+ - Use a larger thumbnail size in galleries, good for Retina displays