Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guest Authors: Add labels property #942

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Conversation

GaryJones
Copy link
Contributor

Description

Dynamically created class properties are deprecated in PHP 8.2, so this change explicitly defines the property in the class.

The $labels property is assigned to in the constructor of this Guest Authors class.

The property needs to be public, as it is used by the list table class when defining the search box label.

Steps to Test

Note that running on PHP 8.2 generates a PHP deprecation message like:

PHP message: Deprecated: Creation of dynamic property CoAuthors_Guest_Authors::$labels is deprecated in /var/www/wp-content/plugins/co-authors-plus/php/class-coauthors-guest-authors.php on line 85

After merging, this deprecation message will stop.

Dynamically created class properties are deprecated in PHP 8.2, so this change explicitly defines the property in the class.

It needs to be public, as it is used by the list table class when defining the search box label.
Copy link
Member

@raamdev raamdev left a comment

Choose a reason for hiding this comment

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

Looks good to me. ✅

@GaryJones GaryJones merged commit 0212fd7 into master Jul 21, 2023
@GaryJones GaryJones deleted the fix/labels-dynamic-property branch July 21, 2023 15:22
@GaryJones GaryJones added this to the 3.5.11 milestone Jul 22, 2023
@GaryJones GaryJones self-assigned this Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants