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

Fix PHP warning in widget utils REST controller #25797

Conversation

david-binda
Copy link
Contributor

The WP_REST_Widget_Utils_Controller::is_valid_widget method needs to be public in order to be accessible as a callback (since it's being called from outside the class, via call_user_func).

This commit fixes the warning by changing the method's visibility from private to public.

Description

This commit changes the WP_REST_Widget_Utils_Controller::is_valid_widget method's visibility from private to public

How has this been tested?

This has been manually tested on the new widgets screen, while checking the PHP error logs.

Screenshots

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

The `WP_REST_Widget_Utils_Controller::is_valid_widget` method needs to be public in order to be accessible as a callback (since it's being called from outside the class, via `call_user_func`).

This commit fixes the warning by changing the method's visibility from `private` to `public`.
Copy link
Contributor

@talldan talldan left a comment

Choose a reason for hiding this comment

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

Thanks for catching that 🎉

@talldan talldan added [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Type] Bug An existing feature does not function as intended First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository labels Oct 5, 2020
@talldan talldan merged commit 3d406a5 into WordPress:master Oct 5, 2020
@github-actions
Copy link

github-actions bot commented Oct 5, 2020

Congratulations on your first merged pull request, @david-binda! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 9.2 milestone Oct 5, 2020
@talldan talldan changed the title Fix/php warining in widget utils controller Fix PHP warning in widget utils REST controller Oct 5, 2020
@david-binda david-binda deleted the fix/php-warining-in-widget-utils-controller branch October 5, 2020 08:27
adamziel pushed a commit that referenced this pull request Oct 7, 2020
* Fix PHP warning in WP_REST_Widget_Utils_Controller

The `WP_REST_Widget_Utils_Controller::is_valid_widget` method needs to be public in order to be accessible as a callback (since it's being called from outside the class, via `call_user_func`).

This commit fixes the warning by changing the method's visibility from `private` to `public`.

* Ammend the inline documentation. Add `* @access public`
@adamziel adamziel mentioned this pull request Oct 7, 2020
draganescu pushed a commit that referenced this pull request Oct 7, 2020
* Include edit-widgets php files in build (#25792)

* Fix PHP warining in widget utils controller (#25797)

* Fix PHP warning in WP_REST_Widget_Utils_Controller

The `WP_REST_Widget_Utils_Controller::is_valid_widget` method needs to be public in order to be accessible as a callback (since it's being called from outside the class, via `call_user_func`).

This commit fixes the warning by changing the method's visibility from `private` to `public`.

* Ammend the inline documentation. Add `* @access public`

* [Widgets Editor] Fix insertion point in widget areas (#25727)

* Move hooks inside the newly created Interface component

* Fix insertion at the top of the widget area

* Fix widget insertion from sidebar block library by using a declared insertionPoint prop (#25763)

* Fix widget insertion from sidebar block library by using a declared insertionPoint prop

* Add comments

* Optimize by avoiding `getEntityRecord` call unless needed

Co-authored-by: Daniel Richards <daniel.richards@automattic.com>

* Initialize the state before rendering widgets editor (#25736)

* Initialize the state before rendering widgets editor

* Replace empty div with null

* Document persistStubPost

* Document persistStubPost further

* Bump version to 9.1.1

* Update changelog

* Fix spaces in changelog.txt

* Adjust spaces in changelog.txt

* Fix link formatting in the changelog

Co-authored-by: Jon Surrell <jon.surrell@automattic.com>
Co-authored-by: David Biňovec <david.binovec@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Daniel Richards <daniel.richards@automattic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Screen The block-based screen that replaced widgets.php. First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants