Some thoughts on mpp_toc function
-
Currently I’m using a highly customized version of your great plugin. Since you’ve added some good filters, I could already reduce my code additions to the plugin’s code a lot. Currently I’m trying to get rid of my code changes in the
mpp_toc
function.
I think I have found a problem in your code:
if ( $i != $page || ! $more && 1 == $page ) {
In my opinion there are missing paranthesis. Otherwise you have the||
operator at the same level as the&&
operator which rarely is a good idea.But my main reason for opening this topic are the filters
mpp_toc_pages_row
andmpp_toc
. In the beginning of thempp_toc
function you retrieve the params and apply thempp_toc_args
filter to it, allowing customizations. But to thempp_toc
filter you pass the original params instead of the customized ones. Of course I could customize the params once again, but wouldn’t it be better to pass$r
instead of$args
?
Also$r
is not passed to thempp_toc_pages_row
filter. Therefore it is not possible to generate different rows in the filter depending on$r
. Passing$r
to thempp_toc_pages_row
filter would be really nice.Best regards
TiKu
- The topic ‘Some thoughts on mpp_toc function’ is closed to new replies.