Skip to content

Conversation

@HPiirainen
Copy link
Contributor

No description provided.

@HPiirainen HPiirainen requested a review from Nomafin December 7, 2023 14:53
$this->redipress_add_queryable_method = $method;
$this->redipress_add_queryable = true;
$this->redipress_add_queryable_field_name = $field_name;
$this->redipress_add_queryable_field_weight = $weight;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nomafin - changed this as there were a few usages for both redipress_add_queryable_weight (not defined in class) and redipress_add_queryable_field_weight (defined in class). I believe they should both be the same, right? If not, I will make changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, very probable they should be the same and this is just a mistake.

Copy link
Contributor

@Liblastic Liblastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes check the comments.

src/Field.php Outdated
* An internal function to be run with the add queryable functionality.
*/
private function redipress_add_queryable_internal() {
$field_name = $this->redipress_add_queryable_field_name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, seems like this is not used inside the function.
So this could be removed.

Suggested change
$field_name = $this->redipress_add_queryable_field_name;

src/Field.php Outdated
private function redipress_add_queryable_internal() {
$field_name = $this->redipress_add_queryable_field_name;
$weight = $this->redipress_add_queryable_weight;
$weight = $this->redipress_add_queryable_field_weight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also redundant, not used inside the function.
Not sure if this is legacy code.

Suggested change
$weight = $this->redipress_add_queryable_field_weight;

/**
* Layout active
*
* @var boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually an integer with value 1 or 0.

Suggested change
* @var boolean
* @var int $active Values 1 or 0.


?>
<div <?php acf_esc_attr_e( $div ); ?>>
<div <?php echo acf_esc_attrs( $div ); ?>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear that it is an ACF function.

Suggested change
<div <?php echo acf_esc_attrs( $div ); ?>>
<div <?php echo \acf_esc_attrs( $div ); ?>>

public function ajax_add_term() {
// vars
$args = wp_parse_args( $_POST, array(
$args = wp_parse_args( $_POST, [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$args = wp_parse_args( $_POST, [
$args = \wp_parse_args( $_POST, [


?>
<div <?php acf_esc_attr_e( $div ); ?>>
<div <?php echo acf_esc_attrs( $div ); ?>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div <?php echo acf_esc_attrs( $div ); ?>>
<div <?php echo \acf_esc_attrs( $div ); ?>>

Copy link
Contributor

@Nomafin Nomafin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@HPiirainen HPiirainen merged commit 195059b into master Jan 10, 2024
@HPiirainen HPiirainen deleted the php82-deprecations branch January 10, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants