@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | protected $script_handles = array( |
| 25 | 25 | 'rcp-admin-scripts', |
| 26 | - 'bbq', |
|
| 26 | + 'bbq', |
|
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -26,24 +26,24 @@ |
||
| 26 | 26 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
| 27 | 27 | |
| 28 | 28 | // Don't link to entry; doesn't make sense. |
| 29 | - unset( $field_options['show_as_link'] ); |
|
| 29 | + unset( $field_options[ 'show_as_link' ] ); |
|
| 30 | 30 | |
| 31 | - if( 'edit' === $context ) { |
|
| 31 | + if ( 'edit' === $context ) { |
|
| 32 | 32 | return $field_options; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $add_options = array(); |
| 36 | - $add_options['link_to_source'] = array( |
|
| 36 | + $add_options[ 'link_to_source' ] = array( |
|
| 37 | 37 | 'type' => 'checkbox', |
| 38 | 38 | 'label' => __( 'Link to URL:', 'gravityview' ), |
| 39 | - 'desc' => __('Display as a link to the Source URL', 'gravityview'), |
|
| 39 | + 'desc' => __( 'Display as a link to the Source URL', 'gravityview' ), |
|
| 40 | 40 | 'value' => false, |
| 41 | 41 | 'merge_tags' => false, |
| 42 | 42 | ); |
| 43 | - $add_options['source_link_text'] = array( |
|
| 43 | + $add_options[ 'source_link_text' ] = array( |
|
| 44 | 44 | 'type' => 'text', |
| 45 | 45 | 'label' => __( 'Link Text:', 'gravityview' ), |
| 46 | - 'desc' => __('Customize the link text. If empty, the link text will be the URL.', 'gravityview'), |
|
| 46 | + 'desc' => __( 'Customize the link text. If empty, the link text will be the URL.', 'gravityview' ), |
|
| 47 | 47 | 'value' => NULL, |
| 48 | 48 | 'merge_tags' => true, |
| 49 | 49 | ); |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
| 13 | 13 | |
| 14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
| 15 | - add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
| 15 | + add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
| 16 | 16 | |
| 17 | - // Load Debug Bar integration |
|
| 18 | - add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
| 17 | + // Load Debug Bar integration |
|
| 18 | + add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
| 19 | 19 | |
| 20 | 20 | } |
| 21 | 21 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | * @param array $supported_plugins List of plugins |
| 45 | 45 | */ |
| 46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
| 47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
| 48 | - return $supported_plugins; |
|
| 47 | + $supported_plugins['gravityview'] = 'GravityView'; |
|
| 48 | + return $supported_plugins; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | if ( class_exists("GFLogging") ) { |
| 98 | 98 | GFLogging::include_logger(); |
| 99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
| 100 | - } |
|
| 99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
| 100 | + } |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static function log_error( $message = '', $data = null ) { |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if ( class_exists("GFLogging") ) { |
| 118 | - GFLogging::include_logger(); |
|
| 119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
| 118 | + GFLogging::include_logger(); |
|
| 119 | + GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
@@ -7,9 +7,9 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | function __construct() { |
| 9 | 9 | |
| 10 | - add_action( 'gravityview_log_error', array( $this, 'log_error'), 10, 2 ); |
|
| 10 | + add_action( 'gravityview_log_error', array( $this, 'log_error' ), 10, 2 ); |
|
| 11 | 11 | |
| 12 | - add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
|
| 12 | + add_action( 'gravityview_log_debug', array( $this, 'log_debug' ), 10, 2 ); |
|
| 13 | 13 | |
| 14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
| 15 | 15 | add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | include_once( GRAVITYVIEW_DIR . 'includes/class-debug-bar.php' ); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - $panels[] = new GravityView_Debug_Bar; |
|
| 37 | + $panels[ ] = new GravityView_Debug_Bar; |
|
| 38 | 38 | |
| 39 | 39 | return $panels; |
| 40 | 40 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @param array $supported_plugins List of plugins |
| 45 | 45 | */ |
| 46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
| 47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
| 47 | + $supported_plugins[ 'gravityview' ] = 'GravityView'; |
|
| 48 | 48 | return $supported_plugins; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @return string "print_r" or "var_export" |
| 73 | 73 | */ |
| 74 | 74 | static function get_print_function() { |
| 75 | - if( ob_get_level() > 0 ) { |
|
| 75 | + if ( ob_get_level() > 0 ) { |
|
| 76 | 76 | $function = 'var_export'; |
| 77 | 77 | } else { |
| 78 | 78 | $function = 'print_r'; |
@@ -90,17 +90,17 @@ discard block |
||
| 90 | 90 | 'data' => $data, |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | - if( !in_array( $notice, self::$notices ) ) { |
|
| 94 | - self::$notices[] = $notice; |
|
| 93 | + if ( ! in_array( $notice, self::$notices ) ) { |
|
| 94 | + self::$notices[ ] = $notice; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if ( class_exists("GFLogging") ) { |
|
| 97 | + if ( class_exists( "GFLogging" ) ) { |
|
| 98 | 98 | GFLogging::include_logger(); |
| 99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
| 99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $data, true ), KLogger::DEBUG ); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - static function log_error( $message = '', $data = null ) { |
|
| 103 | + static function log_error( $message = '', $data = null ) { |
|
| 104 | 104 | |
| 105 | 105 | $function = self::get_print_function(); |
| 106 | 106 | |
@@ -110,13 +110,13 @@ discard block |
||
| 110 | 110 | 'backtrace' => function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 3 ) : '', |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - if( !in_array( $error, self::$errors ) ) { |
|
| 114 | - self::$errors[] = $error; |
|
| 113 | + if ( ! in_array( $error, self::$errors ) ) { |
|
| 114 | + self::$errors[ ] = $error; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if ( class_exists("GFLogging") ) { |
|
| 117 | + if ( class_exists( "GFLogging" ) ) { |
|
| 118 | 118 | GFLogging::include_logger(); |
| 119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
| 119 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function( $error, true ), KLogger::ERROR ); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <div class="gv-search-box gv-search-date"> |
| 14 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
| 15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
| 14 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
| 15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
| 16 | 16 | <?php } ?> |
| 17 | 17 | <p> |
| 18 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
| 18 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>" class="<?php echo esc_html( $gravityview_view->datepicker_class ); ?>" > |
|
| 19 | 19 | </p> |
| 20 | 20 | </div> |
| 21 | 21 | \ No newline at end of file |
@@ -10,10 +10,10 @@ |
||
| 10 | 10 | |
| 11 | 11 | ?> |
| 12 | 12 | <div class="gv-search-box gv-search-field-text"> |
| 13 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { ?> |
|
| 14 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>"><?php echo esc_html( $search_field['label'] ); ?></label> |
|
| 13 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { ?> |
|
| 14 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>"><?php echo esc_html( $search_field[ 'label' ] ); ?></label> |
|
| 15 | 15 | <?php } ?> |
| 16 | 16 | <p> |
| 17 | - <input type="text" name="<?php echo esc_attr( $search_field['name'] ); ?>" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" value="<?php echo esc_attr( $search_field['value'] ); ?>"> |
|
| 17 | + <input type="text" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="<?php echo esc_attr( $search_field[ 'value' ] ); ?>"> |
|
| 18 | 18 | </p> |
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file |
@@ -12,8 +12,8 @@ |
||
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | 14 | <div class="gv-search-box gv-search-field-single_checkbox"> |
| 15 | - <label for="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" class="gv-check-radio"> |
|
| 16 | - <input type="checkbox" name="<?php echo esc_attr( $search_field['name'] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field['name'] ); ?>" <?php checked( '1', $search_field['value'], true ); ?>> |
|
| 17 | - <?php if( ! gv_empty( $search_field['label'], false, false ) ) { echo esc_html( $search_field['label'] ); } ?> |
|
| 15 | + <label for="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" class="gv-check-radio"> |
|
| 16 | + <input type="checkbox" name="<?php echo esc_attr( $search_field[ 'name' ] ); ?>" value="1" id="search-box-<?php echo esc_attr( $search_field[ 'name' ] ); ?>" <?php checked( '1', $search_field[ 'value' ], true ); ?>> |
|
| 17 | + <?php if ( ! gv_empty( $search_field[ 'label' ], false, false ) ) { echo esc_html( $search_field[ 'label' ] ); } ?> |
|
| 18 | 18 | </label> |
| 19 | 19 | </div> |
| 20 | 20 | \ No newline at end of file |
@@ -79,11 +79,11 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $sidebars_widgets = wp_get_sidebars_widgets(); |
| 82 | - if ( empty( $sidebars_widgets[ $matches[1] ] ) ) { |
|
| 82 | + if ( empty( $sidebars_widgets[ $matches[ 1 ] ] ) ) { |
|
| 83 | 83 | return $shortcodes; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - foreach ( $sidebars_widgets[ $matches[1] ] as $widgets ) { |
|
| 86 | + foreach ( $sidebars_widgets[ $matches[ 1 ] ] as $widgets ) { |
|
| 87 | 87 | if ( |
| 88 | 88 | /** |
| 89 | 89 | * Blacklisted widgets. |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | strpos( $widgets, 'gv_recent_entries' ) === 0 |
| 93 | 93 | ) { |
| 94 | 94 | |
| 95 | - $shortcodes []= 'et_pb_sidebar'; |
|
| 95 | + $shortcodes [ ] = 'et_pb_sidebar'; |
|
| 96 | 96 | break; |
| 97 | 97 | } |
| 98 | 98 | } |
@@ -22,13 +22,13 @@ |
||
| 22 | 22 | |
| 23 | 23 | function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
| 24 | 24 | |
| 25 | - unset( $field_options['show_as_link'] ); |
|
| 25 | + unset( $field_options[ 'show_as_link' ] ); |
|
| 26 | 26 | |
| 27 | - if( 'edit' === $context ) { |
|
| 27 | + if ( 'edit' === $context ) { |
|
| 28 | 28 | return $field_options; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - $this->add_field_support('dynamic_data', $field_options ); |
|
| 31 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
| 32 | 32 | |
| 33 | 33 | return $field_options; |
| 34 | 34 | } |
@@ -42,16 +42,16 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $args = wp_parse_args( $args, $defaults ); |
| 44 | 44 | |
| 45 | - $forms = gravityview_get_forms( (bool) $args['active'], (bool) $args['trash'] ); |
|
| 45 | + $forms = gravityview_get_forms( (bool)$args[ 'active' ], (bool)$args[ 'trash' ] ); |
|
| 46 | 46 | |
| 47 | - if( array() === $args['options'] ) { |
|
| 47 | + if ( array() === $args[ 'options' ] ) { |
|
| 48 | 48 | foreach ( $forms as $form ) { |
| 49 | 49 | |
| 50 | - if ( in_array( $form['id'], $args['exclude'] ) ) { |
|
| 50 | + if ( in_array( $form[ 'id' ], $args[ 'exclude' ] ) ) { |
|
| 51 | 51 | continue; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $args['options'][ $form['id'] ] = esc_html( $form['title'] ); |
|
| 54 | + $args[ 'options' ][ $form[ 'id' ] ] = esc_html( $form[ 'title' ] ); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -83,15 +83,15 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $args = wp_parse_args( $args, $defaults ); |
| 85 | 85 | |
| 86 | - if( empty( $args['form_id'] ) ) { |
|
| 86 | + if ( empty( $args[ 'form_id' ] ) ) { |
|
| 87 | 87 | return ''; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - $fields = GVCommon::get_sortable_fields_array( $args['form_id'] ); |
|
| 90 | + $fields = GVCommon::get_sortable_fields_array( $args[ 'form_id' ] ); |
|
| 91 | 91 | |
| 92 | - if( array() === $args['options'] ) { |
|
| 92 | + if ( array() === $args[ 'options' ] ) { |
|
| 93 | 93 | foreach ( $fields as $field_id => $field ) { |
| 94 | - $args['options'][ $field_id ] = esc_html( $field['label'] ); |
|
| 94 | + $args[ 'options' ][ $field_id ] = esc_html( $field[ 'label' ] ); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -127,43 +127,43 @@ discard block |
||
| 127 | 127 | $args = wp_parse_args( $args, $defaults ); |
| 128 | 128 | |
| 129 | 129 | $data_elements = ''; |
| 130 | - foreach ( $args['data'] as $key => $value ) { |
|
| 130 | + foreach ( $args[ 'data' ] as $key => $value ) { |
|
| 131 | 131 | $data_elements .= ' data-' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if( $args['multiple'] ) { |
|
| 134 | + if ( $args[ 'multiple' ] ) { |
|
| 135 | 135 | $multiple = ' MULTIPLE'; |
| 136 | 136 | } else { |
| 137 | 137 | $multiple = ''; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - if( $args['placeholder'] ) { |
|
| 141 | - $placeholder = $args['placeholder']; |
|
| 140 | + if ( $args[ 'placeholder' ] ) { |
|
| 141 | + $placeholder = $args[ 'placeholder' ]; |
|
| 142 | 142 | } else { |
| 143 | 143 | $placeholder = ''; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $disabled = $args['disabled'] ? ' disabled="disabled"' : ''; |
|
| 147 | - $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args['class'] ) ) ); |
|
| 148 | - $output = '<select name="' . esc_attr( $args['name'] ) . '" id="' . esc_attr( str_replace( '-', '_', $args['id'] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"'. $data_elements . '>'; |
|
| 146 | + $disabled = $args[ 'disabled' ] ? ' disabled="disabled"' : ''; |
|
| 147 | + $class = implode( ' ', array_map( 'sanitize_html_class', explode( ' ', $args[ 'class' ] ) ) ); |
|
| 148 | + $output = '<select name="' . esc_attr( $args[ 'name' ] ) . '" id="' . esc_attr( str_replace( '-', '_', $args[ 'id' ] ) ) . '" class="gravityview-select ' . $class . '"' . $multiple . $disabled . ' data-placeholder="' . $placeholder . '"' . $data_elements . '>'; |
|
| 149 | 149 | |
| 150 | - if ( ! empty( $args['options'] ) ) { |
|
| 150 | + if ( ! empty( $args[ 'options' ] ) ) { |
|
| 151 | 151 | |
| 152 | - if ( $args['show_option_none'] ) { |
|
| 153 | - if( $args['multiple'] ) { |
|
| 154 | - $selected = selected( true, in_array( -1, $args['selected'] ), false ); |
|
| 152 | + if ( $args[ 'show_option_none' ] ) { |
|
| 153 | + if ( $args[ 'multiple' ] ) { |
|
| 154 | + $selected = selected( true, in_array( -1, $args[ 'selected' ] ), false ); |
|
| 155 | 155 | } else { |
| 156 | - $selected = selected( $args['selected'], -1, false ); |
|
| 156 | + $selected = selected( $args[ 'selected' ], -1, false ); |
|
| 157 | 157 | } |
| 158 | - $output .= '<option value="-1"' . $selected . '>' . esc_html( $args['show_option_none'] ) . '</option>'; |
|
| 158 | + $output .= '<option value="-1"' . $selected . '>' . esc_html( $args[ 'show_option_none' ] ) . '</option>'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - foreach( $args['options'] as $key => $option ) { |
|
| 161 | + foreach ( $args[ 'options' ] as $key => $option ) { |
|
| 162 | 162 | |
| 163 | - if( $args['multiple'] && is_array( $args['selected'] ) ) { |
|
| 164 | - $selected = selected( true, in_array( $key, $args['selected'], true ), false ); |
|
| 163 | + if ( $args[ 'multiple' ] && is_array( $args[ 'selected' ] ) ) { |
|
| 164 | + $selected = selected( true, in_array( $key, $args[ 'selected' ], true ), false ); |
|
| 165 | 165 | } else { |
| 166 | - $selected = selected( $args['selected'], $key, false ); |
|
| 166 | + $selected = selected( $args[ 'selected' ], $key, false ); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $output .= '<option value="' . esc_attr( $key ) . '"' . $selected . '>' . esc_html( $option ) . '</option>'; |