@@ -328,34 +328,34 @@ discard block |
||
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | /** |
| 331 | - * Get the fields for a specific context |
|
| 332 | - * |
|
| 333 | - * @since 1.19.2 |
|
| 334 | - * |
|
| 331 | + * Get the fields for a specific context |
|
| 332 | + * |
|
| 333 | + * @since 1.19.2 |
|
| 334 | + * |
|
| 335 | 335 | * @param string $context [Optional] "directory", "single", or "edit" |
| 336 | 336 | * |
| 337 | 337 | * @return array Array of GravityView field layout configurations |
| 338 | 338 | */ |
| 339 | 339 | public function getContextFields( $context = '' ) { |
| 340 | 340 | |
| 341 | - if( '' === $context ) { |
|
| 342 | - $context = $this->getContext(); |
|
| 343 | - } |
|
| 341 | + if( '' === $context ) { |
|
| 342 | + $context = $this->getContext(); |
|
| 343 | + } |
|
| 344 | 344 | |
| 345 | 345 | $fields = $this->getFields(); |
| 346 | 346 | |
| 347 | - foreach ( (array) $fields as $key => $context_fields ) { |
|
| 347 | + foreach ( (array) $fields as $key => $context_fields ) { |
|
| 348 | 348 | |
| 349 | - // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
|
| 350 | - $matches = explode( '_', $key ); |
|
| 349 | + // Formatted as `{context}_{template id}-{zone name}`, so we want just the $context to match against |
|
| 350 | + $matches = explode( '_', $key ); |
|
| 351 | 351 | |
| 352 | - if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 353 | - return $context_fields; |
|
| 354 | - } |
|
| 355 | - } |
|
| 352 | + if( isset( $matches[0] ) && $matches[0] === $context ) { |
|
| 353 | + return $context_fields; |
|
| 354 | + } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | 357 | return array(); |
| 358 | - } |
|
| 358 | + } |
|
| 359 | 359 | |
| 360 | 360 | /** |
| 361 | 361 | * @param array $fields |
@@ -448,10 +448,10 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function getPaging() { |
| 450 | 450 | |
| 451 | - $default_params = array( |
|
| 452 | - 'offset' => 0, |
|
| 453 | - 'page_size' => 20, |
|
| 454 | - ); |
|
| 451 | + $default_params = array( |
|
| 452 | + 'offset' => 0, |
|
| 453 | + 'page_size' => 20, |
|
| 454 | + ); |
|
| 455 | 455 | |
| 456 | 456 | return wp_parse_args( $this->paging, $default_params ); |
| 457 | 457 | } |
@@ -508,10 +508,10 @@ discard block |
||
| 508 | 508 | public function getSorting() { |
| 509 | 509 | |
| 510 | 510 | $defaults_params = array( |
| 511 | - 'sort_field' => 'date_created', |
|
| 512 | - 'sort_direction' => 'ASC', |
|
| 513 | - 'is_numeric' => false, |
|
| 514 | - ); |
|
| 511 | + 'sort_field' => 'date_created', |
|
| 512 | + 'sort_direction' => 'ASC', |
|
| 513 | + 'is_numeric' => false, |
|
| 514 | + ); |
|
| 515 | 515 | |
| 516 | 516 | return wp_parse_args( $this->sorting, $defaults_params ); |
| 517 | 517 | } |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | */ |
| 838 | 838 | public function render_widget_hooks( $view_id_or_context ) { |
| 839 | 839 | |
| 840 | - /** |
|
| 840 | + /** |
|
| 841 | 841 | * @deprecated Numeric argument is deprecated. Pass a \GV\Template_Context instead. |
| 842 | 842 | */ |
| 843 | 843 | if ( is_numeric( $view_id_or_context ) ) { |
@@ -175,10 +175,10 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | if( 'gv_note_add' === $_POST['action'] ) { |
| 177 | 177 | |
| 178 | - if( ! GVCommon::has_cap( 'gravityview_add_entry_notes' ) ) { |
|
| 179 | - do_action( 'gravityview_log_error', __METHOD__ . ': The user isnt allowed to add entry notes.' ); |
|
| 180 | - return; |
|
| 181 | - } |
|
| 178 | + if( ! GVCommon::has_cap( 'gravityview_add_entry_notes' ) ) { |
|
| 179 | + do_action( 'gravityview_log_error', __METHOD__ . ': The user isnt allowed to add entry notes.' ); |
|
| 180 | + return; |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | 183 | $post = wp_unslash( $_POST ); |
| 184 | 184 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | * |
| 279 | 279 | * Verify permissions. Check expected $_POST. Parse args, then send to process_delete_notes |
| 280 | 280 | * |
| 281 | - * @since 1.17 |
|
| 281 | + * @since 1.17 |
|
| 282 | 282 | * |
| 283 | 283 | * @see process_delete_notes |
| 284 | 284 | * |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | 'subject-label' => __( 'Subject', 'gravityview' ), |
| 432 | 432 | 'subject' => __( 'Email subject', 'gravityview' ), |
| 433 | 433 | 'default-email-subject' => __( 'New entry note', 'gravityview' ), |
| 434 | - 'email-footer' => __( 'This note was sent from {url}', 'gravityview' ), |
|
| 434 | + 'email-footer' => __( 'This note was sent from {url}', 'gravityview' ), |
|
| 435 | 435 | 'also-email' => __( 'Also email this note to', 'gravityview' ), |
| 436 | 436 | 'error-add-note' => __( 'There was an error adding the note.', 'gravityview' ), |
| 437 | 437 | 'error-invalid' => __( 'The request was invalid. Refresh the page and try again.', 'gravityview' ), |
@@ -501,11 +501,11 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | if ( $context instanceof \GV\Template_Context ) { |
| 503 | 503 | |
| 504 | - ob_start(); |
|
| 505 | - $context->template->get_template_part( 'note', 'detail', true ); |
|
| 506 | - $note_detail_html = ob_get_clean(); |
|
| 504 | + ob_start(); |
|
| 505 | + $context->template->get_template_part( 'note', 'detail', true ); |
|
| 506 | + $note_detail_html = ob_get_clean(); |
|
| 507 | 507 | |
| 508 | - ob_start(); |
|
| 508 | + ob_start(); |
|
| 509 | 509 | $context->template->get_template_part( 'note', $note_row_template, true ); |
| 510 | 510 | $note_row = ob_get_clean(); |
| 511 | 511 | } else { |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | 'gv-note-to-custom' => '', |
| 762 | 762 | 'gv-note-subject' => '', |
| 763 | 763 | 'gv-note-content' => '', |
| 764 | - 'current-url' => '', |
|
| 764 | + 'current-url' => '', |
|
| 765 | 765 | ); |
| 766 | 766 | |
| 767 | 767 | $current_user = wp_get_current_user(); |
@@ -813,9 +813,9 @@ discard block |
||
| 813 | 813 | $message .= $this->get_email_footer( $email_footer, $is_html, $email_data ); |
| 814 | 814 | |
| 815 | 815 | /** |
| 816 | - * @filter `gravityview/field/notes/wpautop_email` Should the message content have paragraphs added automatically, if using HTML message format |
|
| 816 | + * @filter `gravityview/field/notes/wpautop_email` Should the message content have paragraphs added automatically, if using HTML message format |
|
| 817 | 817 | * @since 1.18 |
| 818 | - * @param bool $wpautop_email True: Apply wpautop() to the email message if using; False: Leave as entered (Default: true) |
|
| 818 | + * @param bool $wpautop_email True: Apply wpautop() to the email message if using; False: Leave as entered (Default: true) |
|
| 819 | 819 | */ |
| 820 | 820 | $wpautop_email = apply_filters( 'gravityview/field/notes/wpautop_email', true ); |
| 821 | 821 | |
@@ -835,12 +835,12 @@ discard block |
||
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | /** |
| 838 | - * Get the footer for Entry Note emails |
|
| 839 | - * |
|
| 840 | - * `{url}` is replaced by the URL of the page where the note form was embedded |
|
| 841 | - * |
|
| 842 | - * @since 1.18 |
|
| 843 | - * @see GravityView_Field_Notes::strings The default value of $message_footer is set here, with the key 'email-footer' |
|
| 838 | + * Get the footer for Entry Note emails |
|
| 839 | + * |
|
| 840 | + * `{url}` is replaced by the URL of the page where the note form was embedded |
|
| 841 | + * |
|
| 842 | + * @since 1.18 |
|
| 843 | + * @see GravityView_Field_Notes::strings The default value of $message_footer is set here, with the key 'email-footer' |
|
| 844 | 844 | * |
| 845 | 845 | * @param string $email_footer The message footer value |
| 846 | 846 | * @param bool $is_html True: Email is being sent as HTML; False: sent as text |
@@ -849,10 +849,10 @@ discard block |
||
| 849 | 849 | */ |
| 850 | 850 | private function get_email_footer( $email_footer = '', $is_html = true, $email_data = array() ) { |
| 851 | 851 | |
| 852 | - $output = ''; |
|
| 852 | + $output = ''; |
|
| 853 | 853 | |
| 854 | 854 | if( ! empty( $email_footer ) ) { |
| 855 | - $url = \GV\Utils::get( $email_data, 'current-url' ); |
|
| 855 | + $url = \GV\Utils::get( $email_data, 'current-url' ); |
|
| 856 | 856 | $url = html_entity_decode( $url ); |
| 857 | 857 | $url = site_url( $url ); |
| 858 | 858 | |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Constructor. Add filters to modify output. |
|
| 23 | - * |
|
| 22 | + * Constructor. Add filters to modify output. |
|
| 23 | + * |
|
| 24 | 24 | * @since 2.0.4 |
| 25 | 25 | * |
| 26 | 26 | * @param View $view |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function __construct( View $view, Entry_Collection $entries, Request $request ) { |
| 31 | 31 | |
| 32 | - add_filter( 'gravityview/template/field/label', array( $this, 'add_columns_sort_links' ), 100, 2 ); |
|
| 32 | + add_filter( 'gravityview/template/field/label', array( $this, 'add_columns_sort_links' ), 100, 2 ); |
|
| 33 | 33 | |
| 34 | 34 | parent::__construct( $view, $entries, $request ); |
| 35 | 35 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Add sorting links to HTML columns that support sorting |
|
| 49 | - * |
|
| 50 | - * @since 2.0.4 |
|
| 51 | - * |
|
| 48 | + * Add sorting links to HTML columns that support sorting |
|
| 49 | + * |
|
| 50 | + * @since 2.0.4 |
|
| 51 | + * |
|
| 52 | 52 | * @param string $column_label Label for the table column |
| 53 | 53 | * @param \GV\Template_Context $context |
| 54 | 54 | * |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $sort_columns = $context->view->settings->get( 'sort_columns' ); |
| 60 | 60 | |
| 61 | 61 | if ( empty( $sort_columns ) ) { |
| 62 | - return $column_label; |
|
| 62 | + return $column_label; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if ( ! \GravityView_frontend::getInstance()->is_field_sortable( $context->field->ID, $context->view->form->form ) ) { |
@@ -200,15 +200,15 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | do_action( 'gravityview/template/table/cells/before', $context ); |
| 202 | 202 | |
| 203 | - /** |
|
| 204 | - * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 205 | - * @since 1.0.7 |
|
| 203 | + /** |
|
| 204 | + * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 205 | + * @since 1.0.7 |
|
| 206 | 206 | * @param GravityView_View $this Current GravityView_View object |
| 207 | 207 | * @deprecated Use `gravityview/template/table/cells/before` |
| 208 | - */ |
|
| 209 | - do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
| 208 | + */ |
|
| 209 | + do_action( 'gravityview_table_cells_before', \GravityView_View::getInstance() ); |
|
| 210 | 210 | |
| 211 | - foreach ( $fields->all() as $field ) { |
|
| 211 | + foreach ( $fields->all() as $field ) { |
|
| 212 | 212 | $this->the_field( $field, $entry ); |
| 213 | 213 | } |
| 214 | 214 | |
@@ -219,13 +219,13 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | do_action( 'gravityview/template/table/cells/after', $context ); |
| 221 | 221 | |
| 222 | - /** |
|
| 223 | - * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 224 | - * @since 1.0.7 |
|
| 222 | + /** |
|
| 223 | + * @action `gravityview_table_cells_after` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells. |
|
| 224 | + * @since 1.0.7 |
|
| 225 | 225 | * @param GravityView_View $this Current GravityView_View object |
| 226 | 226 | * @deprecated Use `gravityview/template/table/cells/after` |
| 227 | - */ |
|
| 228 | - do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
| 227 | + */ |
|
| 228 | + do_action( 'gravityview_table_cells_after', \GravityView_View::getInstance() ); |
|
| 229 | 229 | |
| 230 | 230 | ?> |
| 231 | 231 | </tr> |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | 'hide_empty' => false, |
| 263 | 263 | 'zone_id' => 'directory_table-columns', |
| 264 | 264 | 'markup' => '<td id="{{ field_id }}" class="{{ class }}">{{ value }}</td>', |
| 265 | - 'form' => $form, |
|
| 265 | + 'form' => $form, |
|
| 266 | 266 | ); |
| 267 | 267 | |
| 268 | 268 | /** Output. */ |
@@ -287,11 +287,11 @@ discard block |
||
| 287 | 287 | do_action( 'gravityview/template/table/body/before', $context ); |
| 288 | 288 | |
| 289 | 289 | /** |
| 290 | - * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
| 291 | - * @deprecated Use `gravityview/template/table/body/before` |
|
| 292 | - * @since 1.0.7 |
|
| 293 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 294 | - */ |
|
| 290 | + * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows. |
|
| 291 | + * @deprecated Use `gravityview/template/table/body/before` |
|
| 292 | + * @since 1.0.7 |
|
| 293 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 294 | + */ |
|
| 295 | 295 | do_action( 'gravityview_table_body_before', \GravityView_View::getInstance() /** ugh! */ ); |
| 296 | 296 | } |
| 297 | 297 | |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | do_action( 'gravityview/template/table/body/after', $context ); |
| 314 | 314 | |
| 315 | 315 | /** |
| 316 | - * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
| 317 | - * @deprecated Use `gravityview/template/table/body/after` |
|
| 318 | - * @since 1.0.7 |
|
| 319 | - * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 320 | - */ |
|
| 316 | + * @action `gravityview_table_body_after` Inside the `tbody`, after any rows are rendered. Can be used to insert additional rows. |
|
| 317 | + * @deprecated Use `gravityview/template/table/body/after` |
|
| 318 | + * @since 1.0.7 |
|
| 319 | + * @param \GravityView_View $gravityview_view Current GravityView_View object. |
|
| 320 | + */ |
|
| 321 | 321 | do_action( 'gravityview_table_body_after', \GravityView_View::getInstance() /** ugh! */ ); |
| 322 | 322 | } |
| 323 | 323 | |