This file contains hidden or 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( 'gravityview_datatables_js_options', 'gv_dt_prevent_state_save', 10, 3 ); | |
| /** | |
| * Prevent DataTables from saving state between page loads. | |
| * @param array $dt_config DataTables options | |
| * @param int $view_id View ID | |
| * @param WP_Post $post Current WordPress post object |
This file contains hidden or 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 | |
| // Shortcode for Site URL - Use [site_url] for Shortcode | |
| add_action( 'init', function() { | |
| add_shortcode( 'site_url', function( $atts = null, $content = null ) { | |
| return site_url(); | |
| } ); | |
| } ); |
This file contains hidden or 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 | |
| /** | |
| * Disable lazy loading for images in GravityView (added in 2.14.3). | |
| * | |
| * @param string|bool $value The `loading` attribute value. Returning a falsey value will result in | |
| * the attribute being omitted for the image. | |
| * @param string $image The HTML `img` tag to be filtered. | |
| * @param string $context Additional context about how the function was called or where the img tag is. | |
| */ |
This file contains hidden or 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 | |
| /** | |
| * Disables the "Show Label" setting by default for new Views. | |
| * | |
| * @return array $field_options Original array with `show_label` disabled. | |
| */ | |
| add_filter( 'gravityview_template_field_options', function( $field_options = array() ) { | |
| $field_options['show_label'] = false; |
This file contains hidden or 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 | |
| /** | |
| * Override the default query collation for the letter comparison (Requires GravityView A-Z Filters version 1.3 or newer). | |
| * @param null|string $collation_override The collation override for the query. | |
| * @param string $query The MySQL query passed to the database. | |
| * @return string | |
| */ | |
| add_filter( 'gravityview/az_filter/collation', function ( $collation = null ) { | |
| return 'utf8mb4_bin'; |
This file contains hidden or 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
| jQuery( 'body' ).on( 'gravityview/tab-ready', function ( ui, panel ) { | |
| // This will print the jQuery DOM element of the newly-activated tab | |
| console.log( panel ); | |
| }); |
This file contains hidden or 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 | |
| /** | |
| * Modify the text for the default option in a select (multi or single dropdown) | |
| * | |
| * @param string $default_option Default: `—` (—) | |
| * @param string $field_type Field type: "select" or "multiselect" | |
| * | |
| * @return string | |
| */ |
This file contains hidden or 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 | |
| /** | |
| * Change the start day to something other than the WordPress settings. | |
| * | |
| * The value must be a number that represents the day of the week. | |
| * Sunday=0, Monday=1, Tuesday=2, etc. | |
| * | |
| * @param array $calendar_options Calendar options | |
| * @param int $form_id Form ID |
This file contains hidden or 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 | |
| /** | |
| * Change the start day to something other than the WordPress settings. | |
| * | |
| * The value must be a number that represents the day of the week. | |
| * Sunday=0, Monday=1, Tuesday=2, etc. | |
| * | |
| * @param array $calendar_options Calendar options | |
| * @param int $form_id Form ID |
This file contains hidden or 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 | |
| /** | |
| * Reset all Gravity Flow workflow statuses for a duplicated entry after duplicating in GravityView. | |
| * | |
| * @param array $duplicated_entry The duplicated entry | |
| */ | |
| add_action( 'gravityview/duplicate-entry/duplicated', function( $duplicated_entry ) { | |
| if ( ! class_exists( 'Gravity_Flow_API' ) ) { |