Jump to content
bernhard

Auto-publish all pages having template "foo"

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

Share this post


Link to post
Share on other sites

Hi @bernhard,

thats a nice and short one!ย ๐Ÿ‘

  • Like 1

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

ร—
ร—
  • Create New...