@@ -50,7 +50,6 @@ |
||
50 | 50 | * Register this shortcode class with the WordPress Shortcode API. |
51 | 51 | * |
52 | 52 | * @internal |
53 | - |
|
54 | 53 | * @return \GV\Shortcode|null The only internally registered instance of this shortcode, or null on error. |
55 | 54 | */ |
56 | 55 | public static function add() { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public static function remove() { |
78 | 78 | $shortcode = new static(); |
79 | - unset( self::$shortcodes[$shortcode->name] ); |
|
79 | + unset( self::$shortcodes[ $shortcode->name ] ); |
|
80 | 80 | remove_shortcode( $shortcode->name ); |
81 | 81 | } |
82 | 82 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); |
109 | 109 | |
110 | 110 | foreach ( $matches as $shortcode ) { |
111 | - $shortcode_name = $shortcode[2]; |
|
111 | + $shortcode_name = $shortcode[ 2 ]; |
|
112 | 112 | |
113 | - $shortcode_atts = shortcode_parse_atts( $shortcode[3] ); |
|
114 | - $shortcode_content = $shortcode[5]; |
|
113 | + $shortcode_atts = shortcode_parse_atts( $shortcode[ 3 ] ); |
|
114 | + $shortcode_content = $shortcode[ 5 ]; |
|
115 | 115 | |
116 | 116 | /** This is a registered GravityView shortcode. */ |
117 | - if ( !empty( self::$shortcodes[$shortcode_name] ) ) { |
|
118 | - $shortcode = clone self::$shortcodes[$shortcode_name]; |
|
117 | + if ( ! empty( self::$shortcodes[ $shortcode_name ] ) ) { |
|
118 | + $shortcode = clone self::$shortcodes[ $shortcode_name ]; |
|
119 | 119 | } else { |
120 | 120 | /** This is some generic shortcode. */ |
121 | 121 | $shortcode = new self; |
@@ -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 | } |