Jump to content

Auto-publish all pages having template "foo"


bernhard
 Share

Recommended Posts

I've done that too complicated too many times ? 

$wire->addHookAfter("Pages::saveReady('template=foo,id=0')", function($event) {
  $event->arguments(0)->status = 1;
});

Now create a new "foo" page and it will automatically be published (and also the "temp" status will be removed) ? I need that all the time for backend applications...

 

  • Like 6
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...