Site logo

Archived topic

How to create an entirely new hook location?

4 replies · Started by Lewis on November 17, 2021

Viewing posts 1–5 of 5

So, I'm using the Simple Maintenance plugin by naa986. This plugin is awesomely lightweight, much like GP. However, I'd like to be able to use a Block Element in the Elements section, to build a sleeker maintenance page.

I have created my maintenance block element in the Elements section.

Element, (Block - Hook 503-redirect)

The plugin is loading a basic HTML template, via;

function load_sm_page() {
    header('HTTP/1.0 503 Service Unavailable');
    include_once("sm-template.php");      
    exit();
}

The sm-template.php file is currently loading a full. <html>...</html> page. I'm thinking I can hook in here by removing all the content here and simply add my hook element. I can't figure out how I add a hook location though. Is it possible to add a new hook location for GP to use? If so how would I go about it?

Thanks,

Also, on a side note, it would be awesome to be able to create elements, as shortcodes. That way I could have just used <?php do_shortcode(); ?>. Would it be possible to request this feature?

Thanks, David. Just what I was after. :)

You're welcome

This archived topic is closed to new replies.