Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Bulk publish entry drafts

Status Resolved
Add-on / Version Publisher Lite 1.5.1
Severity Trivial
EE Version 2.9

Brent C. Wilson

Aug 27, 2014

I’m setting up a client in ExpressionEngine. Their current CMS allows them to have “Draft” and “Published” states, much as Publisher Lite allows. However their current workflow is to publish ALL of their drafts at once with a single click, rather than on an entry-by-entry basis.

It doesn’t appear that Publisher Lite supports that functionality out of the box, and that’s fine. I wonder, though, if it is possible for me to write some custom code that would accomplish the same thing. In pseudo code it might look something like:

foreach ($entries as $entry_id) {
    ee()->publisher_lib->publishEntry($entry_id);
}

I would then make that action accessible via a magic “Publish All” button somewhere—perhaps in an Accessory.

Is that a practical possibility, given how Publisher Lite works?

#1

BoldMinded (Brian)

To answer this question yes, this should be possible in a separate extension, but I think the only way to really do this is to actually go through the ee()->api_channel_entries->update() method (I think thats the one). That will trigger the hooks and all the things necessary for 3rd party fieldtypes to update properly. You’d have to add ‘publisher_lang_id’ and ‘publisher_status’ to the $meta array in that method so it knows what to save it to.

#2

Brent C. Wilson

Ahh yes, that sounds easy enough. And it makes sense – Publisher is just inserting itself into the actions normally performed by that method, so it doesn’t really care whether the actions were triggered via the control panel or via a separate process like I’m proposing.

Thank you for the quick reply!

#3

BoldMinded (Brian)

If you finish an add-on like this let me know when its done and if you plan on releasing it publicly, either for free or for sale (I suggest for sale 😉

Login to reply