@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Render the page size widget |
79 | - * |
|
79 | + * |
|
80 | 80 | * @param array $widget_args The Widget shortcode args. |
81 | 81 | * @param string $content The content. |
82 | 82 | * @param string|\GV\Template_Context $context The context, if available. |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | <?php } ?> |
118 | 118 | </select> |
119 | 119 | <input type="submit" value="Submit" style="visibility: hidden; position: absolute;" /><?php |
120 | - if( ! empty( $_GET ) ) { |
|
121 | - $get = $_GET; |
|
122 | - unset( $get['page_size'] ); |
|
123 | - foreach ( $get as $key => $value ) { |
|
120 | + if( ! empty( $_GET ) ) { |
|
121 | + $get = $_GET; |
|
122 | + unset( $get['page_size'] ); |
|
123 | + foreach ( $get as $key => $value ) { |
|
124 | 124 | if ( is_array( $value ) ) { |
125 | 125 | foreach ( $value as $_key => $_value ) { |
126 | 126 | printf( '<input type="hidden" name="%s[%s]" value="%s" />', esc_attr( $key ), esc_attr( $_key ), esc_attr( $_value ) ); |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | } else { |
129 | 129 | printf( '<input type="hidden" name="%s" value="%s" />', esc_attr( $key ), esc_attr( $value ) ); |
130 | 130 | } |
131 | - } |
|
132 | - } |
|
133 | - ?> |
|
131 | + } |
|
132 | + } |
|
133 | + ?> |
|
134 | 134 | </div> |
135 | 135 | </form> |
136 | 136 | </div> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $default_size = 25; |
50 | 50 | |
51 | 51 | if ( $context instanceof \GV\Template_Context ) { |
52 | - $default_size = (int) $context->view->settings->get( 'page_size' ); |
|
52 | + $default_size = (int)$context->view->settings->get( 'page_size' ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $sizes = array( 10, 25, $default_size, 50, 100 ); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $page_sizes = array(); |
62 | 62 | foreach ( $sizes as $size ) { |
63 | - $page_sizes [] = array( |
|
63 | + $page_sizes [ ] = array( |
|
64 | 64 | 'value' => $size, |
65 | 65 | 'text' => $size |
66 | 66 | ); |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function render_frontend( $widget_args, $content = '', $context = null ) { |
87 | 87 | |
88 | - if( ! $this->pre_render_frontend() ) { |
|
88 | + if ( ! $this->pre_render_frontend() ) { |
|
89 | 89 | return; |
90 | 90 | } |
91 | 91 | |
92 | - $page_size = (int) \GV\Utils::_GET( 'page_size', $context->view->settings->get( 'page_size' ) ); |
|
92 | + $page_size = (int)\GV\Utils::_GET( 'page_size', $context->view->settings->get( 'page_size' ) ); |
|
93 | 93 | |
94 | 94 | $settings = shortcode_atts( array( |
95 | 95 | 'label' => __( 'Page Size', 'gk-gravityview' ), |
@@ -108,20 +108,20 @@ discard block |
||
108 | 108 | <div class="gv-widget-page-size"> |
109 | 109 | <form method="get" action="<?php echo esc_url( add_query_arg( array() ) ); ?>" onchange="this.submit();"> |
110 | 110 | <div> |
111 | - <?php if( ! empty( $settings['label'] ) ) { ?> |
|
112 | - <label for="gv-page_size"><?php echo esc_html( $settings['label'] ); ?></label> |
|
111 | + <?php if ( ! empty( $settings[ 'label' ] ) ) { ?> |
|
112 | + <label for="gv-page_size"><?php echo esc_html( $settings[ 'label' ] ); ?></label> |
|
113 | 113 | <?php } ?> |
114 | 114 | <select name="page_size" id="gv-page_size"> |
115 | - <option value=""><?php echo esc_html( $settings['default_choice_text'] ); ?></option> |
|
115 | + <option value=""><?php echo esc_html( $settings[ 'default_choice_text' ] ); ?></option> |
|
116 | 116 | <?php |
117 | - foreach ( $settings['choices'] as $choice ) { ?> |
|
118 | - <option value='<?php echo esc_attr( $choice['value'] ); ?>'<?php gv_selected( esc_attr( $choice['value'] ), esc_attr( $page_size ), true ); ?>><?php echo esc_html( $choice['text'] ); ?></option> |
|
117 | + foreach ( $settings[ 'choices' ] as $choice ) { ?> |
|
118 | + <option value='<?php echo esc_attr( $choice[ 'value' ] ); ?>'<?php gv_selected( esc_attr( $choice[ 'value' ] ), esc_attr( $page_size ), true ); ?>><?php echo esc_html( $choice[ 'text' ] ); ?></option> |
|
119 | 119 | <?php } ?> |
120 | 120 | </select> |
121 | 121 | <input type="submit" value="Submit" style="visibility: hidden; position: absolute;" /><?php |
122 | - if( ! empty( $_GET ) ) { |
|
122 | + if ( ! empty( $_GET ) ) { |
|
123 | 123 | $get = $_GET; |
124 | - unset( $get['page_size'] ); |
|
124 | + unset( $get[ 'page_size' ] ); |
|
125 | 125 | foreach ( $get as $key => $value ) { |
126 | 126 | if ( is_array( $value ) ) { |
127 | 127 | foreach ( $value as $_key => $_value ) { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | // Already overridden |
163 | - if ( (int) $page_size === (int) $view->settings->get( 'page_size' ) ) { |
|
163 | + if ( (int)$page_size === (int)$view->settings->get( 'page_size' ) ) { |
|
164 | 164 | return; |
165 | 165 | } |
166 | 166 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | 'view' => $view, |
169 | 169 | ) ); |
170 | 170 | |
171 | - if ( ! in_array( (int) $page_size, wp_list_pluck( self::get_page_sizes( $context ), 'value' ), true ) ) { |
|
171 | + if ( ! in_array( (int)$page_size, wp_list_pluck( self::get_page_sizes( $context ), 'value' ), true ) ) { |
|
172 | 172 | gravityview()->log->warning( 'The passed page size is not allowed: {page_size}. Not modifying result.', array( 'page_size' => $page_size ) ); |
173 | 173 | return; |
174 | 174 | } |
@@ -24,13 +24,13 @@ |
||
24 | 24 | |
25 | 25 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
26 | 26 | |
27 | - unset( $field_options['show_as_link'] ); |
|
27 | + unset( $field_options[ 'show_as_link' ] ); |
|
28 | 28 | |
29 | - if( 'edit' === $context ) { |
|
29 | + if ( 'edit' === $context ) { |
|
30 | 30 | return $field_options; |
31 | 31 | } |
32 | 32 | |
33 | - $this->add_field_support('dynamic_data', $field_options ); |
|
33 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
34 | 34 | |
35 | 35 | return $field_options; |
36 | 36 | } |
@@ -28,13 +28,13 @@ |
||
28 | 28 | |
29 | 29 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
30 | 30 | |
31 | - if( 'edit' === $context ) { |
|
31 | + if ( 'edit' === $context ) { |
|
32 | 32 | return $field_options; |
33 | 33 | } |
34 | 34 | |
35 | - $this->add_field_support('link_to_post', $field_options ); |
|
35 | + $this->add_field_support( 'link_to_post', $field_options ); |
|
36 | 36 | |
37 | - $this->add_field_support('dynamic_data', $field_options ); |
|
37 | + $this->add_field_support( 'dynamic_data', $field_options ); |
|
38 | 38 | |
39 | 39 | return $field_options; |
40 | 40 | } |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | |
36 | 36 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
37 | 37 | |
38 | - if( 'edit' === $context ) { |
|
38 | + if ( 'edit' === $context ) { |
|
39 | 39 | return $field_options; |
40 | 40 | } |
41 | 41 | |
42 | - $this->add_field_support('date_display', $field_options ); |
|
42 | + $this->add_field_support( 'date_display', $field_options ); |
|
43 | 43 | |
44 | 44 | return $field_options; |
45 | 45 | } |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) { |
62 | 62 | |
63 | 63 | /** Overridden by a template. */ |
64 | - if( ! empty( $field['field_path'] ) ) { return $output; } |
|
64 | + if ( ! empty( $field[ 'field_path' ] ) ) { return $output; } |
|
65 | 65 | |
66 | - return GVCommon::format_date( $field['value'], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) ); |
|
66 | + return GVCommon::format_date( $field[ 'value' ], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) ); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * |
82 | 82 | * @return string Original text if {date_created} isn't found. Otherwise, replaced text. |
83 | 83 | */ |
84 | - public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
84 | + public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) { |
|
85 | 85 | |
86 | 86 | $return = $text; |
87 | 87 | |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | |
91 | 91 | foreach ( $matches as $match ) { |
92 | 92 | |
93 | - $full_tag = $match[0]; |
|
94 | - $property = $match[1]; |
|
93 | + $full_tag = $match[ 0 ]; |
|
94 | + $property = $match[ 1 ]; |
|
95 | 95 | |
96 | 96 | $formatted_date = GravityView_Merge_Tags::format_date( $date_created, $property ); |
97 | 97 |
@@ -41,10 +41,10 @@ |
||
41 | 41 | |
42 | 42 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
43 | 43 | |
44 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
44 | + unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ] ); |
|
45 | 45 | |
46 | 46 | // Set the default CSS class to gv-section, which applies a border and top/bottom margin |
47 | - $field_options['custom_class']['value'] = 'gv-section'; |
|
47 | + $field_options[ 'custom_class' ][ 'value' ] = 'gv-section'; |
|
48 | 48 | |
49 | 49 | return $field_options; |
50 | 50 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
29 | 29 | |
30 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
30 | + unset ( $field_options[ 'search_filter' ], $field_options[ 'show_as_link' ] ); |
|
31 | 31 | |
32 | 32 | return $field_options; |
33 | 33 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
33 | 33 | |
34 | - $this->add_field_support('link_to_post', $field_options ); |
|
34 | + $this->add_field_support( 'link_to_post', $field_options ); |
|
35 | 35 | |
36 | 36 | return $field_options; |
37 | 37 | } |
@@ -28,9 +28,9 @@ |
||
28 | 28 | public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { |
29 | 29 | |
30 | 30 | // It makes no sense to use this as the link. |
31 | - unset( $field_options['show_as_link'] ); |
|
31 | + unset( $field_options[ 'show_as_link' ] ); |
|
32 | 32 | |
33 | - if( 'edit' === $context ) { |
|
33 | + if ( 'edit' === $context ) { |
|
34 | 34 | return $field_options; |
35 | 35 | } |
36 | 36 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * @return string If Gravity Flow not found, or entry not processed yet, returns initial value. Otherwise, returns name of workflow step. |
42 | 42 | */ |
43 | 43 | function modify_entry_value_workflow_current_status_timestamp( $output, $entry, $field_settings, $field ) { |
44 | - $timestamp = gform_get_meta( $entry['id'], 'workflow_current_status_timestamp' ); |
|
44 | + $timestamp = gform_get_meta( $entry[ 'id' ], 'workflow_current_status_timestamp' ); |
|
45 | 45 | |
46 | 46 | if ( ! $timestamp ) { |
47 | 47 | return $timestamp; |