Member
Member
wongm   2018-12-27, 02:20
#1
The 'checkPageValidity' method provides a custom way to flag URL pages as out-of-bounds for custom themes.

But I can't seem to make it work in my custom theme:
https://github.com/wongm/rail-history-cms/blob/master/themes/rail-history-cms/functions.php

Custom code is:

```
function railHistoryCMS_checkPageValidity($request, $gallery_page, $page) {
// CUSTOM STUFF
return checkPageValidity($request, $gallery_page, $page);
}
global $_zp_page_check;
$_zp_page_check = 'railHistoryCMS_checkPageValidity'; // opt-in, standard behavior
```

Calls to `checkPageValidity` are never executed, with `echo "X"` outputting nothing, and modifying the generic `checkPageValidity` in the same way also shows nothing.

Any other places I should start digging around?
Administrator
Administrator
acrylian   2018-12-27, 10:44
#2
Take a look at the Zenpage theme's `functions.php`.

As you did you define a function or (static method since you use a class already which is preferred to function name prefixing) to hook into.

Then add this calling your function or (static) method:
`if (!OFFSET_PATH) {
$_zp_page_check = 'my_checkPageValidity';
}`
also to your theme's `functions.php` so it is only covered on .
You don't need to set `$_zp_page_check` to global as it is already especially outside of functions/methods.

I am not sure what pages those are listsed in your function and how you use pagination. What is `lineguide.php` for a page for example? Static custom pages generally "don't know" pagination.


  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.