I'm working on a new theme. I need a mostly new renderPageNavMenuItem(), which is defined as a private function in the Wcms class.
I don't do much PHP OOP stuff. Understand it barely enough to be dangerous.
Can I overload renderPageNaveMenuItem() and if so, how?
If not, then I can take a shot at modifying my theme.php to locally define that, and the menu() that calls it.
Overload private functions in $Wcms?
-
- Posts: 16
- Joined: Tue Apr 25, 2023 1:21 pm
[SOLVED] Re: Overload private functions in $Wcms?
Never mind.
Instead, I copied menu() and renderPageNavMenuItem() into functions.php.
There, I made a few tweaks of $this to $Wcms.
In theme.php I call menu() instead of $Wcms->menu().
It's working, so now I can proceed with the theme.
There might be some gotcha with plugins or something, but not that I've found yet.
Instead, I copied menu() and renderPageNavMenuItem() into functions.php.
There, I made a few tweaks of $this to $Wcms.
In theme.php I call menu() instead of $Wcms->menu().
It's working, so now I can proceed with the theme.
There might be some gotcha with plugins or something, but not that I've found yet.