@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package GravityView |
|
| 4 | - * @subpackage Gravityview/admin/metaboxes/partials |
|
| 5 | - * @global WP_Post $post |
|
| 6 | - */ |
|
| 3 | + * @package GravityView |
|
| 4 | + * @subpackage Gravityview/admin/metaboxes/partials |
|
| 5 | + * @global WP_Post $post |
|
| 6 | + */ |
|
| 7 | 7 | global $post; |
| 8 | 8 | |
| 9 | 9 | $curr_form = gravityview_get_form_id( $post->ID ); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package GravityView |
|
| 4 | - * @subpackage Gravityview/admin/metaboxes/views |
|
| 5 | - * @global $post |
|
| 6 | - */ |
|
| 3 | + * @package GravityView |
|
| 4 | + * @subpackage Gravityview/admin/metaboxes/views |
|
| 5 | + * @global $post |
|
| 6 | + */ |
|
| 7 | 7 | global $post; |
| 8 | 8 | |
| 9 | 9 | $curr_form = gravityview_get_form_id( $post->ID ); |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Adds a button to add the View shortcode into the post content |
|
| 4 | - * |
|
| 5 | - * @package GravityView |
|
| 6 | - * @license GPL2+ |
|
| 7 | - * @author Katz Web Services, Inc. |
|
| 8 | - * @link http://gravityview.co |
|
| 9 | - * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | - * |
|
| 11 | - * @since 1.0.0 |
|
| 12 | - */ |
|
| 3 | + * Adds a button to add the View shortcode into the post content |
|
| 4 | + * |
|
| 5 | + * @package GravityView |
|
| 6 | + * @license GPL2+ |
|
| 7 | + * @author Katz Web Services, Inc. |
|
| 8 | + * @link http://gravityview.co |
|
| 9 | + * @copyright Copyright 2014, Katz Web Services, Inc. |
|
| 10 | + * |
|
| 11 | + * @since 1.0.0 |
|
| 12 | + */ |
|
| 13 | 13 | |
| 14 | 14 | /** If this file is called directly, abort. */ |
| 15 | 15 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | if( class_exists( 'GravityView_Entry_Notes' ) ){ |
| 323 | 323 | global $current_user; |
| 324 | - get_currentuserinfo(); |
|
| 324 | + get_currentuserinfo(); |
|
| 325 | 325 | GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $current_user->display_name, $note ); |
| 326 | 326 | } |
| 327 | 327 | |
@@ -356,12 +356,12 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $approvedcolumn = self::get_approved_column( $form['id'] ); |
| 358 | 358 | |
| 359 | - /** |
|
| 360 | - * If the form doesn't contain the approve field, don't assume anything. |
|
| 361 | - */ |
|
| 362 | - if( empty( $approvedcolumn ) ) { |
|
| 363 | - return; |
|
| 364 | - } |
|
| 359 | + /** |
|
| 360 | + * If the form doesn't contain the approve field, don't assume anything. |
|
| 361 | + */ |
|
| 362 | + if( empty( $approvedcolumn ) ) { |
|
| 363 | + return; |
|
| 364 | + } |
|
| 365 | 365 | |
| 366 | 366 | $entry = GFAPI::get_entry( $entry_id ); |
| 367 | 367 | |
@@ -474,17 +474,17 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | static public function get_approved_column( $form ) { |
| 476 | 476 | |
| 477 | - if( empty( $form ) ) { |
|
| 478 | - return null; |
|
| 479 | - } |
|
| 477 | + if( empty( $form ) ) { |
|
| 478 | + return null; |
|
| 479 | + } |
|
| 480 | 480 | |
| 481 | - if( !is_array( $form ) ) { |
|
| 482 | - $form = GVCommon::get_form( $form ); |
|
| 483 | - } |
|
| 481 | + if( !is_array( $form ) ) { |
|
| 482 | + $form = GVCommon::get_form( $form ); |
|
| 483 | + } |
|
| 484 | 484 | |
| 485 | 485 | foreach( $form['fields'] as $key => $field ) { |
| 486 | 486 | |
| 487 | - $field = (array) $field; |
|
| 487 | + $field = (array) $field; |
|
| 488 | 488 | |
| 489 | 489 | if( !empty( $field['gravityview_approved'] ) ) { |
| 490 | 490 | if( !empty($field['inputs'][0]['id']) ) { |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | } |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | - // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
| 496 | - if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
| 497 | - foreach ( $field['inputs'] as $key2 => $input ) { |
|
| 498 | - if ( strtolower( $input['label'] ) == 'approved' ) { |
|
| 499 | - return $input['id']; |
|
| 500 | - } |
|
| 501 | - } |
|
| 502 | - } |
|
| 495 | + // Note: This is just for backward compatibility from GF Directory plugin and old GV versions - when using i18n it may not work.. |
|
| 496 | + if( 'checkbox' == $field['type'] && isset( $field['inputs'] ) && is_array( $field['inputs'] ) ) { |
|
| 497 | + foreach ( $field['inputs'] as $key2 => $input ) { |
|
| 498 | + if ( strtolower( $input['label'] ) == 'approved' ) { |
|
| 499 | + return $input['id']; |
|
| 500 | + } |
|
| 501 | + } |
|
| 502 | + } |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | return null; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * Start using GravityView_Render_Settings::render_setting_row |
| 111 | 111 | */ |
| 112 | 112 | public static function render_setting_row( $key = '', $current_settings = array(), $override_input = null, $name = 'template_settings[%s]', $id = 'gravityview_se_%s' ) { |
| 113 | - _deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' ); |
|
| 113 | + _deprecated_function( 'GravityView_Admin_Views::render_setting_row', '1.1.7', 'GravityView_Render_Settings::render_setting_row' ); |
|
| 114 | 114 | GravityView_Render_Settings::render_setting_row( $key, $current_settings, $override_input, $name , $id ); |
| 115 | 115 | } |
| 116 | 116 | |
@@ -688,22 +688,22 @@ discard block |
||
| 688 | 688 | /** |
| 689 | 689 | * @since 1.7.2 |
| 690 | 690 | */ |
| 691 | - 'other_entries' => array( |
|
| 692 | - 'label' => __('Other Entries', 'gravityview'), |
|
| 693 | - 'type' => 'other_entries', |
|
| 694 | - 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 695 | - ), |
|
| 696 | - ); |
|
| 691 | + 'other_entries' => array( |
|
| 692 | + 'label' => __('Other Entries', 'gravityview'), |
|
| 693 | + 'type' => 'other_entries', |
|
| 694 | + 'desc' => __('Display other entries created by the entry creator.', 'gravityview'), |
|
| 695 | + ), |
|
| 696 | + ); |
|
| 697 | 697 | |
| 698 | 698 | |
| 699 | 699 | if( 'single' !== $zone) { |
| 700 | 700 | |
| 701 | - $entry_default_fields['entry_link'] = array( |
|
| 702 | - 'label' => __('Link to Entry', 'gravityview'), |
|
| 703 | - 'desc' => __('A dedicated link to the single entry with customizable text.', 'gravityview'), |
|
| 704 | - 'type' => 'entry_link', |
|
| 705 | - ); |
|
| 706 | - } |
|
| 701 | + $entry_default_fields['entry_link'] = array( |
|
| 702 | + 'label' => __('Link to Entry', 'gravityview'), |
|
| 703 | + 'desc' => __('A dedicated link to the single entry with customizable text.', 'gravityview'), |
|
| 704 | + 'type' => 'entry_link', |
|
| 705 | + ); |
|
| 706 | + } |
|
| 707 | 707 | |
| 708 | 708 | } // if not zone directory or single |
| 709 | 709 | |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | * @param string|array $form form_ID or form object |
| 715 | 715 | * @param string $zone Either 'single', 'directory', 'header', 'footer' |
| 716 | 716 | */ |
| 717 | - return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone); |
|
| 717 | + return apply_filters( 'gravityview_entry_default_fields', $entry_default_fields, $form, $zone); |
|
| 718 | 718 | } |
| 719 | 719 | |
| 720 | 720 | /** |
@@ -1028,15 +1028,15 @@ discard block |
||
| 1028 | 1028 | GFForms::register_scripts(); |
| 1029 | 1029 | |
| 1030 | 1030 | $scripts = array( |
| 1031 | - 'sack', |
|
| 1032 | - 'gform_gravityforms', |
|
| 1033 | - 'gform_forms', |
|
| 1034 | - 'gform_form_admin', |
|
| 1035 | - 'jquery-ui-autocomplete' |
|
| 1031 | + 'sack', |
|
| 1032 | + 'gform_gravityforms', |
|
| 1033 | + 'gform_forms', |
|
| 1034 | + 'gform_form_admin', |
|
| 1035 | + 'jquery-ui-autocomplete' |
|
| 1036 | 1036 | ); |
| 1037 | 1037 | |
| 1038 | 1038 | if ( wp_is_mobile() ) |
| 1039 | - $scripts[] = 'jquery-touch-punch'; |
|
| 1039 | + $scripts[] = 'jquery-touch-punch'; |
|
| 1040 | 1040 | |
| 1041 | 1041 | foreach ($scripts as $script) { |
| 1042 | 1042 | wp_enqueue_script( $script ); |
@@ -215,39 +215,39 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $wp_allowed_scripts = array( |
| 218 | - 'common', |
|
| 219 | - 'admin-bar', |
|
| 220 | - 'autosave', |
|
| 221 | - 'post', |
|
| 218 | + 'common', |
|
| 219 | + 'admin-bar', |
|
| 220 | + 'autosave', |
|
| 221 | + 'post', |
|
| 222 | 222 | 'inline-edit-post', |
| 223 | - 'utils', |
|
| 224 | - 'svg-painter', |
|
| 225 | - 'wp-auth-check', |
|
| 226 | - 'heartbeat', |
|
| 223 | + 'utils', |
|
| 224 | + 'svg-painter', |
|
| 225 | + 'wp-auth-check', |
|
| 226 | + 'heartbeat', |
|
| 227 | 227 | 'media-editor', |
| 228 | 228 | 'media-upload', |
| 229 | - 'thickbox', |
|
| 229 | + 'thickbox', |
|
| 230 | 230 | 'wp-color-picker', |
| 231 | 231 | |
| 232 | - // Settings |
|
| 232 | + // Settings |
|
| 233 | 233 | 'gv-admin-edd-license', |
| 234 | 234 | |
| 235 | - // Common |
|
| 236 | - 'select2-js', |
|
| 237 | - 'qtip-js', |
|
| 235 | + // Common |
|
| 236 | + 'select2-js', |
|
| 237 | + 'qtip-js', |
|
| 238 | 238 | |
| 239 | - // jQuery |
|
| 239 | + // jQuery |
|
| 240 | 240 | 'jquery', |
| 241 | - 'jquery-ui-core', |
|
| 242 | - 'jquery-ui-sortable', |
|
| 243 | - 'jquery-ui-datepicker', |
|
| 244 | - 'jquery-ui-dialog', |
|
| 245 | - 'jquery-ui-slider', |
|
| 241 | + 'jquery-ui-core', |
|
| 242 | + 'jquery-ui-sortable', |
|
| 243 | + 'jquery-ui-datepicker', |
|
| 244 | + 'jquery-ui-dialog', |
|
| 245 | + 'jquery-ui-slider', |
|
| 246 | 246 | 'jquery-ui-dialog', |
| 247 | 247 | 'jquery-ui-tabs', |
| 248 | 248 | 'jquery-ui-draggable', |
| 249 | 249 | 'jquery-ui-droppable', |
| 250 | - 'jquery-ui-accordion', |
|
| 250 | + 'jquery-ui-accordion', |
|
| 251 | 251 | ); |
| 252 | 252 | |
| 253 | 253 | $this->remove_conflicts( $wp_scripts, $wp_allowed_scripts, 'scripts' ); |
@@ -281,23 +281,23 @@ discard block |
||
| 281 | 281 | return; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - $wp_allowed_styles = array( |
|
| 285 | - 'admin-bar', |
|
| 286 | - 'colors', |
|
| 287 | - 'ie', |
|
| 288 | - 'wp-auth-check', |
|
| 289 | - 'media-views', |
|
| 284 | + $wp_allowed_styles = array( |
|
| 285 | + 'admin-bar', |
|
| 286 | + 'colors', |
|
| 287 | + 'ie', |
|
| 288 | + 'wp-auth-check', |
|
| 289 | + 'media-views', |
|
| 290 | 290 | 'thickbox', |
| 291 | 291 | 'dashicons', |
| 292 | - 'wp-jquery-ui-dialog', |
|
| 293 | - 'jquery-ui-sortable', |
|
| 292 | + 'wp-jquery-ui-dialog', |
|
| 293 | + 'jquery-ui-sortable', |
|
| 294 | 294 | |
| 295 | - // Settings |
|
| 296 | - 'gravityview_settings', |
|
| 295 | + // Settings |
|
| 296 | + 'gravityview_settings', |
|
| 297 | 297 | |
| 298 | - // @todo qTip styles not loading for some reason! |
|
| 299 | - 'jquery-qtip.js', |
|
| 300 | - ); |
|
| 298 | + // @todo qTip styles not loading for some reason! |
|
| 299 | + 'jquery-qtip.js', |
|
| 300 | + ); |
|
| 301 | 301 | |
| 302 | 302 | $this->remove_conflicts( $wp_styles, $wp_allowed_styles, 'styles' ); |
| 303 | 303 | |
@@ -317,32 +317,32 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | private function remove_conflicts( &$wp_objects, $required_objects, $type = 'scripts' ) { |
| 319 | 319 | |
| 320 | - /** |
|
| 321 | - * @filter `gravityview_noconflict_{$type}` Modify the list of no conflict scripts or styles\n |
|
| 322 | - * Filter is `gravityview_noconflict_scripts` or `gravityview_noconflict_styles` |
|
| 323 | - * @param array $required_objects |
|
| 324 | - */ |
|
| 325 | - $required_objects = apply_filters( "gravityview_noconflict_{$type}", $required_objects ); |
|
| 326 | - |
|
| 327 | - //reset queue |
|
| 328 | - $queue = array(); |
|
| 329 | - foreach( $wp_objects->queue as $object ) { |
|
| 330 | - if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
| 331 | - $queue[] = $object; |
|
| 332 | - } |
|
| 333 | - } |
|
| 334 | - $wp_objects->queue = $queue; |
|
| 335 | - |
|
| 336 | - $required_objects = $this->add_script_dependencies( $wp_objects->registered, $required_objects ); |
|
| 337 | - |
|
| 338 | - //unregistering scripts |
|
| 339 | - $registered = array(); |
|
| 340 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
| 341 | - if( in_array( $handle, $required_objects ) ){ |
|
| 342 | - $registered[ $handle ] = $script_registration; |
|
| 343 | - } |
|
| 344 | - } |
|
| 345 | - $wp_objects->registered = $registered; |
|
| 320 | + /** |
|
| 321 | + * @filter `gravityview_noconflict_{$type}` Modify the list of no conflict scripts or styles\n |
|
| 322 | + * Filter is `gravityview_noconflict_scripts` or `gravityview_noconflict_styles` |
|
| 323 | + * @param array $required_objects |
|
| 324 | + */ |
|
| 325 | + $required_objects = apply_filters( "gravityview_noconflict_{$type}", $required_objects ); |
|
| 326 | + |
|
| 327 | + //reset queue |
|
| 328 | + $queue = array(); |
|
| 329 | + foreach( $wp_objects->queue as $object ) { |
|
| 330 | + if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
| 331 | + $queue[] = $object; |
|
| 332 | + } |
|
| 333 | + } |
|
| 334 | + $wp_objects->queue = $queue; |
|
| 335 | + |
|
| 336 | + $required_objects = $this->add_script_dependencies( $wp_objects->registered, $required_objects ); |
|
| 337 | + |
|
| 338 | + //unregistering scripts |
|
| 339 | + $registered = array(); |
|
| 340 | + foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
| 341 | + if( in_array( $handle, $required_objects ) ){ |
|
| 342 | + $registered[ $handle ] = $script_registration; |
|
| 343 | + } |
|
| 344 | + } |
|
| 345 | + $wp_objects->registered = $registered; |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -405,7 +405,6 @@ discard block |
||
| 405 | 405 | * |
| 406 | 406 | * @deprecated since 1.12 |
| 407 | 407 | * @see GravityView_Compatibility::get_plugin_status() |
| 408 | - |
|
| 409 | 408 | * @return boolean|string True: plugin is active; False: plugin file doesn't exist at path; 'inactive' it's inactive |
| 410 | 409 | */ |
| 411 | 410 | static function get_plugin_status( $location = '' ) { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | // template areas |
| 138 | 138 | $template_areas_directory = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'directory' ); |
| 139 | - $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' ); |
|
| 139 | + $template_areas_single = apply_filters( 'gravityview_template_active_areas', array(), $template_id, 'single' ); |
|
| 140 | 140 | |
| 141 | 141 | // widget areas |
| 142 | 142 | $default_widget_areas = GravityView_Plugin::get_default_widget_areas(); |
@@ -328,40 +328,40 @@ discard block |
||
| 328 | 328 | // load file |
| 329 | 329 | $xmlstr = file_get_contents( $form_file ); |
| 330 | 330 | |
| 331 | - $options = array( |
|
| 332 | - "page" => array("unserialize_as_array" => true), |
|
| 333 | - "form"=> array("unserialize_as_array" => true), |
|
| 334 | - "field"=> array("unserialize_as_array" => true), |
|
| 335 | - "rule"=> array("unserialize_as_array" => true), |
|
| 336 | - "choice"=> array("unserialize_as_array" => true), |
|
| 337 | - "input"=> array("unserialize_as_array" => true), |
|
| 338 | - "routing_item"=> array("unserialize_as_array" => true), |
|
| 339 | - "creditCard"=> array("unserialize_as_array" => true), |
|
| 340 | - "routin"=> array("unserialize_as_array" => true), |
|
| 341 | - "confirmation" => array("unserialize_as_array" => true), |
|
| 342 | - "notification" => array("unserialize_as_array" => true) |
|
| 343 | - ); |
|
| 331 | + $options = array( |
|
| 332 | + "page" => array("unserialize_as_array" => true), |
|
| 333 | + "form"=> array("unserialize_as_array" => true), |
|
| 334 | + "field"=> array("unserialize_as_array" => true), |
|
| 335 | + "rule"=> array("unserialize_as_array" => true), |
|
| 336 | + "choice"=> array("unserialize_as_array" => true), |
|
| 337 | + "input"=> array("unserialize_as_array" => true), |
|
| 338 | + "routing_item"=> array("unserialize_as_array" => true), |
|
| 339 | + "creditCard"=> array("unserialize_as_array" => true), |
|
| 340 | + "routin"=> array("unserialize_as_array" => true), |
|
| 341 | + "confirmation" => array("unserialize_as_array" => true), |
|
| 342 | + "notification" => array("unserialize_as_array" => true) |
|
| 343 | + ); |
|
| 344 | 344 | |
| 345 | 345 | $xml = new RGXML($options); |
| 346 | - $forms = $xml->unserialize($xmlstr); |
|
| 346 | + $forms = $xml->unserialize($xmlstr); |
|
| 347 | 347 | |
| 348 | - if( !$forms ) { |
|
| 349 | - do_action( 'gravityview_log_error', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. Error importing file. (File)', $form_file ); |
|
| 350 | - return false; |
|
| 351 | - } |
|
| 348 | + if( !$forms ) { |
|
| 349 | + do_action( 'gravityview_log_error', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. Error importing file. (File)', $form_file ); |
|
| 350 | + return false; |
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - if( !empty( $forms[0] ) && is_array( $forms[0] ) ) { |
|
| 354 | - $form = $forms[0]; |
|
| 355 | - } |
|
| 353 | + if( !empty( $forms[0] ) && is_array( $forms[0] ) ) { |
|
| 354 | + $form = $forms[0]; |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | - if( empty( $form ) ) { |
|
| 358 | - do_action( 'gravityview_log_error', '[pre_get_available_fields] $form not set.', $forms ); |
|
| 359 | - return false; |
|
| 360 | - } |
|
| 357 | + if( empty( $form ) ) { |
|
| 358 | + do_action( 'gravityview_log_error', '[pre_get_available_fields] $form not set.', $forms ); |
|
| 359 | + return false; |
|
| 360 | + } |
|
| 361 | 361 | |
| 362 | - do_action( 'gravityview_log_debug', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. (Form)', $form ); |
|
| 362 | + do_action( 'gravityview_log_debug', '[pre_get_available_fields] Importing Form Fields for preset ['. $template_id .']. (Form)', $form ); |
|
| 363 | 363 | |
| 364 | - return $form; |
|
| 364 | + return $form; |
|
| 365 | 365 | |
| 366 | 366 | } |
| 367 | 367 | |
@@ -146,20 +146,20 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if( !empty( $field['custom_class'] ) ) { |
| 148 | 148 | |
| 149 | - $custom_class = $field['custom_class']; |
|
| 149 | + $custom_class = $field['custom_class']; |
|
| 150 | 150 | |
| 151 | - if( !empty( $entry ) ) { |
|
| 151 | + if( !empty( $entry ) ) { |
|
| 152 | 152 | |
| 153 | - // We want the merge tag to be formatted as a class. The merge tag may be |
|
| 154 | - // replaced by a multiple-word value that should be output as a single class. |
|
| 155 | - // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager` |
|
| 156 | - add_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 153 | + // We want the merge tag to be formatted as a class. The merge tag may be |
|
| 154 | + // replaced by a multiple-word value that should be output as a single class. |
|
| 155 | + // "Office Manager" will be formatted as `.OfficeManager`, not `.Office` and `.Manager` |
|
| 156 | + add_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 157 | 157 | |
| 158 | - $custom_class = self::replace_variables( $custom_class, $form, $entry); |
|
| 158 | + $custom_class = self::replace_variables( $custom_class, $form, $entry); |
|
| 159 | 159 | |
| 160 | - // And then we want life to return to normal |
|
| 161 | - remove_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 162 | - } |
|
| 160 | + // And then we want life to return to normal |
|
| 161 | + remove_filter('gform_merge_tag_filter', 'sanitize_html_class'); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | // And now we want the spaces to be handled nicely. |
| 165 | 165 | $classes[] = gravityview_sanitize_html_class( $custom_class ); |
@@ -591,29 +591,29 @@ discard block |
||
| 591 | 591 | return sanitize_title( $slug ); |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - /** |
|
| 595 | - * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta |
|
| 596 | - * |
|
| 597 | - * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 598 | - * |
|
| 599 | - * @param $entry array Gravity Forms entry object |
|
| 600 | - * @param $form array Gravity Forms form object |
|
| 601 | - */ |
|
| 602 | - public static function entry_create_custom_slug( $entry, $form ) { |
|
| 603 | - /** |
|
| 604 | - * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta |
|
| 605 | - * @param boolean $custom Should we process the custom entry slug? |
|
| 606 | - */ |
|
| 607 | - $custom = apply_filters( 'gravityview_custom_entry_slug', false ); |
|
| 608 | - if( $custom ) { |
|
| 609 | - // create the gravityview_unique_id and save it |
|
| 594 | + /** |
|
| 595 | + * If using the entry custom slug feature, make sure the new entries have the custom slug created and saved as meta |
|
| 596 | + * |
|
| 597 | + * Triggered by add_action( 'gform_entry_created', array( 'GravityView_API', 'entry_create_custom_slug' ), 10, 2 ); |
|
| 598 | + * |
|
| 599 | + * @param $entry array Gravity Forms entry object |
|
| 600 | + * @param $form array Gravity Forms form object |
|
| 601 | + */ |
|
| 602 | + public static function entry_create_custom_slug( $entry, $form ) { |
|
| 603 | + /** |
|
| 604 | + * @filter `gravityview_custom_entry_slug` On entry creation, check if we are using the custom entry slug feature and update the meta |
|
| 605 | + * @param boolean $custom Should we process the custom entry slug? |
|
| 606 | + */ |
|
| 607 | + $custom = apply_filters( 'gravityview_custom_entry_slug', false ); |
|
| 608 | + if( $custom ) { |
|
| 609 | + // create the gravityview_unique_id and save it |
|
| 610 | 610 | |
| 611 | - // Get the entry hash |
|
| 612 | - $hash = self::get_custom_entry_slug( $entry['id'], $entry ); |
|
| 613 | - gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash ); |
|
| 611 | + // Get the entry hash |
|
| 612 | + $hash = self::get_custom_entry_slug( $entry['id'], $entry ); |
|
| 613 | + gform_update_meta( $entry['id'], 'gravityview_unique_id', $hash ); |
|
| 614 | 614 | |
| 615 | - } |
|
| 616 | - } |
|
| 615 | + } |
|
| 616 | + } |
|
| 617 | 617 | |
| 618 | 618 | |
| 619 | 619 | |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | // If there was an error, continue to the next term. |
| 853 | 853 | if ( is_wp_error( $term_link ) ) { |
| 854 | - continue; |
|
| 854 | + continue; |
|
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | $output[] = gravityview_get_link( $term_link, esc_html( $term->name ) ); |
@@ -213,13 +213,13 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | if ( $add_default_properties && ! empty( $field['inputs'] ) ) { |
| 215 | 215 | foreach ( $field['inputs'] as $input ) { |
| 216 | - /** |
|
| 217 | - * @hack |
|
| 218 | - * In case of email/email confirmation, the input for email has the same id as the parent field |
|
| 219 | - */ |
|
| 220 | - if( 'email' == rgar( $field, 'type' ) && false === strpos( $input['id'], '.' ) ) { |
|
| 221 | - continue; |
|
| 222 | - } |
|
| 216 | + /** |
|
| 217 | + * @hack |
|
| 218 | + * In case of email/email confirmation, the input for email has the same id as the parent field |
|
| 219 | + */ |
|
| 220 | + if( 'email' == rgar( $field, 'type' ) && false === strpos( $input['id'], '.' ) ) { |
|
| 221 | + continue; |
|
| 222 | + } |
|
| 223 | 223 | $fields[ (string)$input['id'] ] = array( |
| 224 | 224 | 'label' => rgar( $input, 'label' ), |
| 225 | 225 | 'customLabel' => rgar( $input, 'customLabel' ), |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | } elseif ( 'delete' === RGForms::get( 'action' ) ) { |
| 467 | 467 | $criteria['context_view_id'] = isset( $_GET['view_id'] ) ? $_GET['view_id'] : null; |
| 468 | 468 | } elseif( !isset( $criteria['context_view_id'] ) ) { |
| 469 | - // Prevent overriding the Context View ID: Some widgets could set the context_view_id (e.g. Recent Entries widget) |
|
| 469 | + // Prevent overriding the Context View ID: Some widgets could set the context_view_id (e.g. Recent Entries widget) |
|
| 470 | 470 | $criteria['context_view_id'] = null; |
| 471 | 471 | } |
| 472 | 472 | |
@@ -1082,7 +1082,7 @@ discard block |
||
| 1082 | 1082 | ), |
| 1083 | 1083 | ); |
| 1084 | 1084 | |
| 1085 | - $fields = $date_created + $fields; |
|
| 1085 | + $fields = $date_created + $fields; |
|
| 1086 | 1086 | |
| 1087 | 1087 | $blacklist_field_types = apply_filters( 'gravityview_blacklist_field_types', $blacklist, NULL ); |
| 1088 | 1088 | |
@@ -1094,13 +1094,13 @@ discard block |
||
| 1094 | 1094 | } |
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | - /** |
|
| 1098 | - * @filter `gravityview/common/sortable_fields` Filter the sortable fields |
|
| 1099 | - * @since 1.12 |
|
| 1100 | - * @param array $fields Sub-set of GF form fields that are sortable |
|
| 1101 | - * @param int $formid The Gravity Forms form ID that the fields are from |
|
| 1102 | - */ |
|
| 1103 | - $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid ); |
|
| 1097 | + /** |
|
| 1098 | + * @filter `gravityview/common/sortable_fields` Filter the sortable fields |
|
| 1099 | + * @since 1.12 |
|
| 1100 | + * @param array $fields Sub-set of GF form fields that are sortable |
|
| 1101 | + * @param int $formid The Gravity Forms form ID that the fields are from |
|
| 1102 | + */ |
|
| 1103 | + $fields = apply_filters( 'gravityview/common/sortable_fields', $fields, $formid ); |
|
| 1104 | 1104 | |
| 1105 | 1105 | return $fields; |
| 1106 | 1106 | } |
@@ -1365,17 +1365,17 @@ discard block |
||
| 1365 | 1365 | } |
| 1366 | 1366 | |
| 1367 | 1367 | |
| 1368 | - /** |
|
| 1369 | - * Display updated/error notice |
|
| 1370 | - * |
|
| 1371 | - * @param string $notice text/HTML of notice |
|
| 1372 | - * @param string $class CSS class for notice (`updated` or `error`) |
|
| 1373 | - * |
|
| 1374 | - * @return string |
|
| 1375 | - */ |
|
| 1376 | - public static function generate_notice( $notice, $class = '' ) { |
|
| 1377 | - return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
| 1378 | - } |
|
| 1368 | + /** |
|
| 1369 | + * Display updated/error notice |
|
| 1370 | + * |
|
| 1371 | + * @param string $notice text/HTML of notice |
|
| 1372 | + * @param string $class CSS class for notice (`updated` or `error`) |
|
| 1373 | + * |
|
| 1374 | + * @return string |
|
| 1375 | + */ |
|
| 1376 | + public static function generate_notice( $notice, $class = '' ) { |
|
| 1377 | + return '<div class="gv-notice '.gravityview_sanitize_html_class( $class ) .'">'. $notice .'</div>'; |
|
| 1378 | + } |
|
| 1379 | 1379 | |
| 1380 | 1380 | |
| 1381 | 1381 | |