So I’ve created an extension that allows you to hide weblogs from the publish tab. But I’ve done it in a way which feels very hackish, and doesn’t seem like a good long-term solution.
All I really need to do is to insert 2 lines of code in $DSP->page_navigation(), but the only way I can see to do it is to use the “cp_display_page_navigation” extension hook, and so I need to replace that entire function.
To do that I’ve just taken that entire function and put it into my extension, and added my 2 lines of code.
It works like a champ, but like I said this doesn’t seem like a viable long-term strategy for doing this. At any time the official page_navigation() function could be updated, but my extension won’t reflect this and will be using the old code since it’s now in my extension. So then I would need to keep multiple versions of my extension - have a new one for each version that has a change in the page_navigation function - and I would need to make sure to keep each of these available for myself or others who are running different versions of EE.
What is good practice here? Like I said, all I need to do is add 2 lines of code to a function that is about 500 lines long.