Jump to content

Recommended Posts

Posted

Hello,

I have a feeling I'm missing an easy thing here (again...). If I trash a page from API with :

mypage->trash()

Is there a simple way to restore it if needed ? I can do it in back-end, but I'd like to do it through API with something like

mypage->restore()

 but this doesn't exit :( 

So if you can give me a little help on that, I'd appreciate. Thanks in advance !

Posted

As always in this community, a quick, straight to the point and perfect answer. Many thanks to you @kongondo

Sorry for missing it in the docs. I promise I searched for it but I was stuck in the $page part of the API and didn't see the restore()... My bad. Just to mention, I typed 'restore' in the search box (top left), but the API linked in your post above didn't appear in the results :( 

Anyway, the answer was quite simple (just as I thought, in the PW 'philosophy') and I'm happy with that. Thanks again !

Posted

No worries :).  Btw search tip: Use this one instead: E.g., searching for restore trash page or restore trash page api returns $pages->restore() as the second result :) and your question as the fifth :P

  • Like 3
Posted (edited)
1 hour ago, celfred said:

Sorry for missing it in the docs. I promise I searched for it

There's no reason to feel sorry, we're a helpful bunch here :)

On a sidenote: you can try the "PW custom Google search engine" I've configured some time ago: https://cse.google.com/cse/publicurl?cx=013706179141317928628:dendm4c3gpq

pw-cse.thumb.png.e876e2ca34dd5f7c981e1144fb1df3fc.png

I have used the title of this forum thread ("Restore trashed page from API") and the first result in this very thread here, and the second one is the API reference page for trash - at the bottom you'll see "related" API links, one of them being "restore". I have bookmarked this custom search so I can simply type "PW", hit enter, and search across a variety of PW-sites/resources.

edit: kongondo was faster :-)

Edited by dragan
kongondo basically posted the same... minutes before
  • Like 4
  • Thanks 1
Posted
1 hour ago, Juergen said:

Great! I didnt know that this exist :)

Yeah. I've had it in my signature for ages (so, you see, we are not so clever :P) . I can't remember who created this particular CSE though. I also have it bookmarked in my bookmarks bar for easy access.

 

  • Haha 1
Posted

Ah, sorry, didn't know that. I'm not using either one. I thought there was just one search and he missed that sentence.. thanks for clarifying.

Posted

Yeah, although I guess the main difference is that I have added other URLs to search too, like pw-recipes etc.

cse2.png.05d6f40dc7ae4ec284aa576659ce536e.png

  • 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...