Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@btb
Copy link

@btb btb commented Feb 28, 2025

Because the $depth argument to display_element is optional (has a default value of 0) it doesn't make sense for the following options to be required (no default value), so this results in warnings like:

Deprecated: Required parameter ... follows optional parameter ...

Since the $depth parameter is not optional in the parent classes (in WP core), and it's not really possible for any caller to leave it out anyway, just put it back to required.

btb added 2 commits February 27, 2025 19:53
Because the $depth argument to display_element is optional (has a
default value of 0) it doesn't make sense for the following options to
be required (no default value), so this results in warnings like:

Deprecated: Required parameter ... follows optional parameter ...

Since the $depth parameter is not optional in the parent classes (in WP
core), and it's not really possible for any caller to leave it out
anyway, just put it back to required.
Undeclared class properties result in warning messages on PHP 8.2, such
as:
Deprecated: Creation of dynamic property UW_FooterMenu::$menu_items is
 deprecated in uw_wp_theme/inc/nav/footermenu.php on line 17

This just declares all such variables as public properties of each
class (which is what dynamic properties are equivalent to), although
from a surface glance, many of these could be changed to protected,
private, or not be class properties at all.
@btb
Copy link
Author

btb commented Feb 28, 2025

Added some more fixes, for PHP 8.2

@btb btb changed the title Fix deprecation warnings on PHP 8.1 Fix deprecation warnings on PHP 8.1, 8.2 Feb 28, 2025
It looks like this code will cause any previously-added tinymce-plugins
in the array to be lost, and return only its own. Fix by adding to and
returning the array we were given.

Fixes the warning:
Warning: Undefined variable $plugin_array in uw_wp_theme/inc/shortcodes/class.media-credit.php on line 32
@btb
Copy link
Author

btb commented Mar 1, 2025

Added another fix, not a deprecation, but it seems like this warning may be new.

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.

1 participant