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_tocfunction.
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_rowandmpp_toc. In the beginning of thempp_tocfunction you retrieve the params and apply thempp_toc_argsfilter to it, allowing customizations. But to thempp_tocfilter 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$rinstead of$args?
Also$ris not passed to thempp_toc_pages_rowfilter. Therefore it is not possible to generate different rows in the filter depending on$r. Passing$rto thempp_toc_pages_rowfilter would be really nice.Best regards
TiKu
The topic ‘Some thoughts on mpp_toc function’ is closed to new replies.