I am using the <!–nextpage–> tag on a WP page. This works fine apart from one wee problem – the URL of the page in question has a URL parameter
?language=1appended to it and this is not passed on by the wp_link_pages code to the more page links.
For example, the page
/news?language=1produces the links
/news/3/at the bottom of the page, dropping the URL parameter.
Ok, I said to myself when I discovered the problem, I’ll just use the more_file parameter as described here (I am using a child theme with my own custom and controllable call to wp_link_pages) with some additional PHP that programmatically sets the links. However, on trying this, I couldn’t get the more_file parameter to work.
I ended up resorting to perusing the code for wp_link_pages(), only to find out that the more_file parameter is not defined or used, yet remains in the documentation!
So, it looks like I will have to end up customising _wp_link_page(), the helper function to wp_link_pages(), to modify the link strings. However this function isn’t pluggable. Is there any way I can override it in my child function without having to edit core WP itself. Or, is there another way to achieve what I want to do (i.e. automatically add the required parameter to the more page links)?
Many thanks in advance.
- The topic ‘Overriding _wp_link_page to compensate for lacking more_file parameter’ is closed to new replies.