@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @return void |
| 38 | 38 | */ |
| 39 | - public function emergency($message, array $context = array()) |
|
| 39 | + public function emergency( $message, array $context = array() ) |
|
| 40 | 40 | { |
| 41 | - $this->log(LogLevel::EMERGENCY, $message, $context); |
|
| 41 | + $this->log( LogLevel::EMERGENCY, $message, $context ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | * |
| 53 | 53 | * @return void |
| 54 | 54 | */ |
| 55 | - public function alert($message, array $context = array()) |
|
| 55 | + public function alert( $message, array $context = array() ) |
|
| 56 | 56 | { |
| 57 | - $this->log(LogLevel::ALERT, $message, $context); |
|
| 57 | + $this->log( LogLevel::ALERT, $message, $context ); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return void |
| 69 | 69 | */ |
| 70 | - public function critical($message, array $context = array()) |
|
| 70 | + public function critical( $message, array $context = array() ) |
|
| 71 | 71 | { |
| 72 | - $this->log(LogLevel::CRITICAL, $message, $context); |
|
| 72 | + $this->log( LogLevel::CRITICAL, $message, $context ); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @return void |
| 83 | 83 | */ |
| 84 | - public function error($message, array $context = array()) |
|
| 84 | + public function error( $message, array $context = array() ) |
|
| 85 | 85 | { |
| 86 | - $this->log(LogLevel::ERROR, $message, $context); |
|
| 86 | + $this->log( LogLevel::ERROR, $message, $context ); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return void |
| 99 | 99 | */ |
| 100 | - public function warning($message, array $context = array()) |
|
| 100 | + public function warning( $message, array $context = array() ) |
|
| 101 | 101 | { |
| 102 | - $this->log(LogLevel::WARNING, $message, $context); |
|
| 102 | + $this->log( LogLevel::WARNING, $message, $context ); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @return void |
| 112 | 112 | */ |
| 113 | - public function notice($message, array $context = array()) |
|
| 113 | + public function notice( $message, array $context = array() ) |
|
| 114 | 114 | { |
| 115 | - $this->log(LogLevel::NOTICE, $message, $context); |
|
| 115 | + $this->log( LogLevel::NOTICE, $message, $context ); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @return void |
| 127 | 127 | */ |
| 128 | - public function info($message, array $context = array()) |
|
| 128 | + public function info( $message, array $context = array() ) |
|
| 129 | 129 | { |
| 130 | - $this->log(LogLevel::INFO, $message, $context); |
|
| 130 | + $this->log( LogLevel::INFO, $message, $context ); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | * |
| 139 | 139 | * @return void |
| 140 | 140 | */ |
| 141 | - public function debug($message, array $context = array()) |
|
| 141 | + public function debug( $message, array $context = array() ) |
|
| 142 | 142 | { |
| 143 | - $this->log(LogLevel::DEBUG, $message, $context); |
|
| 143 | + $this->log( LogLevel::DEBUG, $message, $context ); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @return void |
| 32 | 32 | */ |
| 33 | 33 | public function __set( $key, $value ) { |
| 34 | - $this->_context[$key] = $value; |
|
| 34 | + $this->_context[ $key ] = $value; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @return mixed|null |
| 46 | 46 | */ |
| 47 | 47 | public function __get( $key ) { |
| 48 | - return isset( $this->_context[$key] ) ? $this->_context[$key] : null; |
|
| 48 | + return isset( $this->_context[ $key ] ) ? $this->_context[ $key ] : null; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $supports = array( 'title', 'revisions' ); |
| 87 | 87 | |
| 88 | 88 | if ( $is_hierarchical ) { |
| 89 | - $supports[] = 'page-attributes'; |
|
| 89 | + $supports[ ] = 'page-attributes'; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if ( ! $view->form ) { |
| 198 | 198 | gravityview()->log->error( 'View #{view_id} tried attaching non-existent Form #{form_id} to it.', array( |
| 199 | 199 | 'view_id' => $view->ID, |
| 200 | - 'form_id' => $view->_gravityview_form_id ? : 0, |
|
| 200 | + 'form_id' => $view->_gravityview_form_id ?: 0, |
|
| 201 | 201 | ) ); |
| 202 | 202 | } |
| 203 | 203 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * Add the other keys as they are moved out to ensure we're not using them in core. |
| 349 | 349 | */ |
| 350 | 350 | |
| 351 | - } else if ( ! empty( $GLOBALS['GRAVITYVIEW_TESTS_VIEW_ARRAY_ACCESS_OVERRIDE'] ) ) { |
|
| 351 | + } else if ( ! empty( $GLOBALS[ 'GRAVITYVIEW_TESTS_VIEW_ARRAY_ACCESS_OVERRIDE' ] ) ) { |
|
| 352 | 352 | /** |
| 353 | 353 | * Suppress exception if specifically testing for array acess. |
| 354 | 354 | */ |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | - if ( ! isset( $this[$offset] ) ) { |
|
| 364 | + if ( ! isset( $this[ $offset ] ) ) { |
|
| 365 | 365 | return null; |
| 366 | 366 | } |
| 367 | 367 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | return $this->template ? $this->template->ID : null; |
| 380 | 380 | default: |
| 381 | 381 | /** @todo move the rest out and get rid of _data completely! */ |
| 382 | - return $this->_data[$offset]; |
|
| 382 | + return $this->_data[ $offset ]; |
|
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | array( 'form' => $this->form ? gravityview_get_form( $this->form->ID ) : null ), |
| 431 | 431 | array( 'atts' => $this->settings->as_atts() ), |
| 432 | 432 | array( 'fields' => $this->fields->by_visible()->as_configuration() ), |
| 433 | - array( 'template_id' => $this->template? $this->template->ID : null ), |
|
| 433 | + array( 'template_id' => $this->template ? $this->template->ID : null ), |
|
| 434 | 434 | $this->_data |
| 435 | 435 | ); |
| 436 | 436 | } |
@@ -55,10 +55,10 @@ |
||
| 55 | 55 | $search_criteria[ $key ] = $field_filters; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if ( ! empty( $b[ $key ]['mode'] ) ) { |
|
| 59 | - $search_criteria[ $key ]['mode' ] = $b[ $key ]['mode']; |
|
| 60 | - } else if ( ! empty( $a[ $key ]['mode'] ) ) { |
|
| 61 | - $search_criteria[ $key ]['mode' ] = $a[ $key ]['mode']; |
|
| 58 | + if ( ! empty( $b[ $key ][ 'mode' ] ) ) { |
|
| 59 | + $search_criteria[ $key ][ 'mode' ] = $b[ $key ][ 'mode' ]; |
|
| 60 | + } else if ( ! empty( $a[ $key ][ 'mode' ] ) ) { |
|
| 61 | + $search_criteria[ $key ][ 'mode' ] = $a[ $key ][ 'mode' ]; |
|
| 62 | 62 | } |
| 63 | 63 | break; |
| 64 | 64 | case 'start_date': |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public static function by_id( $form_id ) { |
| 44 | 44 | $form = \GFAPI::get_form( $form_id ); |
| 45 | - if ( !$form ) { |
|
| 45 | + if ( ! $form ) { |
|
| 46 | 46 | return null; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $self = new self(); |
| 50 | 50 | $self->form = $form; |
| 51 | 51 | |
| 52 | - $self->ID = $self->form['id']; |
|
| 52 | + $self->ID = $self->form[ 'id' ]; |
|
| 53 | 53 | |
| 54 | 54 | return $self; |
| 55 | 55 | } |
@@ -91,15 +91,15 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | /** The offset and limit */ |
| 93 | 93 | if ( ! empty( $offset->limit ) ) { |
| 94 | - $paging['page_size'] = $offset->limit; |
|
| 94 | + $paging[ 'page_size' ] = $offset->limit; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if ( ! empty( $offset->offset ) ) { |
| 98 | - $paging['offset'] = $offset->offset; |
|
| 98 | + $paging[ 'offset' ] = $offset->offset; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | foreach ( \GFAPI::get_entries( $form->ID, $search_criteria, $sorting, $paging ) as $entry ) { |
| 102 | - $entries->add( \GV\GF_Entry::by_id( $entry['id'] ) ); |
|
| 102 | + $entries->add( \GV\GF_Entry::by_id( $entry[ 'id' ] ) ); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | return $entries; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * @return bool Whether the offset exists or not. |
| 132 | 132 | */ |
| 133 | 133 | public function offsetExists( $offset ) { |
| 134 | - return isset( $this->form[$offset] ); |
|
| 134 | + return isset( $this->form[ $offset ] ); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @return mixed The value of the requested form data. |
| 149 | 149 | */ |
| 150 | 150 | public function offsetGet( $offset ) { |
| 151 | - return $this->form[$offset]; |
|
| 151 | + return $this->form[ $offset ]; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public static function by_id( $entry_id ) { |
| 44 | 44 | $entry = \GFAPI::get_entry( $entry_id ); |
| 45 | - if ( !$entry ) { |
|
| 45 | + if ( ! $entry ) { |
|
| 46 | 46 | return null; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | $self = new self(); |
| 50 | 50 | $self->entry = $entry; |
| 51 | 51 | |
| 52 | - $self->ID = $self->entry['id']; |
|
| 52 | + $self->ID = $self->entry[ 'id' ]; |
|
| 53 | 53 | |
| 54 | 54 | return $self; |
| 55 | 55 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @return bool Whether the offset exists or not. |
| 64 | 64 | */ |
| 65 | 65 | public function offsetExists( $offset ) { |
| 66 | - return isset( $this->entry[$offset] ); |
|
| 66 | + return isset( $this->entry[ $offset ] ); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * @return mixed The value of the requested entry data. |
| 81 | 81 | */ |
| 82 | 82 | public function offsetGet( $offset ) { |
| 83 | - return $this->entry[$offset]; |
|
| 83 | + return $this->entry[ $offset ]; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | $default_settings = apply_filters( 'gravityview_default_args', array( |
| 41 | 41 | 'id' => array( |
| 42 | - 'label' => __('View ID', 'gravityview'), |
|
| 42 | + 'label' => __( 'View ID', 'gravityview' ), |
|
| 43 | 43 | 'type' => 'number', |
| 44 | 44 | 'group' => 'default', |
| 45 | 45 | 'value' => NULL, |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | 'show_in_shortcode' => false, |
| 48 | 48 | ), |
| 49 | 49 | 'page_size' => array( |
| 50 | - 'label' => __('Number of entries per page', 'gravityview'), |
|
| 50 | + 'label' => __( 'Number of entries per page', 'gravityview' ), |
|
| 51 | 51 | 'type' => 'number', |
| 52 | 52 | 'class' => 'small-text', |
| 53 | 53 | 'group' => 'default', |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'show_in_shortcode' => true, |
| 56 | 56 | ), |
| 57 | 57 | 'offset' => array( |
| 58 | - 'label' => __('Offset entries starting from', 'gravityview'), |
|
| 58 | + 'label' => __( 'Offset entries starting from', 'gravityview' ), |
|
| 59 | 59 | 'type' => 'number', |
| 60 | 60 | 'class' => 'small-text', |
| 61 | 61 | 'group' => 'default', |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | ), |
| 80 | 80 | 'admin_show_all_statuses' => array( |
| 81 | 81 | 'label' => __( 'Show all entries to administrators', 'gravityview' ), |
| 82 | - 'desc' => __('Administrators will be able to see entries with any approval status.', 'gravityview'), |
|
| 83 | - 'tooltip' => __('Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview'), |
|
| 82 | + 'desc' => __( 'Administrators will be able to see entries with any approval status.', 'gravityview' ), |
|
| 83 | + 'tooltip' => __( 'Logged-out visitors and non-administrators will only see approved entries, while administrators will see entries with all statuses. This makes it easier for administrators to moderate entries from a View.', 'gravityview' ), |
|
| 84 | 84 | 'requires' => 'show_only_approved', |
| 85 | 85 | 'type' => 'checkbox', |
| 86 | 86 | 'group' => 'default', |
@@ -105,40 +105,40 @@ discard block |
||
| 105 | 105 | 'user_edit' => array( |
| 106 | 106 | 'label' => __( 'Allow User Edit', 'gravityview' ), |
| 107 | 107 | 'group' => 'default', |
| 108 | - 'desc' => __('Allow logged-in users to edit entries they created.', 'gravityview'), |
|
| 108 | + 'desc' => __( 'Allow logged-in users to edit entries they created.', 'gravityview' ), |
|
| 109 | 109 | 'value' => 0, |
| 110 | - 'tooltip' => __('Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview'), |
|
| 110 | + 'tooltip' => __( 'Display "Edit Entry" fields to non-administrator users if they created the entry. Edit Entry fields will always be displayed to site administrators.', 'gravityview' ), |
|
| 111 | 111 | 'type' => 'checkbox', |
| 112 | 112 | 'show_in_shortcode' => true, |
| 113 | 113 | ), |
| 114 | 114 | 'user_delete' => array( |
| 115 | 115 | 'label' => __( 'Allow User Delete', 'gravityview' ), |
| 116 | 116 | 'group' => 'default', |
| 117 | - 'desc' => __('Allow logged-in users to delete entries they created.', 'gravityview'), |
|
| 117 | + 'desc' => __( 'Allow logged-in users to delete entries they created.', 'gravityview' ), |
|
| 118 | 118 | 'value' => 0, |
| 119 | - 'tooltip' => __('Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview'), |
|
| 119 | + 'tooltip' => __( 'Display "Delete Entry" fields to non-administrator users if they created the entry. Delete Entry fields will always be displayed to site administrators.', 'gravityview' ), |
|
| 120 | 120 | 'type' => 'checkbox', |
| 121 | 121 | 'show_in_shortcode' => true, |
| 122 | 122 | ), |
| 123 | 123 | 'sort_field' => array( |
| 124 | - 'label' => __('Sort by field', 'gravityview'), |
|
| 124 | + 'label' => __( 'Sort by field', 'gravityview' ), |
|
| 125 | 125 | 'type' => 'select', |
| 126 | 126 | 'value' => '', |
| 127 | 127 | 'group' => 'sort', |
| 128 | 128 | 'options' => array( |
| 129 | - '' => __( 'Default', 'gravityview'), |
|
| 130 | - 'date_created' => __( 'Date Created', 'gravityview'), |
|
| 129 | + '' => __( 'Default', 'gravityview' ), |
|
| 130 | + 'date_created' => __( 'Date Created', 'gravityview' ), |
|
| 131 | 131 | ), |
| 132 | 132 | 'show_in_shortcode' => true, |
| 133 | 133 | ), |
| 134 | 134 | 'sort_direction' => array( |
| 135 | - 'label' => __('Sort direction', 'gravityview'), |
|
| 135 | + 'label' => __( 'Sort direction', 'gravityview' ), |
|
| 136 | 136 | 'type' => 'select', |
| 137 | 137 | 'value' => 'ASC', |
| 138 | 138 | 'group' => 'sort', |
| 139 | 139 | 'options' => array( |
| 140 | - 'ASC' => __('ASC', 'gravityview'), |
|
| 141 | - 'DESC' => __('DESC', 'gravityview'), |
|
| 140 | + 'ASC' => __( 'ASC', 'gravityview' ), |
|
| 141 | + 'DESC' => __( 'DESC', 'gravityview' ), |
|
| 142 | 142 | //'RAND' => __('Random', 'gravityview'), |
| 143 | 143 | ), |
| 144 | 144 | 'show_in_shortcode' => true, |
@@ -154,69 +154,69 @@ discard block |
||
| 154 | 154 | 'show_in_template' => array( 'default_table' ), |
| 155 | 155 | ), |
| 156 | 156 | 'start_date' => array( |
| 157 | - 'label' => __('Filter by Start Date', 'gravityview'), |
|
| 157 | + 'label' => __( 'Filter by Start Date', 'gravityview' ), |
|
| 158 | 158 | 'class' => 'gv-datepicker', |
| 159 | - 'desc' => __('Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ), |
|
| 159 | + 'desc' => __( 'Show entries submitted after this date. Supports relative dates, such as "-1 week" or "-1 month".', 'gravityview' ), |
|
| 160 | 160 | 'type' => 'text', |
| 161 | 161 | 'value' => '', |
| 162 | 162 | 'group' => 'filter', |
| 163 | 163 | 'show_in_shortcode' => true, |
| 164 | 164 | ), |
| 165 | 165 | 'end_date' => array( |
| 166 | - 'label' => __('Filter by End Date', 'gravityview'), |
|
| 166 | + 'label' => __( 'Filter by End Date', 'gravityview' ), |
|
| 167 | 167 | 'class' => 'gv-datepicker', |
| 168 | - 'desc' => __('Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ), |
|
| 168 | + 'desc' => __( 'Show entries submitted before this date. Supports relative dates, such as "now" or "-3 days".', 'gravityview' ), |
|
| 169 | 169 | 'type' => 'text', |
| 170 | 170 | 'value' => '', |
| 171 | 171 | 'group' => 'filter', |
| 172 | 172 | 'show_in_shortcode' => true, |
| 173 | 173 | ), |
| 174 | 174 | 'class' => array( |
| 175 | - 'label' => __('CSS Class', 'gravityview'), |
|
| 176 | - 'desc' => __('CSS class to add to the wrapping HTML container.', 'gravityview'), |
|
| 175 | + 'label' => __( 'CSS Class', 'gravityview' ), |
|
| 176 | + 'desc' => __( 'CSS class to add to the wrapping HTML container.', 'gravityview' ), |
|
| 177 | 177 | 'group' => 'default', |
| 178 | 178 | 'type' => 'text', |
| 179 | 179 | 'value' => '', |
| 180 | 180 | 'show_in_shortcode' => false, |
| 181 | 181 | ), |
| 182 | 182 | 'search_value' => array( |
| 183 | - 'label' => __('Search Value', 'gravityview'), |
|
| 184 | - 'desc' => __('Define a default search value for the View', 'gravityview'), |
|
| 183 | + 'label' => __( 'Search Value', 'gravityview' ), |
|
| 184 | + 'desc' => __( 'Define a default search value for the View', 'gravityview' ), |
|
| 185 | 185 | 'type' => 'text', |
| 186 | 186 | 'value' => '', |
| 187 | 187 | 'group' => 'filter', |
| 188 | 188 | 'show_in_shortcode' => false, |
| 189 | 189 | ), |
| 190 | 190 | 'search_field' => array( |
| 191 | - 'label' => __('Search Field', 'gravityview'), |
|
| 192 | - 'desc' => __('If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview'), |
|
| 191 | + 'label' => __( 'Search Field', 'gravityview' ), |
|
| 192 | + 'desc' => __( 'If Search Value is set, you can define a specific field to search in. Otherwise, all fields will be searched.', 'gravityview' ), |
|
| 193 | 193 | 'type' => 'number', |
| 194 | 194 | 'value' => '', |
| 195 | 195 | 'group' => 'filter', |
| 196 | 196 | 'show_in_shortcode' => false, |
| 197 | 197 | ), |
| 198 | 198 | 'single_title' => array( |
| 199 | - 'label' => __('Single Entry Title', 'gravityview'), |
|
| 199 | + 'label' => __( 'Single Entry Title', 'gravityview' ), |
|
| 200 | 200 | 'type' => 'text', |
| 201 | - 'desc' => __('When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview'), |
|
| 201 | + 'desc' => __( 'When viewing a single entry, change the title of the page to this setting. Otherwise, the title will not change between the Multiple Entries and Single Entry views.', 'gravityview' ), |
|
| 202 | 202 | 'group' => 'default', |
| 203 | 203 | 'value' => '', |
| 204 | 204 | 'show_in_shortcode' => false, |
| 205 | 205 | 'full_width' => true, |
| 206 | 206 | ), |
| 207 | 207 | 'back_link_label' => array( |
| 208 | - 'label' => __('Back Link Label', 'gravityview'), |
|
| 208 | + 'label' => __( 'Back Link Label', 'gravityview' ), |
|
| 209 | 209 | 'group' => 'default', |
| 210 | - 'desc' => __('The text of the link that returns to the multiple entries view.', 'gravityview'), |
|
| 210 | + 'desc' => __( 'The text of the link that returns to the multiple entries view.', 'gravityview' ), |
|
| 211 | 211 | 'type' => 'text', |
| 212 | 212 | 'value' => '', |
| 213 | 213 | 'show_in_shortcode' => false, |
| 214 | 214 | 'full_width' => true, |
| 215 | 215 | ), |
| 216 | 216 | 'embed_only' => array( |
| 217 | - 'label' => __('Prevent Direct Access', 'gravityview'), |
|
| 217 | + 'label' => __( 'Prevent Direct Access', 'gravityview' ), |
|
| 218 | 218 | 'group' => 'default', |
| 219 | - 'desc' => __('Only allow access to this View when embedded using the shortcode.', 'gravityview'), |
|
| 219 | + 'desc' => __( 'Only allow access to this View when embedded using the shortcode.', 'gravityview' ), |
|
| 220 | 220 | 'type' => 'checkbox', |
| 221 | 221 | 'value' => '', |
| 222 | 222 | 'show_in_shortcode' => false, |
@@ -238,19 +238,19 @@ discard block |
||
| 238 | 238 | // By default, we only want the key => value pairing, not the whole array. |
| 239 | 239 | if ( ! $detailed ) { |
| 240 | 240 | $defaults = array(); |
| 241 | - foreach( $default_settings as $key => $value ) { |
|
| 242 | - $defaults[ $key ] = $value['value']; |
|
| 241 | + foreach ( $default_settings as $key => $value ) { |
|
| 242 | + $defaults[ $key ] = $value[ 'value' ]; |
|
| 243 | 243 | } |
| 244 | 244 | return $defaults; |
| 245 | 245 | |
| 246 | 246 | // But sometimes, we want all the details. |
| 247 | 247 | } else { |
| 248 | - foreach ($default_settings as $key => $value) { |
|
| 248 | + foreach ( $default_settings as $key => $value ) { |
|
| 249 | 249 | |
| 250 | 250 | // If the $group argument is set for the method, |
| 251 | 251 | // ignore any settings that aren't in that group. |
| 252 | 252 | if ( ! empty( $group ) && is_string( $group ) ) { |
| 253 | - if ( empty( $value['group'] ) || $value['group'] !== $group ) { |
|
| 253 | + if ( empty( $value[ 'group' ] ) || $value[ 'group' ] !== $group ) { |
|
| 254 | 254 | unset( $default_settings[ $key ] ); |
| 255 | 255 | } |
| 256 | 256 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | 28 | public function set( $key, $value ) { |
| 29 | - $this->settings[$key] = $value; |
|
| 29 | + $this->settings[ $key ] = $value; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @return mixed|null |
| 41 | 41 | */ |
| 42 | 42 | public function get( $key, $default = null ) { |
| 43 | - return isset( $this->settings[$key] ) ? $this->settings[$key] : $default; |
|
| 43 | + return isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : $default; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -144,19 +144,19 @@ |
||
| 144 | 144 | public function from_configuration( $configuration ) { |
| 145 | 145 | $configuration = wp_parse_args( $configuration, $this->as_configuration() ); |
| 146 | 146 | |
| 147 | - $this->ID = $configuration['id']; |
|
| 148 | - $this->label = $configuration['label']; |
|
| 149 | - $this->show_label = $configuration['show_label'] == '1'; |
|
| 150 | - $this->custom_label = $configuration['custom_label']; |
|
| 151 | - $this->custom_class = $configuration['custom_class']; |
|
| 152 | - $this->cap = $configuration['only_loggedin'] == '1' ? $configuration['only_loggedin_cap'] : ''; |
|
| 153 | - $this->search_filter = $configuration['search_filter'] == '1'; |
|
| 154 | - $this->show_as_link = $configuration['show_as_link'] == '1'; |
|
| 147 | + $this->ID = $configuration[ 'id' ]; |
|
| 148 | + $this->label = $configuration[ 'label' ]; |
|
| 149 | + $this->show_label = $configuration[ 'show_label' ] == '1'; |
|
| 150 | + $this->custom_label = $configuration[ 'custom_label' ]; |
|
| 151 | + $this->custom_class = $configuration[ 'custom_class' ]; |
|
| 152 | + $this->cap = $configuration[ 'only_loggedin' ] == '1' ? $configuration[ 'only_loggedin_cap' ] : ''; |
|
| 153 | + $this->search_filter = $configuration[ 'search_filter' ] == '1'; |
|
| 154 | + $this->show_as_link = $configuration[ 'show_as_link' ] == '1'; |
|
| 155 | 155 | |
| 156 | 156 | /** Shared among all field types (sort of). */ |
| 157 | 157 | $shared_configuration_keys = array( |
| 158 | 158 | 'id', 'label', 'show_label', 'custom_label', 'custom_class', |
| 159 | - 'only_loggedin' ,'only_loggedin_cap', 'search_filter', 'show_as_link', |
|
| 159 | + 'only_loggedin', 'only_loggedin_cap', 'search_filter', 'show_as_link', |
|
| 160 | 160 | ); |
| 161 | 161 | |
| 162 | 162 | /** Everything else goes into the properties for now. @todo subclasses! */ |