@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | function __construct() { |
18 | 18 | |
19 | - $this->widget_description = __('Summary of the number of visible entries out of the total results.', 'gravityview' ); |
|
19 | + $this->widget_description = __( 'Summary of the number of visible entries out of the total results.', 'gravityview' ); |
|
20 | 20 | |
21 | 21 | $default_values = array( |
22 | 22 | 'header' => 1, |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | |
26 | 26 | $settings = array(); |
27 | 27 | |
28 | - parent::__construct( __( 'Show Pagination Info', 'gravityview' ) , 'page_info', $default_values, $settings ); |
|
28 | + parent::__construct( __( 'Show Pagination Info', 'gravityview' ), 'page_info', $default_values, $settings ); |
|
29 | 29 | } |
30 | 30 | |
31 | - public function render_frontend( $widget_args, $content = '', $context = '') { |
|
31 | + public function render_frontend( $widget_args, $content = '', $context = '' ) { |
|
32 | 32 | $gravityview_view = GravityView_View::getInstance(); |
33 | 33 | |
34 | - if( !$this->pre_render_frontend() ) { |
|
34 | + if ( ! $this->pre_render_frontend() ) { |
|
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
38 | - if( !empty( $widget_args['title'] ) ) { |
|
39 | - echo $widget_args['title']; |
|
38 | + if ( ! empty( $widget_args[ 'title' ] ) ) { |
|
39 | + echo $widget_args[ 'title' ]; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $pagination_counts = $gravityview_view->getPaginationCounts(); |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | |
46 | 46 | $output = ''; |
47 | 47 | |
48 | - if( ! empty( $pagination_counts ) ) { |
|
48 | + if ( ! empty( $pagination_counts ) ) { |
|
49 | 49 | |
50 | - $first = $pagination_counts['first']; |
|
51 | - $last = $pagination_counts['last']; |
|
52 | - $total = $pagination_counts['total']; |
|
50 | + $first = $pagination_counts[ 'first' ]; |
|
51 | + $last = $pagination_counts[ 'last' ]; |
|
52 | + $total = $pagination_counts[ 'total' ]; |
|
53 | 53 | |
54 | - $class = !empty( $widget_args['custom_class'] ) ? $widget_args['custom_class'] : ''; |
|
54 | + $class = ! empty( $widget_args[ 'custom_class' ] ) ? $widget_args[ 'custom_class' ] : ''; |
|
55 | 55 | $class = gravityview_sanitize_html_class( $class ); |
56 | 56 | |
57 | - $output = '<div class="gv-widget-pagination '.$class.'"><p>'. sprintf(__( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>'; |
|
57 | + $output = '<div class="gv-widget-pagination ' . $class . '"><p>' . sprintf( __( 'Displaying %1$s - %2$s of %3$s', 'gravityview' ), number_format_i18n( $first ), number_format_i18n( $last ), number_format_i18n( $total ) ) . '</p></div>'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | * @return GravityView_Field | bool |
43 | 43 | */ |
44 | 44 | public static function create( $properties ) { |
45 | - $type = isset( $properties['type'] ) ? $properties['type'] : ''; |
|
46 | - $type = empty( $properties['inputType'] ) ? $type : $properties['inputType']; |
|
45 | + $type = isset( $properties[ 'type' ] ) ? $properties[ 'type' ] : ''; |
|
46 | + $type = empty( $properties[ 'inputType' ] ) ? $type : $properties[ 'inputType' ]; |
|
47 | 47 | if ( empty( $type ) || ! isset( self::$_fields[ $type ] ) ) { |
48 | 48 | return new GravityView_Field( $properties ); |
49 | 49 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | * @return bool True: yes, it exists; False: nope |
63 | 63 | */ |
64 | 64 | public static function exists( $field_name ) { |
65 | - return isset( self::$_fields["{$field_name}"] ); |
|
65 | + return isset( self::$_fields[ "{$field_name}" ] ); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | |
97 | 97 | $field_type = is_a( $gf_field, 'GF_Field' ) ? get_class( $gf_field ) : $gf_field; |
98 | 98 | |
99 | - foreach( self::$_fields as $field ) { |
|
100 | - if( $field_type === $field->_gf_field_class_name ) { |
|
99 | + foreach ( self::$_fields as $field ) { |
|
100 | + if ( $field_type === $field->_gf_field_class_name ) { |
|
101 | 101 | return $field; |
102 | 102 | } |
103 | 103 | } |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public static function get_all( $group = '' ) { |
118 | 118 | |
119 | - if( '' !== $group ) { |
|
119 | + if ( '' !== $group ) { |
|
120 | 120 | $return_fields = self::$_fields; |
121 | 121 | foreach ( $return_fields as $key => $field ) { |
122 | - if( $group !== $field->group ) { |
|
122 | + if ( $group !== $field->group ) { |
|
123 | 123 | unset( $return_fields[ $key ] ); |
124 | 124 | } |
125 | 125 | } |
@@ -77,7 +77,7 @@ |
||
77 | 77 | /** |
78 | 78 | * Alias for get_instance() |
79 | 79 | * |
80 | - * @param $field_name |
|
80 | + * @param string $field_name |
|
81 | 81 | * |
82 | 82 | * @return GravityView_Field|false |
83 | 83 | */ |
@@ -40,11 +40,11 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | $field_options['link_phone'] = array( |
43 | - 'type' => 'checkbox', |
|
44 | - 'label' => __( 'Make Phone Number Clickable', 'gravityview' ), |
|
45 | - 'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'), |
|
46 | - 'value' => true, |
|
47 | - ); |
|
43 | + 'type' => 'checkbox', |
|
44 | + 'label' => __( 'Make Phone Number Clickable', 'gravityview' ), |
|
45 | + 'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'), |
|
46 | + 'value' => true, |
|
47 | + ); |
|
48 | 48 | |
49 | 49 | return $field_options; |
50 | 50 | } |
@@ -38,14 +38,14 @@ |
||
38 | 38 | */ |
39 | 39 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
40 | 40 | |
41 | - if( 'edit' === $context ) { |
|
41 | + if ( 'edit' === $context ) { |
|
42 | 42 | return $field_options; |
43 | 43 | } |
44 | 44 | |
45 | - $field_options['link_phone'] = array( |
|
45 | + $field_options[ 'link_phone' ] = array( |
|
46 | 46 | 'type' => 'checkbox', |
47 | 47 | 'label' => __( 'Make Phone Number Clickable', 'gravityview' ), |
48 | - 'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'), |
|
48 | + 'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview' ), |
|
49 | 49 | 'value' => true, |
50 | 50 | ); |
51 | 51 |
@@ -21,10 +21,10 @@ |
||
21 | 21 | {email_fields} |
22 | 22 | |
23 | 23 | <div class="gv-note-content-container"> |
24 | - <label for="gv-note-content-{entry_slug}" class="screen-reader-text"><?php echo GravityView_Field_Notes::strings('content-label'); ?></label> |
|
24 | + <label for="gv-note-content-{entry_slug}" class="screen-reader-text"><?php echo GravityView_Field_Notes::strings( 'content-label' ); ?></label> |
|
25 | 25 | <textarea name="gv-note-content" id="gv-note-content-{entry_slug}"></textarea> |
26 | 26 | </div> |
27 | 27 | |
28 | - <button type="submit" class="button gv-add-note-submit"><?php echo GravityView_Field_Notes::strings('add-note'); ?></button> |
|
28 | + <button type="submit" class="button gv-add-note-submit"><?php echo GravityView_Field_Notes::strings( 'add-note' ); ?></button> |
|
29 | 29 | </div> |
30 | 30 | </form> |
31 | 31 | \ No newline at end of file |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * @return string |
22 | 22 | */ |
23 | 23 | function get_field_desc() { |
24 | - return !empty( $this->field['desc'] ) ? $this->field['desc'] : ''; |
|
24 | + return ! empty( $this->field[ 'desc' ] ) ? $this->field[ 'desc' ] : ''; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | function render_input( $override_input = null ) { |
25 | - if( isset( $override_input ) ) { |
|
25 | + if ( isset( $override_input ) ) { |
|
26 | 26 | echo $override_input; |
27 | 27 | return; |
28 | 28 | } |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | ?> |
31 | 31 | <ul class="gv-setting-list"> |
32 | 32 | <?php |
33 | - foreach( $this->field['options'] as $value => $label ) { ?> |
|
34 | - <li <?php if( isset( $label['requires'] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label['requires'] ); } ?>> |
|
33 | + foreach ( $this->field[ 'options' ] as $value => $label ) { ?> |
|
34 | + <li <?php if ( isset( $label[ 'requires' ] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label[ 'requires' ] ); } ?>> |
|
35 | 35 | <label> |
36 | 36 | <input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>" type="hidden" |
37 | 37 | value="0"/> |
38 | 38 | <input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>" |
39 | 39 | id="<?php echo $this->get_field_id(); ?>" type="checkbox" |
40 | 40 | value="1" <?php checked( ! empty( $this->value[ $value ] ) ); ?> /> |
41 | - <?php echo esc_html( $label['label'] ); ?> |
|
41 | + <?php echo esc_html( $label[ 'label' ] ); ?> |
|
42 | 42 | </label> |
43 | - <?php if( ! empty( $label['desc'] ) ) { |
|
44 | - printf( '<span class="howto">%s</span>', $label['desc'] ); |
|
43 | + <?php if ( ! empty( $label[ 'desc' ] ) ) { |
|
44 | + printf( '<span class="howto">%s</span>', $label[ 'desc' ] ); |
|
45 | 45 | } |
46 | 46 | ?> |
47 | 47 | </li> |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function if_gravityview_return_true( $has_content = false ) { |
52 | 52 | |
53 | - if( ! class_exists( 'GravityView_frontend' ) ) { |
|
53 | + if ( ! class_exists( 'GravityView_frontend' ) ) { |
|
54 | 54 | return $has_content; |
55 | 55 | } |
56 | 56 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // Dequeue other jQuery styles even if no-conflict is off. |
118 | 118 | // Terrible-looking tabs help no one. |
119 | - if( !empty( $wp_styles->registered ) ) { |
|
119 | + if( !empty( $wp_styles->registered ) ) { |
|
120 | 120 | foreach ($wp_styles->registered as $key => $style) { |
121 | 121 | if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
122 | 122 | wp_dequeue_style( $key ); |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | |
190 | 190 | //unregistering scripts |
191 | 191 | $registered = array(); |
192 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
193 | - if( in_array( $handle, $required_objects ) ){ |
|
192 | + foreach( $wp_objects->registered as $handle => $script_registration ) { |
|
193 | + if( in_array( $handle, $required_objects ) ) { |
|
194 | 194 | $registered[ $handle ] = $script_registration; |
195 | 195 | } |
196 | 196 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function __construct() { |
20 | 20 | |
21 | - if( ! is_admin() ) { return; } |
|
21 | + if ( ! is_admin() ) { return; } |
|
22 | 22 | |
23 | 23 | $this->add_hooks(); |
24 | 24 | } |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | */ |
33 | 33 | private function add_hooks() { |
34 | 34 | //Hooks for no-conflict functionality |
35 | - add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000); |
|
36 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9); |
|
35 | + add_action( 'wp_print_scripts', array( $this, 'no_conflict_scripts' ), 1000 ); |
|
36 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_scripts' ), 9 ); |
|
37 | 37 | |
38 | - add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000); |
|
39 | - add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11); |
|
40 | - add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1); |
|
41 | - add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1); |
|
38 | + add_action( 'wp_print_styles', array( $this, 'no_conflict_styles' ), 1000 ); |
|
39 | + add_action( 'admin_print_styles', array( $this, 'no_conflict_styles' ), 11 ); |
|
40 | + add_action( 'admin_print_footer_scripts', array( $this, 'no_conflict_styles' ), 1 ); |
|
41 | + add_action( 'admin_footer', array( $this, 'no_conflict_styles' ), 1 ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | function no_conflict_scripts() { |
52 | 52 | global $wp_scripts; |
53 | 53 | |
54 | - if( ! gravityview()->request->is_admin( '', null ) ) { |
|
54 | + if ( ! gravityview()->request->is_admin( '', null ) ) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | |
58 | 58 | $no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' ); |
59 | 59 | |
60 | - if( empty( $no_conflict_mode ) ) { |
|
60 | + if ( empty( $no_conflict_mode ) ) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 | |
@@ -110,15 +110,15 @@ discard block |
||
110 | 110 | function no_conflict_styles() { |
111 | 111 | global $wp_styles; |
112 | 112 | |
113 | - if( ! gravityview()->request->is_admin( '', null ) ) { |
|
113 | + if ( ! gravityview()->request->is_admin( '', null ) ) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | 117 | // Dequeue other jQuery styles even if no-conflict is off. |
118 | 118 | // Terrible-looking tabs help no one. |
119 | - if( !empty( $wp_styles->registered ) ) { |
|
120 | - foreach ($wp_styles->registered as $key => $style) { |
|
121 | - if( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
119 | + if ( ! empty( $wp_styles->registered ) ) { |
|
120 | + foreach ( $wp_styles->registered as $key => $style ) { |
|
121 | + if ( preg_match( '/^(?:wp\-)?jquery/ism', $key ) ) { |
|
122 | 122 | wp_dequeue_style( $key ); |
123 | 123 | } |
124 | 124 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $no_conflict_mode = gravityview()->plugin->settings->get( 'no-conflict-mode' ); |
128 | 128 | |
129 | 129 | // If no conflict is off, jQuery will suffice. |
130 | - if( empty( $no_conflict_mode ) ) { |
|
130 | + if ( empty( $no_conflict_mode ) ) { |
|
131 | 131 | return; |
132 | 132 | } |
133 | 133 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | /** |
155 | 155 | * @action `gravityview_remove_conflicts_after` Runs after no-conflict styles are removed. You can re-add styles here. |
156 | 156 | */ |
157 | - do_action('gravityview_remove_conflicts_after'); |
|
157 | + do_action( 'gravityview_remove_conflicts_after' ); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | |
179 | 179 | //reset queue |
180 | 180 | $queue = array(); |
181 | - foreach( $wp_objects->queue as $object ) { |
|
182 | - if( in_array( $object, $required_objects ) || preg_match('/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
183 | - $queue[] = $object; |
|
181 | + foreach ( $wp_objects->queue as $object ) { |
|
182 | + if ( in_array( $object, $required_objects ) || preg_match( '/gravityview|gf_|gravityforms/ism', $object ) ) { |
|
183 | + $queue[ ] = $object; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | $wp_objects->queue = $queue; |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | |
190 | 190 | //unregistering scripts |
191 | 191 | $registered = array(); |
192 | - foreach( $wp_objects->registered as $handle => $script_registration ){ |
|
193 | - if( in_array( $handle, $required_objects ) ){ |
|
192 | + foreach ( $wp_objects->registered as $handle => $script_registration ) { |
|
193 | + if ( in_array( $handle, $required_objects ) ) { |
|
194 | 194 | $registered[ $handle ] = $script_registration; |
195 | 195 | } |
196 | 196 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @param array $registered [description] |
206 | 206 | * @param array $scripts [description] |
207 | 207 | */ |
208 | - private function add_script_dependencies($registered, $scripts) { |
|
208 | + private function add_script_dependencies( $registered, $scripts ) { |
|
209 | 209 | |
210 | 210 | //gets all dependent scripts linked to the $scripts array passed |
211 | 211 | do { |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $deps = isset( $registered[ $script ] ) && is_array( $registered[ $script ]->deps ) ? $registered[ $script ]->deps : array(); |
215 | 215 | foreach ( $deps as $dep ) { |
216 | 216 | if ( ! in_array( $dep, $scripts ) && ! in_array( $dep, $dependents ) ) { |
217 | - $dependents[] = $dep; |
|
217 | + $dependents[ ] = $dep; |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 | } |
@@ -19,12 +19,12 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | function render_input( $override_input = null ) { |
22 | - if( isset( $override_input ) ) { |
|
22 | + if ( isset( $override_input ) ) { |
|
23 | 23 | echo $override_input; |
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | - foreach( $this->field['options'] as $value => $label ) : ?> |
|
27 | + foreach ( $this->field[ 'options' ] as $value => $label ) : ?> |
|
28 | 28 | <label class="<?php echo $this->get_label_class(); ?>"> |
29 | 29 | <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>-<?php echo esc_attr( $value ); ?>" type="radio" value="<?php echo esc_attr( $value ); ?>" <?php checked( $value, $this->value, true ); ?> /> <?php echo esc_html( $label ); ?> |
30 | 30 | </label> |