Jump to content

Recommended Posts

Posted

Hi, I've managed to add a new button to the edit page but i'm finding it difficult to catch when it's been clicked. I've attached an image with the new publish later button with the name pdp_pub_later, but when I message() the action its always ProcessPageEdit – who would I find out that my new button has been clicked?

public function init() {
	$this->addHookAfter("ProcessPageEdit::execute", $this, 'publishLaterAndRedirect');
}

public function publishLaterAndRedirect(HookEvent $e){
	$page = $e->page;
	$action = $e->action;
	$this->message('action:' . $this->process);
}

Screenshot 2016-08-05 15.23.36.png

  • Like 1
Posted

Just use the same hook and test (if it's a post request and) if your button was clicked – it's name is present in the post data. If so execute something. If not go one without it.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...