Manaus Posted October 25, 2013 Share Posted October 25, 2013 Hello, I need to delete children and subchildren of a page, this is the code I'm using: $ch = $tobedeleted->children(); foreach ($ch as $c) { echo $c->title; // works if ($c->id) $c->delete(); } Still I get an alert telling that the page cannot deleted because it has children. Thanks for any suggestion. Link to comment Share on other sites More sharing options...
Soma Posted October 25, 2013 Share Posted October 25, 2013 Delete them with $pages->delete($c, true) Look on cheat sheet... 3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now