From 3dd5dc3bc2f5434fb882e3ac3260ebf12d0dc7fb Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Thu, 15 Jul 2021 16:25:14 -0400 Subject: [PATCH 01/24] Start work on #1180 Add Read Status support --- .../class-gravityview-field-is-read.php | 138 ++++++++++++++++++ .../search-widget/class-search-widget.php | 14 ++ 2 files changed, 152 insertions(+) create mode 100644 includes/fields/class-gravityview-field-is-read.php diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php new file mode 100644 index 0000000000..854368c6d8 --- /dev/null +++ b/includes/fields/class-gravityview-field-is-read.php @@ -0,0 +1,138 @@ +label = esc_html__( 'Read Status', 'gravityview' ); + $this->default_search_label = __( 'Is Read', 'gravityview' ); + $this->description = esc_html__( 'Display whether the entry has been read.', 'gravityview' ); + + $this->add_hooks(); + + parent::__construct(); + } + + private function add_hooks() { + /** @see \GV\Field::get_value_filters */ + add_filter( "gravityview/field/{$this->name}/value", array( $this, 'get_value' ), 10, 6 ); + } + + public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { + + $field_options['is_read_label'] = array( + 'type' => 'text', + 'label' => __( 'Read Label', 'gravityview' ), + 'desc' => __( 'If the entry has been read, display this value', 'gravityview' ), + 'placeholder' => __('Read', 'gravityview' ), + ); + + $field_options['is_unread_label'] = array( + 'type' => 'text', + 'label' => __( 'Unread Label', 'gravityview' ), + 'desc' => __( 'If the entry has not been read, display this value', 'gravityview' ), + 'placeholder' => __('Unread', 'gravityview' ), + ); + + return $field_options; + } + + /** + * Display the value based on the field settings + * + * @since 2.0 + * + * @param string $value The value. + * @param \GV\Field The field we're doing this for. + * @param \GV\View $view The view for this context if applicable. + * @param \GV\Source $source The source (form) for this context if applicable. + * @param \GV\Entry $entry The entry for this context if applicable. + * @param \GV\Request $request The request for this context if applicable. + * + * @return string Image of the star + */ + public function get_value( $value, $field, $view, $source, $entry, $request ) { + + if ( empty( $value ) ) { + return \GV\Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gravityview') ); + } + + return \GV\Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gravityview') ); + } + + + /** + * Add JS to the bottom of the View if there is a star field and user has `gravityview_edit_entries` cap + * + * @param \GV\Template_Context $context The template context + * @since 2.0 + * + * @return void + */ + public function print_script( $context ) { + return; + if ( ! GravityView_Roles_Capabilities::has_cap( 'gravityview_edit_entries' ) ) { + return; + } + + ?> + + esc_html__( 'Is Starred', 'gravityview' ), 'type' => 'boolean', ), + 'is_read' => array( + 'text' => esc_html__( 'Is Read', 'gravityview' ), + 'type' => 'select', + 'choices' => array( + array( + 'text' => __( 'Read', 'gravityview' ), + 'value' => '1', + ), + array( + 'text' => __( 'Unread', 'gravityview' ), + 'value' => '0', + ), + ), + ), ); if ( gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) { From b18439e602f1d2fd33fdfb4dbdfdbf2bc4fdd62e Mon Sep 17 00:00:00 2001 From: Omar Kasem Date: Thu, 9 Mar 2023 02:10:31 +0200 Subject: [PATCH 02/24] Mark an entry as read when it's viewed on the front-end --- .../class-gravityview-field-is-read.php | 82 +++++++++++-------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index 854368c6d8..4172cc1a5f 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -19,7 +19,7 @@ class GravityView_Field_Is_Read extends GravityView_Field { var $icon = 'dashicons-book-alt'; - var $entry_meta_key = 'is_approved'; + var $entry_meta_key = 'is_read'; var $entry_meta_is_default_column = true; @@ -27,14 +27,17 @@ class GravityView_Field_Is_Read extends GravityView_Field { var $is_sortable = true; + private static $is_read = false; + private static $is_read_label; + /** - * GravityView_Field_Is_Starred constructor. + * GravityView_Field_Is_Read constructor. */ public function __construct() { - $this->label = esc_html__( 'Read Status', 'gravityview' ); + $this->label = esc_html__( 'Read Status', 'gravityview' ); $this->default_search_label = __( 'Is Read', 'gravityview' ); - $this->description = esc_html__( 'Display whether the entry has been read.', 'gravityview' ); + $this->description = esc_html__( 'Display whether the entry has been read.', 'gravityview' ); $this->add_hooks(); @@ -42,24 +45,25 @@ public function __construct() { } private function add_hooks() { - /** @see \GV\Field::get_value_filters */ + /** @see \GV\Field::get_value_filters */ add_filter( "gravityview/field/{$this->name}/value", array( $this, 'get_value' ), 10, 6 ); + add_action( 'gravityview/template/after', array( $this, 'print_script' ), 10, 1 ); } public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { $field_options['is_read_label'] = array( - 'type' => 'text', + 'type' => 'text', 'label' => __( 'Read Label', 'gravityview' ), - 'desc' => __( 'If the entry has been read, display this value', 'gravityview' ), - 'placeholder' => __('Read', 'gravityview' ), + 'desc' => __( 'If the entry has been read, display this value', 'gravityview' ), + 'value' => __( 'Read', 'gravityview' ), ); $field_options['is_unread_label'] = array( - 'type' => 'text', + 'type' => 'text', 'label' => __( 'Unread Label', 'gravityview' ), - 'desc' => __( 'If the entry has not been read, display this value', 'gravityview' ), - 'placeholder' => __('Unread', 'gravityview' ), + 'desc' => __( 'If the entry has not been read, display this value', 'gravityview' ), + 'value' => __( 'Unread', 'gravityview' ), ); return $field_options; @@ -70,27 +74,29 @@ public function field_options( $field_options, $template_id, $field_id, $context * * @since 2.0 * - * @param string $value The value. + * @param string $value The value. * @param \GV\Field The field we're doing this for. - * @param \GV\View $view The view for this context if applicable. - * @param \GV\Source $source The source (form) for this context if applicable. - * @param \GV\Entry $entry The entry for this context if applicable. - * @param \GV\Request $request The request for this context if applicable. + * @param \GV\View $view The view for this context if applicable. + * @param \GV\Source $source The source (form) for this context if applicable. + * @param \GV\Entry $entry The entry for this context if applicable. + * @param \GV\Request $request The request for this context if applicable. * - * @return string Image of the star + * @return string Value of the field */ public function get_value( $value, $field, $view, $source, $entry, $request ) { + self::$is_read_label = \GV\Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gravityview' ) ); if ( empty( $value ) ) { - return \GV\Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gravityview') ); + return \GV\Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gravityview' ) ); } - return \GV\Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gravityview') ); + self::$is_read = true; + return self::$is_read_label; } /** - * Add JS to the bottom of the View if there is a star field and user has `gravityview_edit_entries` cap + * Add JS to the bottom of the View if there is a read field and user has `gravityview_edit_entries` cap * * @param \GV\Template_Context $context The template context * @since 2.0 @@ -98,36 +104,46 @@ public function get_value( $value, $field, $view, $source, $entry, $request ) { * @return void */ public function print_script( $context ) { - return; if ( ! GravityView_Roles_Capabilities::has_cap( 'gravityview_edit_entries' ) ) { return; } + if ( gravityview_get_context() !== 'single' ) { + return; + } + + if ( self::$is_read ) { + return; + } + ?> Date: Sat, 18 Mar 2023 01:17:31 +0200 Subject: [PATCH 03/24] fix issues --- includes/fields/class-gravityview-field-is-read.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index 4172cc1a5f..320508690a 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -123,9 +123,9 @@ public function print_script( $context ) { return; } - var entry_id = entry->ID; ?>; + var entry_id = entry->ID; ?>; read_field = $('[class*=is_read]'); - read_label = ''; + read_label = ''; $.ajax({ type: "POST", @@ -139,7 +139,11 @@ public function print_script( $context ) { } }) .done(function() { - read_field.find('td').text(read_label); + if(read_field.parents('tbody').length > 0){ + read_field.find('td').text(read_label); + }else{ + read_field.text(read_label); + } }) .fail(function() { alert(); From 07a2cad6147b3b4c09872f3038e3f31de6b517c0 Mon Sep 17 00:00:00 2001 From: Omar Kasem Date: Sat, 18 Mar 2023 02:29:52 +0200 Subject: [PATCH 04/24] Add Search Bar filters for read status --- .../widgets/search-widget/class-search-widget.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/widgets/search-widget/class-search-widget.php b/includes/widgets/search-widget/class-search-widget.php index e4c09a9b11..b517792eef 100644 --- a/includes/widgets/search-widget/class-search-widget.php +++ b/includes/widgets/search-widget/class-search-widget.php @@ -1497,6 +1497,21 @@ public function render_frontend( $widget_args, $content = '', $context = '' ) { $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' ); $updated_field['choices'] = self::get_is_approved_choices(); break; + + case 'is_read': + $updated_field['key'] = 'is_read'; + $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_read' ); + $updated_field['choices'] = [ + [ + 'text'=>__('Unread','gravityview'), + 'value'=>0, + ], + [ + 'text'=>__('Read','gravityview'), + 'value'=>1 + ] + ]; + break; } $search_fields[ $k ] = $updated_field; From ce0ac6a5e9be33ecee09b3067965f4ec84066b3f Mon Sep 17 00:00:00 2001 From: Omar Kasem Date: Sat, 18 Mar 2023 02:30:30 +0200 Subject: [PATCH 05/24] formatting --- .../search-widget/class-search-widget.php | 523 ++++++++++-------- 1 file changed, 290 insertions(+), 233 deletions(-) diff --git a/includes/widgets/search-widget/class-search-widget.php b/includes/widgets/search-widget/class-search-widget.php index b517792eef..3099f29f7d 100644 --- a/includes/widgets/search-widget/class-search-widget.php +++ b/includes/widgets/search-widget/class-search-widget.php @@ -24,6 +24,7 @@ class GravityView_Widget_Search extends \GV\Widget { /** * whether search method is GET or POST ( default: GET ) + * * @since 1.16.4 * @var string $search_method */ @@ -31,69 +32,72 @@ class GravityView_Widget_Search extends \GV\Widget { public function __construct() { - $this->widget_id = 'search_bar'; + $this->widget_id = 'search_bar'; $this->widget_description = ''; - $this->widget_subtitle = esc_html__( 'Search form for searching entries.', 'gk-gravityview' ); + $this->widget_subtitle = esc_html__( 'Search form for searching entries.', 'gk-gravityview' ); self::$instance = &$this; self::$file = plugin_dir_path( __FILE__ ); - $default_values = array( 'header' => 0, 'footer' => 0 ); + $default_values = array( + 'header' => 0, + 'footer' => 0, + ); $settings = array( 'search_layout' => array( - 'type' => 'radio', + 'type' => 'radio', 'full_width' => true, - 'label' => esc_html__( 'Search Layout', 'gk-gravityview' ), - 'value' => 'horizontal', - 'options' => array( + 'label' => esc_html__( 'Search Layout', 'gk-gravityview' ), + 'value' => 'horizontal', + 'options' => array( 'horizontal' => esc_html__( 'Horizontal', 'gk-gravityview' ), - 'vertical' => esc_html__( 'Vertical', 'gk-gravityview' ), + 'vertical' => esc_html__( 'Vertical', 'gk-gravityview' ), ), ), - 'search_clear' => array( + 'search_clear' => array( 'type' => 'checkbox', 'label' => __( 'Show Clear button', 'gk-gravityview' ), - 'desc' => __( 'When a search is performed, display a button that removes all search values.', 'gk-gravityview'), + 'desc' => __( 'When a search is performed, display a button that removes all search values.', 'gk-gravityview' ), 'value' => true, ), 'search_fields' => array( - 'type' => 'hidden', + 'type' => 'hidden', 'label' => '', 'class' => 'gv-search-fields-value', 'value' => '[{"field":"search_all","input":"input_text"}]', // Default: Search Everything text box ), - 'search_mode' => array( - 'type' => 'radio', + 'search_mode' => array( + 'type' => 'radio', 'full_width' => true, - 'label' => esc_html__( 'Search Mode', 'gk-gravityview' ), - 'desc' => __('Should search results match all search fields, or any?', 'gk-gravityview'), - 'value' => 'any', - 'class' => 'hide-if-js', - 'options' => array( + 'label' => esc_html__( 'Search Mode', 'gk-gravityview' ), + 'desc' => __( 'Should search results match all search fields, or any?', 'gk-gravityview' ), + 'value' => 'any', + 'class' => 'hide-if-js', + 'options' => array( 'any' => esc_html__( 'Match Any Fields', 'gk-gravityview' ), 'all' => esc_html__( 'Match All Fields', 'gk-gravityview' ), ), ), 'sieve_choices' => array( - 'type' => 'radio', + 'type' => 'radio', 'full_width' => true, - 'label' => esc_html__( 'Pre-Filter Choices', 'gk-gravityview' ), + 'label' => esc_html__( 'Pre-Filter Choices', 'gk-gravityview' ), // translators: Do not translate [b], [/b], [link], or [/link]; they are placeholders for HTML and links to documentation. - 'desc' => strtr( + 'desc' => strtr( esc_html__( 'For fields with choices: Instead of showing all choices for each field, show only field choices that exist in submitted form entries.', 'gk-gravityview' ) . - '

