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 | |
| function gravityview_datatables_change_messages( $dt_config, $view_id, $post ) { | |
| $dt_config['language']['processing'] = 'Wait!'; | |
| //$dt_config['language']['emptyTable'] = 'No entries here!'; | |
| return $dt_config; | |
| } | |
| add_filter( 'gravityview_datatables_js_options', 'gravityview_datatables_change_messages', 10, 3 ); |
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 // Make sure to remove this line before pasting it on your theme's functions.php | |
| add_filter( 'gravityview/entry_notes/get_notes', 'gv_modify_notes', 10, 2 ); | |
| function gv_modify_notes( $notes, $entry_id ) { | |
| foreach($notes as $key => $note){ | |
| if (strpos( $note->value, 'Approved') !== false){ | |
| $note->value = "Aprovada!"; | |
| } | |
| if (strpos( $note->value, 'Unapproved') !== false){ | |
| $note->value = "Não Aprovada!"; |
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 | |
| /** | |
| * Gravity Perks // GP Unique ID // Copy ID to Another Field | |
| * http://gravitywiz.com | |
| */ | |
| // change the "999" to your form ID | |
| add_filter( 'gform_entry_post_save_999', function( $entry ) { | |
| // update "1" to your Unique ID field's field ID | |
| $uid_field_id = 1; |
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 | |
| $entries_url = 'http://gv2.dev.codeseekah.com/wp-json/gravityview/v1/views/1696/entries.json'; | |
| $nonce = wp_create_nonce( 'wp_rest' ); | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery.ajax( { | |
| url: <?php echo json_encode( $entries_url ); ?>, | |
| method: 'GET', | |
| beforeSend: function ( xhr ) { | |
| xhr.setRequestHeader( 'X-WP-Nonce', <?php echo json_encode( $nonce ); ?> ); |
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 // DO NOT COPY THIS LINE | |
| add_filter( 'comment_form_field_gv_review_title', '__return_empty_string' ); | |
| add_filter( 'gv_ratings_reviews_review_form_settings', 'gv_modify_review_form_labels',10,1); | |
| function gv_modify_review_form_labels($defaults){ | |
| $defaults['author'] = ''; | |
| $defaults['email'] = ''; |
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 | |
| //usage [gv_listify field="{Field Merge Tag}"] | |
| add_shortcode( 'gv_listify', 'gv_listify_shortcode' ); | |
| function gv_listify_shortcode( $atts ) { | |
| extract( shortcode_atts( | |
| array( | |
| 'field' => '', | |
| ), $atts ) | |
| ); |
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 | |
| function gv_change_edit_entry_title( $previous_text = 'Edit Entry' ) { | |
| $view_id = GravityView_View::getInstance()->getViewId(); | |
| if($view_id == 105){ | |
| return 'Edit Profile'; | |
| } | |
| if( ($view_id == 106) || ($view_id == 107)){ | |
| return 'Edit Entry'; | |
| } | |
| } |
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_action('gform_after_update_entry_115', 'gv_change_entry_creator', 10, 2); | |
| function gv_change_entry_creator( $form, $entry_id ){ | |
| $entry = GFAPI::get_entry($entry_id); | |
| $new_entry_creator = $entry[1]; // field ID where the dropdown with usernames are (this will be the new entry creator) | |
| GFAPI::update_entry_property( $entry_id, 'created_by', $new_entry_creator ); | |
| } |
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 | |
| /** | |
| * Remove wpautop() when Gravity Forms is in the field content | |
| */ | |
| add_filter( 'gravityview/field_output/args', function( $args, $passed_args, $context = null ) { | |
| if( $context && $context instanceof \GV\Template_Context ) { | |
| $content = \GV\Utils::get( $args, 'value', '' ); | |
| if( has_shortcode( $content, 'gravityform') ) { |
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_action('gravityview/approve_entries/disapproved','gv_send_form_notification_approval'); | |
| add_action('gravityview/approve_entries/approved','gv_send_form_notification_approval'); | |
| function gv_send_form_notification_approval($entry_id){ | |
| $entry = GFAPI::get_entry( $entry_id ); | |
| if( ! $entry || is_wp_error( $entry ) ) { | |
| return; | |
| } | |
| $form = GFAPI::get_form( $entry['form_id'] ); | |
| if( ! $form || is_wp_error( $form ) ) { |