⚠️ ' . esc_html__('This setting affects security.', 'gk-gravityview' ) . ' ' . esc_html__( '[link]Learn about the Pre-Filter Choices setting[/link] before enabling it.', 'gk-gravityview') . '

', + '

⚠️ ' . esc_html__( 'This setting affects security.', 'gk-gravityview' ) . ' ' . esc_html__( '[link]Learn about the Pre-Filter Choices setting[/link] before enabling it.', 'gk-gravityview' ) . '

', array( - '[b]' => '', - '[/b]' => '', - '[link]' => '', + '[b]' => '', + '[/b]' => '', + '[link]' => '', '[/link]' => '', ) ), - 'value' => '0', - 'class' => 'hide-if-js', - 'options' => array( + 'value' => '0', + 'class' => 'hide-if-js', + 'options' => array( '0' => esc_html__( 'Show all field choices', 'gk-gravityview' ), '1' => esc_html__( 'Only show choices that exist in form entries', 'gk-gravityview' ), ), @@ -109,7 +113,7 @@ public function __construct() { // admin - add scripts - run at 1100 to make sure GravityView_Admin_Views::add_scripts_and_styles() runs first at 999 add_action( 'admin_enqueue_scripts', array( $this, 'add_scripts_and_styles' ), 1100 ); - add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts') ); + add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) ); add_filter( 'gravityview_noconflict_scripts', array( $this, 'register_no_conflict' ) ); // ajax - get the searchable fields @@ -134,7 +138,7 @@ public function __construct() { */ public static function getInstance() { if ( empty( self::$instance ) ) { - self::$instance = new GravityView_Widget_Search; + self::$instance = new GravityView_Widget_Search(); } return self::$instance; } @@ -169,6 +173,7 @@ public function add_reserved_args( $args ) { /** * Sets the search method to GET (default) or POST + * * @since 1.16.4 */ private function set_search_method() { @@ -187,6 +192,7 @@ private function set_search_method() { /** * Returns the search method + * * @since 1.16.4 * @return string */ @@ -204,20 +210,21 @@ public function get_search_method() { public static function get_input_types_by_field_type() { /** * Input Type groups + * * @see admin-search-widget.js (getSelectInput) */ $input_types = array( - 'text' => array( 'input_text' ), - 'address' => array( 'input_text' ), - 'number' => array( 'input_text' ), - 'date' => array( 'date', 'date_range' ), - 'boolean' => array( 'single_checkbox' ), - 'select' => array( 'select', 'radio', 'link' ), - 'multi' => array( 'select', 'multiselect', 'radio', 'checkbox', 'link' ), + 'text' => array( 'input_text' ), + 'address' => array( 'input_text' ), + 'number' => array( 'input_text' ), + 'date' => array( 'date', 'date_range' ), + 'boolean' => array( 'single_checkbox' ), + 'select' => array( 'select', 'radio', 'link' ), + 'multi' => array( 'select', 'multiselect', 'radio', 'checkbox', 'link' ), // hybrids 'created_by' => array( 'select', 'radio', 'checkbox', 'multiselect', 'link', 'input_text' ), - 'product' => array( 'select', 'radio', 'link', 'input_text' ), + 'product' => array( 'select', 'radio', 'link', 'input_text' ), ); /** @@ -240,18 +247,19 @@ public static function get_input_types_by_field_type() { public static function get_search_input_labels() { /** * Input Type labels l10n + * * @see admin-search-widget.js (getSelectInput) */ $input_labels = array( - 'input_text' => esc_html__( 'Text', 'gk-gravityview' ), - 'date' => esc_html__( 'Date', 'gk-gravityview' ), - 'select' => esc_html__( 'Select', 'gk-gravityview' ), - 'multiselect' => esc_html__( 'Select (multiple values)', 'gk-gravityview' ), - 'radio' => esc_html__( 'Radio', 'gk-gravityview' ), - 'checkbox' => esc_html__( 'Checkbox', 'gk-gravityview' ), + 'input_text' => esc_html__( 'Text', 'gk-gravityview' ), + 'date' => esc_html__( 'Date', 'gk-gravityview' ), + 'select' => esc_html__( 'Select', 'gk-gravityview' ), + 'multiselect' => esc_html__( 'Select (multiple values)', 'gk-gravityview' ), + 'radio' => esc_html__( 'Radio', 'gk-gravityview' ), + 'checkbox' => esc_html__( 'Checkbox', 'gk-gravityview' ), 'single_checkbox' => esc_html__( 'Checkbox', 'gk-gravityview' ), - 'link' => esc_html__( 'Links', 'gk-gravityview' ), - 'date_range' => esc_html__( 'Date range', 'gk-gravityview' ), + 'link' => esc_html__( 'Links', 'gk-gravityview' ), + 'date_range' => esc_html__( 'Date range', 'gk-gravityview' ), ); /** @@ -271,6 +279,7 @@ public static function get_search_input_label( $input_type ) { /** * Add script to Views edit screen (admin) + * * @param mixed $hook */ public function add_scripts_and_styles( $hook ) { @@ -281,27 +290,32 @@ public function add_scripts_and_styles( $hook ) { return; } - $script_min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; + $script_min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; $script_source = empty( $script_min ) ? '/source' : ''; - wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js'.$script_source.'/admin-search-widget'.$script_min.'.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version ); - - wp_localize_script( 'gravityview_searchwidget_admin', 'gvSearchVar', array( - 'nonce' => wp_create_nonce( 'gravityview_ajaxsearchwidget' ), - 'label_nofields' => esc_html__( 'No search fields configured yet.', 'gk-gravityview' ), - 'label_addfield' => esc_html__( 'Add Search Field', 'gk-gravityview' ), - 'label_label' => esc_html__( 'Label', 'gk-gravityview' ), - 'label_searchfield' => esc_html__( 'Search Field', 'gk-gravityview' ), - 'label_inputtype' => esc_html__( 'Input Type', 'gk-gravityview' ), - 'label_ajaxerror' => esc_html__( 'There was an error loading searchable fields. Save the View or refresh the page to fix this issue.', 'gk-gravityview' ), - 'input_labels' => json_encode( self::get_search_input_labels() ), - 'input_types' => json_encode( self::get_input_types_by_field_type() ), - ) ); + wp_enqueue_script( 'gravityview_searchwidget_admin', plugins_url( 'assets/js' . $script_source . '/admin-search-widget' . $script_min . '.js', __FILE__ ), array( 'jquery', 'gravityview_views_scripts' ), \GV\Plugin::$version ); + + wp_localize_script( + 'gravityview_searchwidget_admin', + 'gvSearchVar', + array( + 'nonce' => wp_create_nonce( 'gravityview_ajaxsearchwidget' ), + 'label_nofields' => esc_html__( 'No search fields configured yet.', 'gk-gravityview' ), + 'label_addfield' => esc_html__( 'Add Search Field', 'gk-gravityview' ), + 'label_label' => esc_html__( 'Label', 'gk-gravityview' ), + 'label_searchfield' => esc_html__( 'Search Field', 'gk-gravityview' ), + 'label_inputtype' => esc_html__( 'Input Type', 'gk-gravityview' ), + 'label_ajaxerror' => esc_html__( 'There was an error loading searchable fields. Save the View or refresh the page to fix this issue.', 'gk-gravityview' ), + 'input_labels' => json_encode( self::get_search_input_labels() ), + 'input_types' => json_encode( self::get_input_types_by_field_type() ), + ) + ); } /** * Add admin script to the no-conflict scripts allowlist + * * @param array $allowed Scripts allowed in no-conflict mode * @return array Scripts allowed in no-conflict mode, plus the search widget script */ @@ -347,7 +361,8 @@ public static function get_searchable_fields() { /** * Generates html for the available Search Fields dropdown - * @param int $form_id + * + * @param int $form_id * @param string $current (for future use) * @return string */ @@ -370,7 +385,7 @@ public static function render_searchable_fields( $form_id = null, $current = '' 'text' => esc_html__( 'Entry Date', 'gk-gravityview' ), 'type' => 'date', ), - 'entry_id' => array( + 'entry_id' => array( 'text' => esc_html__( 'Entry ID', 'gk-gravityview' ), 'type' => 'text', ), @@ -382,16 +397,16 @@ public static function render_searchable_fields( $form_id = null, $current = '' 'text' => esc_html__( 'Is Starred', 'gk-gravityview' ), 'type' => 'boolean', ), - 'is_read' => array( - 'text' => esc_html__( 'Is Read', 'gravityview' ), - 'type' => 'select', + 'is_read' => array( + 'text' => esc_html__( 'Is Read', 'gravityview' ), + 'type' => 'select', 'choices' => array( array( - 'text' => __( 'Read', 'gravityview' ), + 'text' => __( 'Read', 'gravityview' ), 'value' => '1', ), array( - 'text' => __( 'Unread', 'gravityview' ), + 'text' => __( 'Unread', 'gravityview' ), 'value' => '0', ), ), @@ -405,8 +420,8 @@ public static function render_searchable_fields( $form_id = null, $current = '' ); } - foreach( $custom_fields as $custom_field_key => $custom_field ) { - $output .= sprintf( '', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field['type'], self::get_field_label( array('field' => $custom_field_key ) ), $custom_field['text'] ); + foreach ( $custom_fields as $custom_field_key => $custom_field ) { + $output .= sprintf( '', $custom_field_key, selected( $custom_field_key, $current, false ), $custom_field['type'], self::get_field_label( array( 'field' => $custom_field_key ) ), $custom_field['text'] ); } // Get fields with sub-inputs and no parent @@ -434,7 +449,7 @@ public static function render_searchable_fields( $form_id = null, $current = '' $types = self::get_search_input_types( $id, $field['type'] ); - $output .= ''; + $output .= ''; } } @@ -450,7 +465,7 @@ public static function render_searchable_fields( $form_id = null, $current = '' * @see admin-search-widget.js * * @param string|int|float $field_id Gravity Forms field ID - * @param string $field_type Gravity Forms field type (also the `name` parameter of GravityView_Field classes) + * @param string $field_type Gravity Forms field type (also the `name` parameter of GravityView_Field classes) * * @return string GV field search input type ('multi', 'boolean', 'select', 'date', 'text') */ @@ -460,7 +475,7 @@ public static function get_search_input_types( $field_id = '', $field_type = nul if ( false !== strpos( (string) $field_id, '.' ) && in_array( $field_type, array( 'checkbox' ) ) || in_array( $field_id, array( 'is_fulfilled' ) ) ) { $input_type = 'boolean'; // on/off checkbox } elseif ( in_array( $field_type, array( 'checkbox', 'post_category', 'multiselect' ) ) ) { - $input_type = 'multi'; //multiselect + $input_type = 'multi'; // multiselect } elseif ( in_array( $field_type, array( 'select', 'radio' ) ) ) { $input_type = 'select'; } elseif ( in_array( $field_type, array( 'date' ) ) || in_array( $field_id, array( 'payment_date' ) ) ) { @@ -507,7 +522,7 @@ public function add_no_permalink_fields( $search_fields, $object, $widget_args = $post_id = absint( $widget_args['post_id'] ); } // We're in the WordPress Widget context, and the base View ID should be used - else if ( ! empty( $widget_args['view_id'] ) ) { + elseif ( ! empty( $widget_args['view_id'] ) ) { $post_id = absint( $widget_args['view_id'] ); } @@ -533,10 +548,10 @@ public function add_no_permalink_fields( $search_fields, $object, $widget_args = * @since 2.0.9 Added $with_full_field parameter * * @param \GV\View|null $view - * @param bool $with_full_field Return full field array, or just field ID? Default: false (just field ID) + * @param bool $with_full_field Return full field array, or just field ID? Default: false (just field ID) * - * TODO: Move to \GV\View, perhaps? And return a Field_Collection - * TODO: Use in gravityview()->request->is_search() to calculate whether a valid search + * TODO: Move to \GV\View, perhaps? And return a Field_Collection + * TODO: Use in gravityview()->request->is_search() to calculate whether a valid search * * @return array If no View, returns empty array. Otherwise, returns array of fields configured in widgets and Search Bar for a View */ @@ -558,7 +573,7 @@ private function get_view_searchable_fields( $view, $with_full_field = false ) { foreach ( $widgets as $widget ) { if ( ! empty( $widget['view_id'] ) && $widget['view_id'] == $view->ID ) { - if( $_fields = json_decode( $widget['search_fields'], true ) ) { + if ( $_fields = json_decode( $widget['search_fields'], true ) ) { foreach ( $_fields as $field ) { if ( empty( $field['form_id'] ) ) { $field['form_id'] = $view->form ? $view->form->ID : 0; @@ -570,7 +585,7 @@ private function get_view_searchable_fields( $view, $with_full_field = false ) { } foreach ( $view->widgets->by_id( $this->get_widget_id() )->all() as $widget ) { - if( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) { + if ( $_fields = json_decode( $widget->configuration->get( 'search_fields' ), true ) ) { foreach ( $_fields as $field ) { if ( empty( $field['form_id'] ) ) { $field['form_id'] = $view->form ? $view->form->ID : 0; @@ -603,11 +618,12 @@ private function get_view_searchable_fields( $view, $with_full_field = false ) { /** * Calculate the search criteria to filter entries + * * @param array $search_criteria The search criteria - * @param int $form_id The form ID + * @param int $form_id The form ID * @param array $args Some args * - * @param bool $force_search_criteria Whether to suppress GF_Query filter, internally used in self::gf_query_filter + * @param bool $force_search_criteria Whether to suppress GF_Query filter, internally used in self::gf_query_filter * * @return array */ @@ -621,17 +637,23 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array return $search_criteria; // Return the original criteria, GF_Query modification kicks in later } - if( 'post' === $this->search_method ) { + if ( 'post' === $this->search_method ) { $get = $_POST; } else { $get = $_GET; } - $view = \GV\View::by_id( \GV\Utils::get( $args, 'id' ) ); + $view = \GV\View::by_id( \GV\Utils::get( $args, 'id' ) ); $view_id = $view ? $view->ID : null; $form_id = $view ? $view->form->ID : null; - gravityview()->log->debug( 'Requested $_{method}: ', array( 'method' => $this->search_method, 'data' => $get ) ); + gravityview()->log->debug( + 'Requested $_{method}: ', + array( + 'method' => $this->search_method, + 'data' => $get, + ) + ); if ( empty( $get ) || ! is_array( $get ) ) { return $search_criteria; @@ -646,7 +668,7 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array // Make sure array key is set up $search_criteria['field_filters'] = \GV\Utils::get( $search_criteria, 'field_filters', array() ); - $searchable_fields = $this->get_view_searchable_fields( $view ); + $searchable_fields = $this->get_view_searchable_fields( $view ); $searchable_field_objects = $this->get_view_searchable_fields( $view, true ); /** @@ -683,8 +705,8 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array foreach ( $words as $word ) { $search_criteria['field_filters'][] = array( - 'key' => null, // The field ID to search - 'value' => $word, // The value to search + 'key' => null, // The field ID to search + 'value' => $word, // The value to search 'operator' => 'contains', // What to search in. Options: `is` or `contains` ); } @@ -696,13 +718,13 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array * Get and normalize the dates according to the input format. */ if ( $curr_start = ! empty( $get['gv_start'] ) ? $get['gv_start'] : '' ) { - if( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) { + if ( $curr_start_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_start ) ) { $curr_start = $curr_start_date->format( 'Y-m-d' ); } } if ( $curr_end = ! empty( $get['gv_start'] ) ? ( ! empty( $get['gv_end'] ) ? $get['gv_end'] : '' ) : '' ) { - if( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) { + if ( $curr_end_date = date_create_from_format( $this->get_datepicker_format( true ), $curr_end ) ) { $curr_end = $curr_end_date->format( 'Y-m-d' ); } } @@ -737,13 +759,13 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array * Don't set $search_criteria['start_date'] if start_date is empty as it may lead to bad query results (GFAPI::get_entries) */ if ( ! empty( $curr_start ) ) { - $curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) ); + $curr_start = date( 'Y-m-d H:i:s', strtotime( $curr_start ) ); $search_criteria['start_date'] = $adjust_tz ? get_gmt_from_date( $curr_start ) : $curr_start; } if ( ! empty( $curr_end ) ) { // Fast-forward 24 hour on the end time - $curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS ); + $curr_end = date( 'Y-m-d H:i:s', strtotime( $curr_end ) + DAY_IN_SECONDS ); $search_criteria['end_date'] = $adjust_tz ? get_gmt_from_date( $curr_end ) : $curr_end; if ( strpos( $search_criteria['end_date'], '00:00:00' ) ) { // See https://github.com/gravityview/GravityView/issues/1056 $search_criteria['end_date'] = date( 'Y-m-d H:i:s', strtotime( $search_criteria['end_date'] ) - 1 ); @@ -752,25 +774,25 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array } // search for a specific entry ID - if ( ! empty( $get[ 'gv_id' ] ) && in_array( 'entry_id', $searchable_fields ) ) { + if ( ! empty( $get['gv_id'] ) && in_array( 'entry_id', $searchable_fields ) ) { $search_criteria['field_filters'][] = array( - 'key' => 'id', - 'value' => absint( $get[ 'gv_id' ] ), + 'key' => 'id', + 'value' => absint( $get['gv_id'] ), 'operator' => $this->get_operator( $get, 'gv_id', array( '=' ), '=' ), ); } // search for a specific Created_by ID - if ( ! empty( $get[ 'gv_by' ] ) && in_array( 'created_by', $searchable_fields ) ) { + if ( ! empty( $get['gv_by'] ) && in_array( 'created_by', $searchable_fields ) ) { $search_criteria['field_filters'][] = array( - 'key' => 'created_by', - 'value' => $get['gv_by'], + 'key' => 'created_by', + 'value' => $get['gv_by'], 'operator' => $this->get_operator( $get, 'gv_by', array( '=' ), '=' ), ); } // Get search mode passed in URL - $mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ? $get['mode'] : 'any'; + $mode = isset( $get['mode'] ) && in_array( $get['mode'], array( 'any', 'all' ) ) ? $get['mode'] : 'any'; // get the other search filters foreach ( $get as $key => $value ) { @@ -832,7 +854,7 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array if ( ! empty( $filter[0]['operator'] ) && in_array( $filter[0]['operator'], array( '>=', '<=', '>', '<' ) ) ) { $mode = 'all'; } - } elseif( !empty( $filter ) ) { + } elseif ( ! empty( $filter ) ) { $search_criteria['field_filters'][] = $filter; } } @@ -856,8 +878,8 @@ public function filter_entries( $search_criteria, $form_id = null, $args = array * * Dropin for the legacy flat filters when \GF_Query is available. * - * @param \GF_Query $query The current query object reference - * @param \GV\View $this The current view object + * @param \GF_Query $query The current query object reference + * @param \GV\View $this The current view object * @param \GV\Request $request The request object */ public function gf_query_filter( &$query, $view, $request ) { @@ -895,7 +917,7 @@ public function gf_query_filter( &$query, $view, $request ) { } $extra_conditions = array(); - $mode = 'any'; + $mode = 'any'; foreach ( $search_criteria['field_filters'] as $key => &$filter ) { if ( ! is_array( $filter ) ) { @@ -907,21 +929,24 @@ public function gf_query_filter( &$query, $view, $request ) { // Construct a manual query for unapproved statuses if ( 'is_approved' === $filter['key'] && in_array( \GravityView_Entry_Approval_Status::UNAPPROVED, (array) $filter['value'] ) ) { - $_tmp_query = new $query_class( $view->form->ID, array( - 'field_filters' => array( - array( - 'operator' => 'in', - 'key' => 'is_approved', - 'value' => (array) $filter['value'], - ), - array( - 'operator' => 'is', - 'key' => 'is_approved', - 'value' => '', + $_tmp_query = new $query_class( + $view->form->ID, + array( + 'field_filters' => array( + array( + 'operator' => 'in', + 'key' => 'is_approved', + 'value' => (array) $filter['value'], + ), + array( + 'operator' => 'is', + 'key' => 'is_approved', + 'value' => '', + ), + 'mode' => 'any', ), - 'mode' => 'any' - ), - ) ); + ) + ); $_tmp_query_parts = $_tmp_query->_introspect(); $extra_conditions[] = $_tmp_query_parts['where']; @@ -933,7 +958,7 @@ public function gf_query_filter( &$query, $view, $request ) { // Construct manual query for text mode creator search if ( 'created_by' === $filter['key'] && ! empty( $created_by_text_mode ) ) { $extra_conditions[] = new GravityView_Widget_Search_Author_GF_Query_Condition( $filter, $view ); - $filter = false; + $filter = false; continue; } @@ -994,7 +1019,13 @@ public function gf_query_filter( &$query, $view, $request ) { * code by reusing what's inside GF_Query already as they * take care of many small things like forcing numeric, etc. */ - $_tmp_query = new $query_class( $filter['form_id'], array( 'mode' => 'any', 'field_filters' => array( $filter ) ) ); + $_tmp_query = new $query_class( + $filter['form_id'], + array( + 'mode' => 'any', + 'field_filters' => array( $filter ), + ) + ); $_tmp_query_parts = $_tmp_query->_introspect(); $search_condition = $_tmp_query_parts['where']; @@ -1025,7 +1056,7 @@ public function gf_query_filter( &$query, $view, $request ) { if ( $view->joins && $left->field_id == GF_Query_Column::META ) { foreach ( $view->joins as $_join ) { - $on = $_join->join_on; + $on = $_join->join_on; $join = $_join->join; $search_conditions[] = GF_Query_Condition::_or( @@ -1089,7 +1120,7 @@ private function convert_request_key_to_filter_key( $key ) { $field_id = str_replace( array( 'filter_', 'input_' ), '', $key ); // calculates field_id, removing 'filter_' and for '_' for advanced fields ( like name or checkbox ) - if ( preg_match('/^[0-9_]+$/ism', $field_id ) ) { + if ( preg_match( '/^[0-9_]+$/ism', $field_id ) ) { $field_id = str_replace( '_', '.', $field_id ); } @@ -1103,10 +1134,10 @@ private function convert_request_key_to_filter_key( $key ) { * * Format searched values * - * @param string $filter_key ID of the field, or entry meta key - * @param string $value $_GET/$_POST search value + * @param string $filter_key ID of the field, or entry meta key + * @param string $value $_GET/$_POST search value * @param \GV\View $view The view we're looking at - * @param array[] $searchable_fields The searchable fields as configured by the widget. + * @param array[] $searchable_fields The searchable fields as configured by the widget. * @param string[] $get The $_GET/$_POST array. * * @since develop Added 5th $get parameter for operator overrides. @@ -1115,7 +1146,7 @@ private function convert_request_key_to_filter_key( $key ) { * @return array|false 1 or 2 deph levels, false if not allowed */ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fields, $get = array() ) { - $key = $filter_key; + $key = $filter_key; $filter_key = explode( ':', $filter_key ); // field_id, form_id $form = null; @@ -1156,7 +1187,7 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi return false; } } else { - $field_id = reset( $filter_key ); + $field_id = reset( $filter_key ); $searchable_fields = wp_list_pluck( $searchable_fields, 'field' ); if ( ! in_array( 'search_all', $searchable_fields ) && ! in_array( $field_id, $searchable_fields ) ) { return false; @@ -1177,8 +1208,8 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi // default filter array $filter = array( - 'key' => $field_id, - 'value' => $value, + 'key' => $field_id, + 'value' => $value, 'form_id' => $form->ID, ); @@ -1190,7 +1221,6 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi break; case 'post_category': - if ( ! is_array( $value ) ) { $value = array( $value ); } @@ -1199,7 +1229,7 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi $filter = array(); foreach ( $value as $val ) { - $cat = get_term( $val, 'category' ); + $cat = get_term( $val, 'category' ); $filter[] = array( 'key' => $field_id, 'value' => esc_attr( $cat->name ) . ':' . $val, @@ -1210,7 +1240,6 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi break; case 'multiselect': - if ( ! is_array( $value ) ) { break; } @@ -1219,7 +1248,10 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi $filter = array(); foreach ( $value as $val ) { - $filter[] = array( 'key' => $field_id, 'value' => $val ); + $filter[] = array( + 'key' => $field_id, + 'value' => $val, + ); } break; @@ -1229,7 +1261,7 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi if ( false !== strpos( $field_id, '.' ) && ! empty( $form_field->inputs ) && ! empty( $form_field->choices ) ) { foreach ( $form_field->inputs as $k => $input ) { if ( $input['id'] == $field_id ) { - $filter['value'] = $form_field->choices[ $k ]['value']; + $filter['value'] = $form_field->choices[ $k ]['value']; $filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); break; } @@ -1252,7 +1284,6 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi case 'name': case 'address': - if ( false === strpos( $field_id, '.' ) ) { $words = explode( ' ', $value ); @@ -1277,12 +1308,12 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi foreach ( $searchable_fields as $searchable_field ) { - if( $form_field->ID !== $searchable_field['field'] ) { + if ( $form_field->ID !== $searchable_field['field'] ) { continue; } // Only exact-match dropdowns, not text search - if( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) { + if ( in_array( $searchable_field['input'], array( 'text', 'search' ), true ) ) { continue; } @@ -1298,7 +1329,6 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi case 'payment_date': case 'date': - $date_format = $this->get_datepicker_format( true ); if ( is_array( $value ) ) { @@ -1317,9 +1347,9 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi * @since 1.16.3 * Safeguard until GF implements '<=' operator */ - if( !GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) { + if ( ! GFFormsModel::is_valid_operator( $operator ) && $operator === '<=' ) { $operator = '<'; - $date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) ); + $date = date( 'Y-m-d', strtotime( self::get_formatted_date( $date, 'Y-m-d', $date_format ) . ' +1 day' ) ); } $filter[] = array( @@ -1329,12 +1359,12 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi ); } } else { - $date = $value; - $filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format ); + $date = $value; + $filter['value'] = self::get_formatted_date( $date, 'Y-m-d', $date_format ); $filter['operator'] = $this->get_operator( $get, $key, array( 'is' ), 'is' ); } - if ('payment_date' === $key) { + if ( 'payment_date' === $key ) { $filter['operator'] = 'contains'; } @@ -1353,18 +1383,18 @@ public function prepare_field_filter( $filter_key, $value, $view, $searchable_fi * @return string Format of the date in the database */ public static function get_date_field_format( GF_Field_Date $field ) { - $format = 'm/d/Y'; + $format = 'm/d/Y'; $datepicker = array( - 'mdy' => 'm/d/Y', - 'dmy' => 'd/m/Y', - 'dmy_dash' => 'd-m-Y', - 'dmy_dot' => 'd.m.Y', + 'mdy' => 'm/d/Y', + 'dmy' => 'd/m/Y', + 'dmy_dash' => 'd-m-Y', + 'dmy_dot' => 'd.m.Y', 'ymd_slash' => 'Y/m/d', - 'ymd_dash' => 'Y-m-d', - 'ymd_dot' => 'Y.m.d', + 'ymd_dash' => 'Y-m-d', + 'ymd_dot' => 'Y.m.d', ); - if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ){ + if ( ! empty( $field->dateFormat ) && isset( $datepicker[ $field->dateFormat ] ) ) { $format = $datepicker[ $field->dateFormat ]; } @@ -1396,6 +1426,7 @@ public static function get_formatted_date( $value = '', $format = 'Y-m-d', $valu /** * Include this extension templates path + * * @param array $file_paths List of template paths ordered */ public function add_template_path( $file_paths ) { @@ -1431,8 +1462,9 @@ private function has_date_field( $search_fields ) { /** * Renders the Search Widget - * @param array $widget_args - * @param string $content + * + * @param array $widget_args + * @param string $content * @param string|\GV\Template_Context $context * * @return void @@ -1466,51 +1498,51 @@ public function render_frontend( $widget_args, $content = '', $context = '' ) { switch ( $field['field'] ) { case 'search_all': - $updated_field['key'] = 'search_all'; + $updated_field['key'] = 'search_all'; $updated_field['input'] = 'search_all'; $updated_field['value'] = $this->rgget_or_rgpost( 'gv_search' ); break; case 'entry_date': - $updated_field['key'] = 'entry_date'; + $updated_field['key'] = 'entry_date'; $updated_field['input'] = 'entry_date'; $updated_field['value'] = array( 'start' => $this->rgget_or_rgpost( 'gv_start' ), - 'end' => $this->rgget_or_rgpost( 'gv_end' ), + 'end' => $this->rgget_or_rgpost( 'gv_end' ), ); break; case 'entry_id': - $updated_field['key'] = 'entry_id'; + $updated_field['key'] = 'entry_id'; $updated_field['input'] = 'entry_id'; $updated_field['value'] = $this->rgget_or_rgpost( 'gv_id' ); break; case 'created_by': - $updated_field['key'] = 'created_by'; - $updated_field['name'] = 'gv_by'; + $updated_field['key'] = 'created_by'; + $updated_field['name'] = 'gv_by'; $updated_field['value'] = $this->rgget_or_rgpost( 'gv_by' ); break; case 'is_approved': - $updated_field['key'] = 'is_approved'; - $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' ); + $updated_field['key'] = 'is_approved'; + $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_approved' ); $updated_field['choices'] = self::get_is_approved_choices(); break; case 'is_read': - $updated_field['key'] = 'is_read'; - $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_read' ); - $updated_field['choices'] = [ - [ - 'text'=>__('Unread','gravityview'), - 'value'=>0, - ], - [ - 'text'=>__('Read','gravityview'), - 'value'=>1 - ] - ]; + $updated_field['key'] = 'is_read'; + $updated_field['value'] = $this->rgget_or_rgpost( 'filter_is_read' ); + $updated_field['choices'] = array( + array( + 'text' => __( 'Unread', 'gravityview' ), + 'value' => 0, + ), + array( + 'text' => __( 'Read', 'gravityview' ), + 'value' => 1, + ), + ); break; } @@ -1562,10 +1594,10 @@ public function render_frontend( $widget_args, $content = '', $context = '' ) { public static function get_search_class( $custom_class = '' ) { $gravityview_view = GravityView_View::getInstance(); - $search_class = 'gv-search-'.$gravityview_view->search_layout; + $search_class = 'gv-search-' . $gravityview_view->search_layout; - if ( ! empty( $custom_class ) ) { - $search_class .= ' '.$custom_class; + if ( ! empty( $custom_class ) ) { + $search_class .= ' ' . $custom_class; } /** @@ -1583,6 +1615,7 @@ public static function get_search_class( $custom_class = '' ) { /** * Calculate the search form action + * * @since 1.6 * * @return string @@ -1606,6 +1639,7 @@ public static function get_search_form_action() { /** * Get the label for a search form field + * * @param array $field Field setting as sent by the GV configuration - has `field`, `input` (input type), and `label` keys * @param array $form_field Form field data, as fetched by `gravityview_get_field()` * @return string Label for the search form @@ -1618,7 +1652,7 @@ private static function get_field_label( $field, $form_field = array() ) { $label = isset( $form_field['label'] ) ? $form_field['label'] : ''; - switch( $field['field'] ) { + switch ( $field['field'] ) { case 'search_all': $label = __( 'Search Entries:', 'gk-gravityview' ); break; @@ -1664,9 +1698,9 @@ private static function get_field_label( $field, $form_field = array() ) { * * @since 2.16 Added $widget_args parameter. * - * @param array $field + * @param array $field * @param \GV\Context $context - * @param array $widget_args + * @param array $widget_args * * @return array */ @@ -1688,12 +1722,12 @@ private function get_search_filter_details( $field, $context, $widget_args ) { $form_field_type = \GV\Utils::get( $form_field, 'type' ); $filter = array( - 'key' => \GV\Utils::get( $field, 'field' ), - 'name' => $name, + 'key' => \GV\Utils::get( $field, 'field' ), + 'name' => $name, 'label' => self::get_field_label( $field, $form_field ), 'input' => \GV\Utils::get( $field, 'input' ), 'value' => $value, - 'type' => $form_field_type, + 'type' => $form_field_type, ); // collect choices @@ -1704,12 +1738,15 @@ private function get_search_filter_details( $field, $context, $widget_args ) { } if ( 'date_range' === $field['input'] && empty( $value ) ) { - $filter['value'] = array( 'start' => '', 'end' => '' ); + $filter['value'] = array( + 'start' => '', + 'end' => '', + ); } if ( 'created_by' === $field['field'] ) { $filter['choices'] = self::get_created_by_choices( ( isset( $context->view ) ? $context->view : null ) ); - $filter['type'] = 'created_by'; + $filter['type'] = 'created_by'; } /** @@ -1729,10 +1766,10 @@ private function get_search_filter_details( $field, $context, $widget_args ) { * * @uses sieve_filter_choices * - * @param array $search_fields Array of search filters with `key`, `label`, `value`, `type` keys + * @param array $search_fields Array of search filters with `key`, `label`, `value`, `type` keys * @param GravityView_Widget_Search $widget Current widget object - * @param array $widget_args Args passed to this method. {@since 1.8} - * @param \GV\Template_Context $context + * @param array $widget_args Args passed to this method. {@since 1.8} + * @param \GV\Template_Context $context * * @return array If the search field GF Field type is `address`, and there are choices to add, adds them and changes the input type. Otherwise, sets the input to text. */ @@ -1770,7 +1807,7 @@ public function maybe_sieve_filter_choices( $search_fields, $widget, $widget_arg /** * Sieve filter choices to only ones that are used. * - * @param array $filter The filter configuration. + * @param array $filter The filter configuration. * @param \GV\Context $context The context * * @since 2.5 @@ -1790,7 +1827,7 @@ private function sieve_filter_choices( $filter, $context ) { $form_id = $context->view->form->ID; // @todo Support multiple forms (joins) - $cache = new GravityView_Cache( $form_id, [ 'sieve', $filter['key'], $context->view->ID ] ); + $cache = new GravityView_Cache( $form_id, array( 'sieve', $filter['key'], $context->view->ID ) ); $filter_choices = $cache->get(); @@ -1807,21 +1844,29 @@ private function sieve_filter_choices( $filter, $context ) { switch ( \GV\Utils::get( $filter, 'type' ) ) { case 'post_category': - $choices = $wpdb->get_col( $wpdb->prepare( - "SELECT DISTINCT SUBSTRING_INDEX( `meta_value`, ':', 1) FROM $entry_meta_table_name WHERE ( `meta_key` LIKE %s OR `meta_key` = %d) AND `form_id` = %d", - $key_like, $filter['key'], $form_id - ) ); + $choices = $wpdb->get_col( + $wpdb->prepare( + "SELECT DISTINCT SUBSTRING_INDEX( `meta_value`, ':', 1) FROM $entry_meta_table_name WHERE ( `meta_key` LIKE %s OR `meta_key` = %d) AND `form_id` = %d", + $key_like, + $filter['key'], + $form_id + ) + ); break; case 'created_by': - $choices = $wpdb->get_col( $wpdb->prepare( - "SELECT DISTINCT `created_by` FROM $entry_table_name WHERE `form_id` = %d", - $form_id - ) ); + $choices = $wpdb->get_col( + $wpdb->prepare( + "SELECT DISTINCT `created_by` FROM $entry_table_name WHERE `form_id` = %d", + $form_id + ) + ); break; default: $sql = $wpdb->prepare( "SELECT DISTINCT `meta_value` FROM $entry_meta_table_name WHERE ( `meta_key` LIKE %s OR `meta_key` = %s ) AND `form_id` = %d", - $key_like, $filter['key'], $form_id + $key_like, + $filter['key'], + $form_id ); $choices = $wpdb->get_col( $sql ); @@ -1870,6 +1915,7 @@ private static function get_created_by_choices( $view ) { /** * filter gravityview/get_users/search_widget + * * @see \GVCommon::get_users */ $users = GVCommon::get_users( 'search_widget', array( 'fields' => array( 'ID', 'display_name' ) ) ); @@ -1883,10 +1929,10 @@ private static function get_created_by_choices( $view ) { * @param \WP_User $user The user. * @param \GV\View|null $view The view. */ - $text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view ); + $text = apply_filters( 'gravityview/search/created_by/text', $user->display_name, $user, $view ); $choices[] = array( 'value' => $user->ID, - 'text' => $text, + 'text' => $text, ); } @@ -1906,7 +1952,7 @@ private static function get_is_approved_choices() { foreach ( GravityView_Entry_Approval_Status::get_all() as $status ) { $choices[] = array( 'value' => $status['value'], - 'text' => $status['label'], + 'text' => $status['label'], ); } @@ -1915,6 +1961,7 @@ private static function get_is_approved_choices() { /** * Output the Clear Search Results button + * * @since 1.5.4 */ public static function the_clear_search_button() { @@ -1955,6 +2002,7 @@ private function rgget_or_rgpost( $name ) { /** * Require the datepicker script for the frontend GV script + * * @param array $js_dependencies Array of existing required scripts for the fe-views.js script * @return array Array required scripts, with `jquery-ui-datepicker` added */ @@ -1983,26 +2031,30 @@ public function add_datepicker_localization( $localizations = array(), $view_dat * @param array $js_localization The data padded to the Javascript file * @param array $view_data View data array with View settings */ - $datepicker_settings = apply_filters( 'gravityview_datepicker_settings', array( - 'yearRange' => '-5:+5', - 'changeMonth' => true, - 'changeYear' => true, - 'closeText' => esc_attr_x( 'Close', 'Close calendar', 'gk-gravityview' ), - 'prevText' => esc_attr_x( 'Prev', 'Previous month in calendar', 'gk-gravityview' ), - 'nextText' => esc_attr_x( 'Next', 'Next month in calendar', 'gk-gravityview' ), - 'currentText' => esc_attr_x( 'Today', 'Today in calendar', 'gk-gravityview' ), - 'weekHeader' => esc_attr_x( 'Week', 'Week in calendar', 'gk-gravityview' ), - 'monthStatus' => __( 'Show a different month', 'gk-gravityview' ), - 'monthNames' => array_values( $wp_locale->month ), - 'monthNamesShort' => array_values( $wp_locale->month_abbrev ), - 'dayNames' => array_values( $wp_locale->weekday ), - 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ), - 'dayNamesMin' => array_values( $wp_locale->weekday_initial ), - // get the start of week from WP general setting - 'firstDay' => get_option( 'start_of_week' ), - // is Right to left language? default is false - 'isRTL' => is_rtl(), - ), $view_data ); + $datepicker_settings = apply_filters( + 'gravityview_datepicker_settings', + array( + 'yearRange' => '-5:+5', + 'changeMonth' => true, + 'changeYear' => true, + 'closeText' => esc_attr_x( 'Close', 'Close calendar', 'gk-gravityview' ), + 'prevText' => esc_attr_x( 'Prev', 'Previous month in calendar', 'gk-gravityview' ), + 'nextText' => esc_attr_x( 'Next', 'Next month in calendar', 'gk-gravityview' ), + 'currentText' => esc_attr_x( 'Today', 'Today in calendar', 'gk-gravityview' ), + 'weekHeader' => esc_attr_x( 'Week', 'Week in calendar', 'gk-gravityview' ), + 'monthStatus' => __( 'Show a different month', 'gk-gravityview' ), + 'monthNames' => array_values( $wp_locale->month ), + 'monthNamesShort' => array_values( $wp_locale->month_abbrev ), + 'dayNames' => array_values( $wp_locale->weekday ), + 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ), + 'dayNamesMin' => array_values( $wp_locale->weekday_initial ), + // get the start of week from WP general setting + 'firstDay' => get_option( 'start_of_week' ), + // is Right to left language? default is false + 'isRTL' => is_rtl(), + ), + $view_data + ); $localizations['datepicker'] = $datepicker_settings; @@ -2053,7 +2105,7 @@ public function enqueue_datepicker() { add_filter( 'gravityview_js_localization', array( $this, 'add_datepicker_localization' ), 10, 2 ); $scheme = is_ssl() ? 'https://' : 'http://'; - wp_enqueue_style( 'jquery-ui-datepicker', $scheme.'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' ); + wp_enqueue_style( 'jquery-ui-datepicker', $scheme . 'ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css' ); /** * @filter `gravityview_search_datepicker_class` @@ -2068,7 +2120,7 @@ public function enqueue_datepicker() { * - `ymd_dash` (yyyy-mm-dd) * - `ymd_dot` (yyyy.mm.dd) */ - $datepicker_class = apply_filters( 'gravityview_search_datepicker_class', "gv-datepicker datepicker " . $this->get_datepicker_format() ); + $datepicker_class = apply_filters( 'gravityview_search_datepicker_class', 'gv-datepicker datepicker ' . $this->get_datepicker_format() ); $gravityview_view->datepicker_class = $datepicker_class; } @@ -2102,15 +2154,15 @@ private function get_datepicker_format( $date_format = false ) { $format = apply_filters( 'gravityview/widgets/search/datepicker/format', $default_format ); $gf_date_formats = array( - 'mdy' => 'm/d/Y', + 'mdy' => 'm/d/Y', - 'dmy_dash' => 'd-m-Y', - 'dmy_dot' => 'd.m.Y', - 'dmy' => 'd/m/Y', + 'dmy_dash' => 'd-m-Y', + 'dmy_dot' => 'd.m.Y', + 'dmy' => 'd/m/Y', 'ymd_slash' => 'Y/m/d', - 'ymd_dash' => 'Y-m-d', - 'ymd_dot' => 'Y.m.d', + 'ymd_dash' => 'Y-m-d', + 'ymd_dot' => 'Y.m.d', ); if ( ! $date_format ) { @@ -2132,7 +2184,7 @@ private function get_datepicker_format( $date_format = false ) { public function add_preview_inputs() { global $wp; - if ( ! is_preview() || ! current_user_can( 'publish_gravityviews') ) { + if ( ! is_preview() || ! current_user_can( 'publish_gravityviews' ) ) { return; } @@ -2179,7 +2231,7 @@ private function get_operator( $get, $key, $allowed, $default ) { } // end class -new GravityView_Widget_Search; +new GravityView_Widget_Search(); if ( ! gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) { return; @@ -2191,14 +2243,16 @@ private function get_operator( $get, $key, $allowed, $default ) { class GravityView_Widget_Search_Author_GF_Query_Condition extends \GF_Query_Condition { public function __construct( $filter, $view ) { $this->value = $filter['value']; - $this->view = $view; + $this->view = $view; } public function sql( $query ) { global $wpdb; $user_meta_fields = array( - 'nickname', 'first_name', 'last_name', + 'nickname', + 'first_name', + 'last_name', ); /** @@ -2209,7 +2263,10 @@ public function sql( $query ) { $user_meta_fields = apply_filters( 'gravityview/widgets/search/created_by/user_meta_fields', $user_meta_fields, $this->view ); $user_fields = array( - 'user_nicename', 'user_login', 'display_name', 'user_email', + 'user_nicename', + 'user_login', + 'display_name', + 'user_email', ); /** @@ -2222,11 +2279,11 @@ public function sql( $query ) { $conditions = array(); foreach ( $user_fields as $user_field ) { - $conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' ); + $conditions[] = $wpdb->prepare( "`u`.`$user_field` LIKE %s", '%' . $wpdb->esc_like( $this->value ) . '%' ); } foreach ( $user_meta_fields as $meta_field ) { - $conditions[] = $wpdb->prepare( "(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)", $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' ); + $conditions[] = $wpdb->prepare( '(`um`.`meta_key` = %s AND `um`.`meta_value` LIKE %s)', $meta_field, '%' . $wpdb->esc_like( $this->value ) . '%' ); } $conditions = '(' . implode( ' OR ', $conditions ) . ')'; From a4f989df0baab275714154a42fe523781f50d0e1 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Sun, 12 May 2024 23:11:19 +0300 Subject: [PATCH 06/24] Fix merge --- composer.lock | 501 ++++++++++++++++++++++++++++---------------------- 1 file changed, 279 insertions(+), 222 deletions(-) diff --git a/composer.lock b/composer.lock index 8701a8e96d..d3d13c7c64 100644 --- a/composer.lock +++ b/composer.lock @@ -237,12 +237,12 @@ "source": { "type": "git", "url": "git@github.com:GravityKit/Foundation.git", - "reference": "83d6647a5d632f1570ddafca1cbc9f7d83781e1c" + "reference": "29395f7fdda4df79c46f70c6c77fea18da0e1603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GravityKit/Foundation/zipball/83d6647a5d632f1570ddafca1cbc9f7d83781e1c", - "reference": "83d6647a5d632f1570ddafca1cbc9f7d83781e1c", + "url": "https://api.github.com/repos/GravityKit/Foundation/zipball/29395f7fdda4df79c46f70c6c77fea18da0e1603", + "reference": "29395f7fdda4df79c46f70c6c77fea18da0e1603", "shasum": "" }, "require": { @@ -322,10 +322,10 @@ } ], "support": { - "source": "https://github.com/GravityKit/Foundation/tree/v1.2.13", + "source": "https://github.com/GravityKit/Foundation/tree/main", "issues": "https://github.com/GravityKit/Foundation/issues" }, - "time": "2024-04-30T14:44:23+00:00" + "time": "2024-05-10T16:17:29+00:00" }, { "name": "illuminate/container", @@ -2463,16 +2463,16 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -2483,7 +2483,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -2507,9 +2507,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -2525,7 +2525,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -3779,28 +3779,28 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -3830,22 +3830,37 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "time": "2022-10-25T01:46:02+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", "shasum": "" }, "require": { @@ -3853,10 +3868,10 @@ "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -3885,9 +3900,24 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2022-10-24T09:00:36+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" }, { "name": "phpcsstandards/phpcsextra", @@ -3969,22 +3999,22 @@ }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.9", + "version": "1.0.11", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70" + "reference": "c457da9dabb60eb7106dd5e3c05132b1a6539c6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c457da9dabb60eb7106dd5e3c05132b1a6539c6a", + "reference": "c457da9dabb60eb7106dd5e3c05132b1a6539c6a", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.9.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", @@ -4053,7 +4083,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T14:50:00+00:00" + "time": "2024-04-24T11:47:18+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4354,16 +4384,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.37", + "version": "8.5.38", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fce30f306cee78be33ba00c8f9a853f41db0491b" + "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fce30f306cee78be33ba00c8f9a853f41db0491b", - "reference": "fce30f306cee78be33ba00c8f9a853f41db0491b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1ecad678646c817a29e55a32c930f3601c3f5a8c", + "reference": "1ecad678646c817a29e55a32c930f3601c3f5a8c", "shasum": "" }, "require": { @@ -4432,7 +4462,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.37" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.38" }, "funding": [ { @@ -4448,7 +4478,7 @@ "type": "tidelift" } ], - "time": "2024-03-06T06:27:42+00:00" + "time": "2024-04-05T04:31:23+00:00" }, { "name": "psr/container", @@ -4602,20 +4632,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -4639,7 +4669,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -4651,9 +4681,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -5666,16 +5696,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.9.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", + "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", "shasum": "" }, "require": { @@ -5685,11 +5715,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -5742,20 +5772,20 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-04-23T20:25:34+00:00" }, { "name": "symfony/browser-kit", - "version": "v5.4.35", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "2f6f979b579ed1c051465c3c2fb81daf5bb4a002" + "reference": "4c5d1a88ceee2b1c5c0b400b0137989ec34f70fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/2f6f979b579ed1c051465c3c2fb81daf5bb4a002", - "reference": "2f6f979b579ed1c051465c3c2fb81daf5bb4a002", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/4c5d1a88ceee2b1c5c0b400b0137989ec34f70fa", + "reference": "4c5d1a88ceee2b1c5c0b400b0137989ec34f70fa", "shasum": "" }, "require": { @@ -5798,7 +5828,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.35" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.39" }, "funding": [ { @@ -5814,20 +5844,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/console", - "version": "v5.4.36", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e" + "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", - "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", + "url": "https://api.github.com/repos/symfony/console/zipball/f3e591c48688a0cfa1a3296205926c05e84b22b1", + "reference": "f3e591c48688a0cfa1a3296205926c05e84b22b1", "shasum": "" }, "require": { @@ -5897,7 +5927,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.36" + "source": "https://github.com/symfony/console/tree/v5.4.39" }, "funding": [ { @@ -5913,20 +5943,20 @@ "type": "tidelift" } ], - "time": "2024-02-20T16:33:57+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.35", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "9e615d367e2bed41f633abb383948c96a2dbbfae" + "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/9e615d367e2bed41f633abb383948c96a2dbbfae", - "reference": "9e615d367e2bed41f633abb383948c96a2dbbfae", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/0934c9f1d433776f25c629bdc93f3e157d139e08", + "reference": "0934c9f1d433776f25c629bdc93f3e157d139e08", "shasum": "" }, "require": { @@ -5963,7 +5993,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.35" + "source": "https://github.com/symfony/css-selector/tree/v5.4.39" }, "funding": [ { @@ -5979,7 +6009,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6050,16 +6080,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.35", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "e3b4806f88abf106a411847a78619a542e71de29" + "reference": "1dffb111b038412b028caba029240e379fda85b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/e3b4806f88abf106a411847a78619a542e71de29", - "reference": "e3b4806f88abf106a411847a78619a542e71de29", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/1dffb111b038412b028caba029240e379fda85b2", + "reference": "1dffb111b038412b028caba029240e379fda85b2", "shasum": "" }, "require": { @@ -6105,7 +6135,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.35" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.39" }, "funding": [ { @@ -6121,20 +6151,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.35", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7a69a85c7ea5bdd1e875806a99c51a87d3a74b38" + "reference": "d40fae9fd85c762b6ba378152fdd1157a85d7e4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7a69a85c7ea5bdd1e875806a99c51a87d3a74b38", - "reference": "7a69a85c7ea5bdd1e875806a99c51a87d3a74b38", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d40fae9fd85c762b6ba378152fdd1157a85d7e4f", + "reference": "d40fae9fd85c762b6ba378152fdd1157a85d7e4f", "shasum": "" }, "require": { @@ -6190,7 +6220,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.35" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.39" }, "funding": [ { @@ -6206,7 +6236,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -6289,16 +6319,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.35", + "version": "v5.4.38", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "5a553607d4ffbfa9c0ab62facadea296c9db7086" + "reference": "899330a01056077271e2f614c7b28b0379a671eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5a553607d4ffbfa9c0ab62facadea296c9db7086", - "reference": "5a553607d4ffbfa9c0ab62facadea296c9db7086", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/899330a01056077271e2f614c7b28b0379a671eb", + "reference": "899330a01056077271e2f614c7b28b0379a671eb", "shasum": "" }, "require": { @@ -6333,7 +6363,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.35" + "source": "https://github.com/symfony/filesystem/tree/v5.4.38" }, "funding": [ { @@ -6349,7 +6379,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-03-21T08:05:07+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6892,16 +6922,16 @@ }, { "name": "symfony/string", - "version": "v5.4.36", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b" + "reference": "495e71bae5862308051b9e63cc3e34078eed83ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/4e232c83622bd8cd32b794216aa29d0d266d353b", - "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b", + "url": "https://api.github.com/repos/symfony/string/zipball/495e71bae5862308051b9e63cc3e34078eed83ef", + "reference": "495e71bae5862308051b9e63cc3e34078eed83ef", "shasum": "" }, "require": { @@ -6958,7 +6988,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.36" + "source": "https://github.com/symfony/string/tree/v5.4.39" }, "funding": [ { @@ -6974,20 +7004,20 @@ "type": "tidelift" } ], - "time": "2024-02-01T08:49:30+00:00" + "time": "2024-04-18T08:26:06+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.35", + "version": "v5.4.39", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e78db7f5c70a21f0417a31f414c4a95fe76c07e4" + "reference": "bc780e16879000f77a1022163c052f5323b5e640" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e78db7f5c70a21f0417a31f414c4a95fe76c07e4", - "reference": "e78db7f5c70a21f0417a31f414c4a95fe76c07e4", + "url": "https://api.github.com/repos/symfony/yaml/zipball/bc780e16879000f77a1022163c052f5323b5e640", + "reference": "bc780e16879000f77a1022163c052f5323b5e640", "shasum": "" }, "require": { @@ -7033,7 +7063,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.35" + "source": "https://github.com/symfony/yaml/tree/v5.4.39" }, "funding": [ { @@ -7049,7 +7079,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-04-23T11:57:27+00:00" }, { "name": "theseer/tokenizer", @@ -7156,16 +7186,16 @@ }, { "name": "wp-cli/cache-command", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/wp-cli/cache-command.git", - "reference": "205c004ce6127c605e4a71840a6f0b5be72b0517" + "reference": "1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/205c004ce6127c605e4a71840a6f0b5be72b0517", - "reference": "205c004ce6127c605e4a71840a6f0b5be72b0517", + "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97", + "reference": "1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97", "shasum": "" }, "require": { @@ -7225,9 +7255,9 @@ "homepage": "https://github.com/wp-cli/cache-command", "support": { "issues": "https://github.com/wp-cli/cache-command/issues", - "source": "https://github.com/wp-cli/cache-command/tree/v2.1.2" + "source": "https://github.com/wp-cli/cache-command/tree/v2.1.3" }, - "time": "2024-01-11T14:00:20+00:00" + "time": "2024-04-26T14:54:22+00:00" }, { "name": "wp-cli/checksum-command", @@ -7290,16 +7320,16 @@ }, { "name": "wp-cli/config-command", - "version": "v2.3.3", + "version": "v2.3.4", "source": { "type": "git", "url": "https://github.com/wp-cli/config-command.git", - "reference": "890b6e3c8fd945dcad2bff4bf565ba6dfb33e35d" + "reference": "445dfd0276a8e717ed4d2dd6f9dd0b769097fba4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/config-command/zipball/890b6e3c8fd945dcad2bff4bf565ba6dfb33e35d", - "reference": "890b6e3c8fd945dcad2bff4bf565ba6dfb33e35d", + "url": "https://api.github.com/repos/wp-cli/config-command/zipball/445dfd0276a8e717ed4d2dd6f9dd0b769097fba4", + "reference": "445dfd0276a8e717ed4d2dd6f9dd0b769097fba4", "shasum": "" }, "require": { @@ -7358,22 +7388,22 @@ "homepage": "https://github.com/wp-cli/config-command", "support": { "issues": "https://github.com/wp-cli/config-command/issues", - "source": "https://github.com/wp-cli/config-command/tree/v2.3.3" + "source": "https://github.com/wp-cli/config-command/tree/v2.3.4" }, - "time": "2023-12-21T10:01:16+00:00" + "time": "2024-03-01T12:07:39+00:00" }, { "name": "wp-cli/core-command", - "version": "v2.1.17", + "version": "v2.1.18", "source": { "type": "git", "url": "https://github.com/wp-cli/core-command.git", - "reference": "dcac4c36a3c596f1c81779bdbaa0c5f508f14075" + "reference": "f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/core-command/zipball/dcac4c36a3c596f1c81779bdbaa0c5f508f14075", - "reference": "dcac4c36a3c596f1c81779bdbaa0c5f508f14075", + "url": "https://api.github.com/repos/wp-cli/core-command/zipball/f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e", + "reference": "f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e", "shasum": "" }, "require": { @@ -7429,22 +7459,22 @@ "homepage": "https://github.com/wp-cli/core-command", "support": { "issues": "https://github.com/wp-cli/core-command/issues", - "source": "https://github.com/wp-cli/core-command/tree/v2.1.17" + "source": "https://github.com/wp-cli/core-command/tree/v2.1.18" }, - "time": "2024-01-11T11:03:57+00:00" + "time": "2024-04-12T09:36:36+00:00" }, { "name": "wp-cli/cron-command", - "version": "v2.2.3", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/wp-cli/cron-command.git", - "reference": "bc7e4bd2f441a5bb3b311e1419be2b05ed53146d" + "reference": "2108295a2f30de77d3ee70b1a60d1b542c2dfd79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/bc7e4bd2f441a5bb3b311e1419be2b05ed53146d", - "reference": "bc7e4bd2f441a5bb3b311e1419be2b05ed53146d", + "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/2108295a2f30de77d3ee70b1a60d1b542c2dfd79", + "reference": "2108295a2f30de77d3ee70b1a60d1b542c2dfd79", "shasum": "" }, "require": { @@ -7498,22 +7528,22 @@ "homepage": "https://github.com/wp-cli/cron-command", "support": { "issues": "https://github.com/wp-cli/cron-command/issues", - "source": "https://github.com/wp-cli/cron-command/tree/v2.2.3" + "source": "https://github.com/wp-cli/cron-command/tree/v2.3.0" }, - "time": "2023-08-30T13:31:32+00:00" + "time": "2024-02-15T10:23:39+00:00" }, { "name": "wp-cli/db-command", - "version": "v2.0.27", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/wp-cli/db-command.git", - "reference": "eea28dd115fb381c82641a2a3060856d3a67242d" + "reference": "bf741ebc532f7d4673f4552d1b3589265205cf32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/db-command/zipball/eea28dd115fb381c82641a2a3060856d3a67242d", - "reference": "eea28dd115fb381c82641a2a3060856d3a67242d", + "url": "https://api.github.com/repos/wp-cli/db-command/zipball/bf741ebc532f7d4673f4552d1b3589265205cf32", + "reference": "bf741ebc532f7d4673f4552d1b3589265205cf32", "shasum": "" }, "require": { @@ -7572,22 +7602,22 @@ "homepage": "https://github.com/wp-cli/db-command", "support": { "issues": "https://github.com/wp-cli/db-command/issues", - "source": "https://github.com/wp-cli/db-command/tree/v2.0.27" + "source": "https://github.com/wp-cli/db-command/tree/v2.1.0" }, - "time": "2023-11-13T12:34:44+00:00" + "time": "2024-04-27T03:11:44+00:00" }, { "name": "wp-cli/embed-command", - "version": "v2.0.15", + "version": "v2.0.16", "source": { "type": "git", "url": "https://github.com/wp-cli/embed-command.git", - "reference": "3987e2051354eaad842c8612ea9255493534c589" + "reference": "edfa448396484770a419ac7a17b0ec194ae76654" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/embed-command/zipball/3987e2051354eaad842c8612ea9255493534c589", - "reference": "3987e2051354eaad842c8612ea9255493534c589", + "url": "https://api.github.com/repos/wp-cli/embed-command/zipball/edfa448396484770a419ac7a17b0ec194ae76654", + "reference": "edfa448396484770a419ac7a17b0ec194ae76654", "shasum": "" }, "require": { @@ -7639,26 +7669,26 @@ "homepage": "https://github.com/wp-cli/embed-command", "support": { "issues": "https://github.com/wp-cli/embed-command/issues", - "source": "https://github.com/wp-cli/embed-command/tree/v2.0.15" + "source": "https://github.com/wp-cli/embed-command/tree/v2.0.16" }, - "time": "2023-08-30T15:52:06+00:00" + "time": "2024-04-04T11:57:03+00:00" }, { "name": "wp-cli/entity-command", - "version": "v2.6.2", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/wp-cli/entity-command.git", - "reference": "2b5d5d54550edb7383ebaa77fb3a2d53871ba19a" + "reference": "93476c25ce620396b44dd88d1c5f5768d4f3dc5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/2b5d5d54550edb7383ebaa77fb3a2d53871ba19a", - "reference": "2b5d5d54550edb7383ebaa77fb3a2d53871ba19a", + "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/93476c25ce620396b44dd88d1c5f5768d4f3dc5a", + "reference": "93476c25ce620396b44dd88d1c5f5768d4f3dc5a", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.10" + "wp-cli/wp-cli": "^2.11" }, "require-dev": { "wp-cli/cache-command": "^1 || ^2", @@ -7764,11 +7794,20 @@ "site activate", "site archive", "site create", + "site generate", "site deactivate", "site delete", "site empty", "site list", "site mature", + "site meta", + "site meta add", + "site meta delete", + "site meta get", + "site meta list", + "site meta patch", + "site meta pluck", + "site meta update", "site option", "site private", "site public", @@ -7798,8 +7837,17 @@ "user", "user add-cap", "user add-role", + "user application-password", + "user application-password create", + "user application-password delete", + "user application-password exists", + "user application-password get", + "user application-password list", + "user application-password record-usage", + "user application-password update", "user create", "user delete", + "user exists", "user generate", "user get", "user import-csv", @@ -7820,6 +7868,11 @@ "user session destroy", "user session list", "user set-role", + "user signup", + "user signup activate", + "user signup delete", + "user signup get", + "user signup list", "user spam", "user term", "user term add", @@ -7853,9 +7906,9 @@ "homepage": "https://github.com/wp-cli/entity-command", "support": { "issues": "https://github.com/wp-cli/entity-command/issues", - "source": "https://github.com/wp-cli/entity-command/tree/v2.6.2" + "source": "https://github.com/wp-cli/entity-command/tree/v2.8.0" }, - "time": "2024-02-06T13:38:03+00:00" + "time": "2024-05-04T10:49:23+00:00" }, { "name": "wp-cli/eval-command", @@ -7980,16 +8033,16 @@ }, { "name": "wp-cli/extension-command", - "version": "v2.1.19", + "version": "v2.1.21", "source": { "type": "git", "url": "https://github.com/wp-cli/extension-command.git", - "reference": "80713703e090fbc74926af6f75bf963619f76fdb" + "reference": "f9bc3fd2f2dabcbe9b3bc3dc9591535dd714fd3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/80713703e090fbc74926af6f75bf963619f76fdb", - "reference": "80713703e090fbc74926af6f75bf963619f76fdb", + "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/f9bc3fd2f2dabcbe9b3bc3dc9591535dd714fd3c", + "reference": "f9bc3fd2f2dabcbe9b3bc3dc9591535dd714fd3c", "shasum": "" }, "require": { @@ -8072,9 +8125,9 @@ "homepage": "https://github.com/wp-cli/extension-command", "support": { "issues": "https://github.com/wp-cli/extension-command/issues", - "source": "https://github.com/wp-cli/extension-command/tree/v2.1.19" + "source": "https://github.com/wp-cli/extension-command/tree/v2.1.21" }, - "time": "2024-02-05T14:53:09+00:00" + "time": "2024-05-02T13:35:09+00:00" }, { "name": "wp-cli/i18n-command", @@ -8207,16 +8260,16 @@ }, { "name": "wp-cli/language-command", - "version": "v2.0.19", + "version": "v2.0.20", "source": { "type": "git", "url": "https://github.com/wp-cli/language-command.git", - "reference": "4d0a2e58f8c48772e0a85a3b25f413ef240c212a" + "reference": "2e6edc65aff1828b79250b96ace93d77abcca481" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/language-command/zipball/4d0a2e58f8c48772e0a85a3b25f413ef240c212a", - "reference": "4d0a2e58f8c48772e0a85a3b25f413ef240c212a", + "url": "https://api.github.com/repos/wp-cli/language-command/zipball/2e6edc65aff1828b79250b96ace93d77abcca481", + "reference": "2e6edc65aff1828b79250b96ace93d77abcca481", "shasum": "" }, "require": { @@ -8280,22 +8333,22 @@ "homepage": "https://github.com/wp-cli/language-command", "support": { "issues": "https://github.com/wp-cli/language-command/issues", - "source": "https://github.com/wp-cli/language-command/tree/v2.0.19" + "source": "https://github.com/wp-cli/language-command/tree/v2.0.20" }, - "time": "2024-02-01T14:28:11+00:00" + "time": "2024-02-20T12:36:40+00:00" }, { "name": "wp-cli/maintenance-mode-command", - "version": "v2.1.0", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/wp-cli/maintenance-mode-command.git", - "reference": "2e9845a1cd1678b960dd8d0dd0c936648113788c" + "reference": "a329a536eb96890654b913b5499b300fcc3f8eab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/maintenance-mode-command/zipball/2e9845a1cd1678b960dd8d0dd0c936648113788c", - "reference": "2e9845a1cd1678b960dd8d0dd0c936648113788c", + "url": "https://api.github.com/repos/wp-cli/maintenance-mode-command/zipball/a329a536eb96890654b913b5499b300fcc3f8eab", + "reference": "a329a536eb96890654b913b5499b300fcc3f8eab", "shasum": "" }, "require": { @@ -8341,22 +8394,22 @@ "homepage": "https://github.com/wp-cli/maintenance-mode-command", "support": { "issues": "https://github.com/wp-cli/maintenance-mode-command/issues", - "source": "https://github.com/wp-cli/maintenance-mode-command/tree/v2.1.0" + "source": "https://github.com/wp-cli/maintenance-mode-command/tree/v2.1.1" }, - "time": "2023-11-06T14:04:13+00:00" + "time": "2024-04-04T11:28:11+00:00" }, { "name": "wp-cli/media-command", - "version": "v2.0.21", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/wp-cli/media-command.git", - "reference": "4950ed4ded35c52068d30fec080d545a33baa85c" + "reference": "210cccf80f4faa38c0c608768089edf7acf2b319" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/media-command/zipball/4950ed4ded35c52068d30fec080d545a33baa85c", - "reference": "4950ed4ded35c52068d30fec080d545a33baa85c", + "url": "https://api.github.com/repos/wp-cli/media-command/zipball/210cccf80f4faa38c0c608768089edf7acf2b319", + "reference": "210cccf80f4faa38c0c608768089edf7acf2b319", "shasum": "" }, "require": { @@ -8403,9 +8456,9 @@ "homepage": "https://github.com/wp-cli/media-command", "support": { "issues": "https://github.com/wp-cli/media-command/issues", - "source": "https://github.com/wp-cli/media-command/tree/v2.0.21" + "source": "https://github.com/wp-cli/media-command/tree/v2.1.0" }, - "time": "2023-11-10T21:56:52+00:00" + "time": "2024-03-14T09:04:20+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -8460,16 +8513,16 @@ }, { "name": "wp-cli/package-command", - "version": "v2.5.0", + "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/wp-cli/package-command.git", - "reference": "71683195f8c27ad97009628e2a72d2a4155503b2" + "reference": "afa90e92e6b2b1f9fe754963726909433facd9f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/package-command/zipball/71683195f8c27ad97009628e2a72d2a4155503b2", - "reference": "71683195f8c27ad97009628e2a72d2a4155503b2", + "url": "https://api.github.com/repos/wp-cli/package-command/zipball/afa90e92e6b2b1f9fe754963726909433facd9f5", + "reference": "afa90e92e6b2b1f9fe754963726909433facd9f5", "shasum": "" }, "require": { @@ -8519,9 +8572,9 @@ "homepage": "https://github.com/wp-cli/package-command", "support": { "issues": "https://github.com/wp-cli/package-command/issues", - "source": "https://github.com/wp-cli/package-command/tree/v2.5.0" + "source": "https://github.com/wp-cli/package-command/tree/v2.5.1" }, - "time": "2023-12-08T10:38:16+00:00" + "time": "2024-04-26T10:03:17+00:00" }, { "name": "wp-cli/php-cli-tools", @@ -8715,16 +8768,16 @@ }, { "name": "wp-cli/scaffold-command", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/wp-cli/scaffold-command.git", - "reference": "8aa906c3ec6ae7d95f38c962fc2561714f9c7145" + "reference": "7a7d145c260ead64fa93a59498d60def970d5214" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/8aa906c3ec6ae7d95f38c962fc2561714f9c7145", - "reference": "8aa906c3ec6ae7d95f38c962fc2561714f9c7145", + "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/7a7d145c260ead64fa93a59498d60def970d5214", + "reference": "7a7d145c260ead64fa93a59498d60def970d5214", "shasum": "" }, "require": { @@ -8775,22 +8828,22 @@ "homepage": "https://github.com/wp-cli/scaffold-command", "support": { "issues": "https://github.com/wp-cli/scaffold-command/issues", - "source": "https://github.com/wp-cli/scaffold-command/tree/v2.2.0" + "source": "https://github.com/wp-cli/scaffold-command/tree/v2.3.0" }, - "time": "2023-11-16T15:25:33+00:00" + "time": "2024-04-26T21:05:48+00:00" }, { "name": "wp-cli/search-replace-command", - "version": "v2.1.5", + "version": "v2.1.6", "source": { "type": "git", "url": "https://github.com/wp-cli/search-replace-command.git", - "reference": "f6c828abc6d5054d5bbf202b917d2a3b38abed84" + "reference": "d908c57ba744e14a32f3a577f9e45378d3fe1349" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/f6c828abc6d5054d5bbf202b917d2a3b38abed84", - "reference": "f6c828abc6d5054d5bbf202b917d2a3b38abed84", + "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/d908c57ba744e14a32f3a577f9e45378d3fe1349", + "reference": "d908c57ba744e14a32f3a577f9e45378d3fe1349", "shasum": "" }, "require": { @@ -8835,9 +8888,9 @@ "homepage": "https://github.com/wp-cli/search-replace-command", "support": { "issues": "https://github.com/wp-cli/search-replace-command/issues", - "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.5" + "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.6" }, - "time": "2024-01-09T00:29:39+00:00" + "time": "2024-05-07T09:27:51+00:00" }, { "name": "wp-cli/server-command", @@ -8956,16 +9009,16 @@ }, { "name": "wp-cli/super-admin-command", - "version": "v2.0.13", + "version": "v2.0.14", "source": { "type": "git", "url": "https://github.com/wp-cli/super-admin-command.git", - "reference": "9d91c131ad814f9bcec313c3877e8348622720d5" + "reference": "0fc8a6146d0450a8b522485e50886e976f5249b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/9d91c131ad814f9bcec313c3877e8348622720d5", - "reference": "9d91c131ad814f9bcec313c3877e8348622720d5", + "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/0fc8a6146d0450a8b522485e50886e976f5249b6", + "reference": "0fc8a6146d0450a8b522485e50886e976f5249b6", "shasum": "" }, "require": { @@ -9011,22 +9064,22 @@ "homepage": "https://github.com/wp-cli/super-admin-command", "support": { "issues": "https://github.com/wp-cli/super-admin-command/issues", - "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.13" + "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.14" }, - "time": "2024-01-08T12:21:39+00:00" + "time": "2024-02-26T12:17:45+00:00" }, { "name": "wp-cli/widget-command", - "version": "v2.1.9", + "version": "v2.1.10", "source": { "type": "git", "url": "https://github.com/wp-cli/widget-command.git", - "reference": "fa67eb62b3b0248014f48fb1280bfdea2eb96712" + "reference": "7062ed3fdfa17265320737f43efe5651d783f439" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/fa67eb62b3b0248014f48fb1280bfdea2eb96712", - "reference": "fa67eb62b3b0248014f48fb1280bfdea2eb96712", + "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/7062ed3fdfa17265320737f43efe5651d783f439", + "reference": "7062ed3fdfa17265320737f43efe5651d783f439", "shasum": "" }, "require": { @@ -9078,22 +9131,22 @@ "homepage": "https://github.com/wp-cli/widget-command", "support": { "issues": "https://github.com/wp-cli/widget-command/issues", - "source": "https://github.com/wp-cli/widget-command/tree/v2.1.9" + "source": "https://github.com/wp-cli/widget-command/tree/v2.1.10" }, - "time": "2023-08-30T15:52:58+00:00" + "time": "2024-04-19T13:21:01+00:00" }, { "name": "wp-cli/wp-cli", - "version": "v2.10.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-cli.git", - "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685" + "reference": "6d78633580dbec4856979210b597a1c9c687e163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/a339dca576df73c31af4b4d8054efc2dab9a0685", - "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/6d78633580dbec4856979210b597a1c9c687e163", + "reference": "6d78633580dbec4856979210b597a1c9c687e163", "shasum": "" }, "require": { @@ -9116,6 +9169,7 @@ "ext-readline": "Include for a better --prompt implementation", "ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates" }, + "default-branch": true, "bin": [ "bin/wp", "bin/wp.bat" @@ -9123,7 +9177,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.10.x-dev" + "dev-main": "2.11.x-dev" } }, "autoload": { @@ -9150,7 +9204,7 @@ "issues": "https://github.com/wp-cli/wp-cli/issues", "source": "https://github.com/wp-cli/wp-cli" }, - "time": "2024-02-08T16:52:43+00:00" + "time": "2024-04-27T02:25:56+00:00" }, { "name": "wp-cli/wp-cli-bundle", @@ -9271,16 +9325,16 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "3.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", "shasum": "" }, "require": { @@ -9289,16 +9343,16 @@ "ext-tokenizer": "*", "ext-xmlreader": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.2" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.10", + "squizlabs/php_codesniffer": "^3.9.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "suggest": { "ext-iconv": "For improved results", @@ -9329,24 +9383,24 @@ }, "funding": [ { - "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "url": "https://opencollective.com/php_codesniffer", "type": "custom" } ], - "time": "2023-09-14T07:06:09+00:00" + "time": "2024-03-25T16:39:00+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", - "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/a0f7d708794a738f328d7b6c94380fd1d6c40446", + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446", "shasum": "" }, "require": { @@ -9354,7 +9408,9 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { - "yoast/yoastcs": "^2.3.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.1.0" }, "type": "library", "extra": { @@ -9391,9 +9447,10 @@ ], "support": { "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-08-19T14:25:08+00:00" + "time": "2024-04-05T16:01:51+00:00" }, { "name": "zordius/lightncandy", From 66d280dbced7dd86077abf844d24d1d1908fa31b Mon Sep 17 00:00:00 2001 From: omarkasem Date: Wed, 15 May 2024 17:23:19 +0300 Subject: [PATCH 07/24] Remove entry_meta_key so we don't get the callback to override the test value --- includes/fields/class-gravityview-field-is-read.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index 320508690a..e9d4b72093 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -19,8 +19,6 @@ class GravityView_Field_Is_Read extends GravityView_Field { var $icon = 'dashicons-book-alt'; - var $entry_meta_key = 'is_read'; - var $entry_meta_is_default_column = true; var $is_numeric = true; @@ -137,8 +135,7 @@ public function print_script( $context ) { name: 'is_read', value: 1 } - }) - .done(function() { + }).done(function() { if(read_field.parents('tbody').length > 0){ read_field.find('td').text(read_label); }else{ From 925dd4fb6e17e2cfa67f508fee2e9cbf2288665f Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Wed, 13 Mar 2024 18:34:28 +0800 Subject: [PATCH 08/24] Update the textdomain --- .../class-gravityview-field-is-read.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index e9d4b72093..04cca3faa9 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -33,9 +33,9 @@ class GravityView_Field_Is_Read extends GravityView_Field { */ public function __construct() { - $this->label = esc_html__( 'Read Status', 'gravityview' ); - $this->default_search_label = __( 'Is Read', 'gravityview' ); - $this->description = esc_html__( 'Display whether the entry has been read.', 'gravityview' ); + $this->label = esc_html__( 'Read Status', 'gk-gravityview' ); + $this->default_search_label = __( 'Is Read', 'gk-gravityview' ); + $this->description = esc_html__( 'Display whether the entry has been read.', 'gk-gravityview' ); $this->add_hooks(); @@ -52,16 +52,16 @@ public function field_options( $field_options, $template_id, $field_id, $context $field_options['is_read_label'] = array( 'type' => 'text', - 'label' => __( 'Read Label', 'gravityview' ), - 'desc' => __( 'If the entry has been read, display this value', 'gravityview' ), - 'value' => __( 'Read', 'gravityview' ), + 'label' => __( 'Read Label', 'gk-gravityview' ), + 'desc' => __( 'If the entry has been read, display this value', 'gk-gravityview' ), + 'value' => __( 'Read', 'gk-gravityview' ), ); $field_options['is_unread_label'] = array( 'type' => 'text', - 'label' => __( 'Unread Label', 'gravityview' ), - 'desc' => __( 'If the entry has not been read, display this value', 'gravityview' ), - 'value' => __( 'Unread', 'gravityview' ), + 'label' => __( 'Unread Label', 'gk-gravityview' ), + 'desc' => __( 'If the entry has not been read, display this value', 'gk-gravityview' ), + 'value' => __( 'Unread', 'gk-gravityview' ), ); return $field_options; @@ -82,10 +82,10 @@ public function field_options( $field_options, $template_id, $field_id, $context * @return string Value of the field */ public function get_value( $value, $field, $view, $source, $entry, $request ) { - self::$is_read_label = \GV\Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gravityview' ) ); + self::$is_read_label = \GV\Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gk-gravityview' ) ); if ( empty( $value ) ) { - return \GV\Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gravityview' ) ); + return \GV\Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gk-gravityview' ) ); } self::$is_read = true; @@ -143,7 +143,7 @@ public function print_script( $context ) { } }) .fail(function() { - alert(); + alert(); }); }); From 262e2db31d63bb0b5c4ae872a309461b20c25d1c Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Mon, 20 May 2024 21:21:48 -0400 Subject: [PATCH 09/24] Fix the code running even when the entry was read --- includes/fields/class-gravityview-field-is-read.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index 04cca3faa9..870613ae54 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -110,7 +110,7 @@ public function print_script( $context ) { return; } - if ( self::$is_read ) { + if ( ! empty( $entry['is_read'] ) ) { return; } From 3806100fa026b25a493d4c9e8fd655b1a9e045f0 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Mon, 20 May 2024 21:22:05 -0400 Subject: [PATCH 10/24] Remove deprecated code --- includes/fields/class-gravityview-field-is-read.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index 870613ae54..da343b47f2 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -106,7 +106,9 @@ public function print_script( $context ) { return; } - if ( gravityview_get_context() !== 'single' ) { + $entry = gravityview()->request->is_entry(); + + if ( ! $entry ) { return; } From 94d1161990134d8f02776f06569058511a4b02bb Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Mon, 20 May 2024 21:23:19 -0400 Subject: [PATCH 11/24] Fix AJAX not running w/out Read Status field When the field wasn't in the Single Entry screen, the JS wasn't running. --- includes/fields/class-gravityview-field-is-read.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index da343b47f2..bcd138585a 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -119,9 +119,6 @@ public function print_script( $context ) { ?> Date: Mon, 27 May 2024 13:08:32 -0400 Subject: [PATCH 23/24] Use class imports --- includes/fields/class-gravityview-field-is-read.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index e4ca30c8fb..2cd2f842c8 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -8,6 +8,7 @@ use GV\Field; use GV\Template_Context; +use GV\Utils; use GV\View; /** @@ -68,7 +69,7 @@ public function add_entry_meta( $entry_meta ) { * @since TBD */ private function add_hooks() { - /** @see \GV\Field::get_value_filters */ + /** @see Field::get_value_filters */ add_filter( 'gravityview/field/is-read/value', [ $this, 'get_value' ], 10, 3 ); add_action( 'gravityview/template/after', [ $this, 'print_script' ], 10, 1 ); } @@ -109,7 +110,7 @@ public function field_options( $field_options, $template_id, $field_id, $context */ public function get_value( $value, $field, $view ) { if ( empty( $value ) ) { - return \GV\Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gk-gravityview' ) ); + return Utils::get( $field, 'is_unread_label', esc_html__( 'Unread', 'gk-gravityview' ) ); } return $this->get_is_read_label( $field, $view ); @@ -126,7 +127,7 @@ public function get_value( $value, $field, $view ) { * @return string The string to use for "Read". */ protected function get_is_read_label( $field, $view ) { - $label = \GV\Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gk-gravityview' ) ); + $label = Utils::get( $field, 'is_read_label', esc_html__( 'Read', 'gk-gravityview' ) ); /** * Modify the "Read" label. From c4d2dbc3f40ce33c1ae7406a6418a8af98eed292 Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 27 May 2024 13:09:21 -0400 Subject: [PATCH 24/24] Use the correct filter name --- includes/fields/class-gravityview-field-is-read.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/fields/class-gravityview-field-is-read.php b/includes/fields/class-gravityview-field-is-read.php index 2cd2f842c8..c2ce8d4645 100644 --- a/includes/fields/class-gravityview-field-is-read.php +++ b/includes/fields/class-gravityview-field-is-read.php @@ -70,7 +70,7 @@ public function add_entry_meta( $entry_meta ) { */ private function add_hooks() { /** @see Field::get_value_filters */ - add_filter( 'gravityview/field/is-read/value', [ $this, 'get_value' ], 10, 3 ); + add_filter( 'gravityview/field/is_read/value', [ $this, 'get_value' ], 10, 3 ); add_action( 'gravityview/template/after', [ $this, 'print_script' ], 10, 1 ); }