Articles of deleted

how to use hook deleted_user into custom function to delete user from custom table

I have a second user table in my WordPress database for a separate application that I am integrating. I need to be able to delete a user from this second table when the user is deleted in the WordPress admin. I understand that the the add_action hook I need to use is deleted_user, but what […]

Prevent attachment from being deleted

In WordPress admin media library page (upload.php) I’d like to do some checking on delete_attachment action. I want my custom function to fire before attachment’s being deleted. In this function I want to check for it’s relations with another objects in database. And delete it only if there are no relations at all. I use […]

Delete data from custom table in wordpress

i am trying to delete record from my custom table global $wpdb; $retrieve_data = $wpdb->get_results( “SELECT * FROM wp_paypal” ); echo ‘<table border=1 class=”table table-striped”> <tr><th>Id</th><th>Name</th><th>Email</th><th>Product</th><th>Amount</th> <th>Payment</th><th>Player id</th><th>Date and Time</th><th>Action</th></tr>’; foreach ($retrieve_data as $retrieved_data){ echo ‘<tr><td>’. $retrieved_data->id.'</td>’; echo ‘<td>’.$retrieved_data->name.'</td>’; echo ‘<td>’.$retrieved_data->email.'</td>’; echo ‘<td>’. $retrieved_data->item_name.'</td>’; echo ‘<td>’. $retrieved_data->amount.'</td>’; echo ‘<td>’. $retrieved_data->amount.'</td>’; echo ‘<td>’. $retrieved_data->player_id.'</td>’; echo ‘<td>’. […]

l accidentally permanently deleted a Draft. There's any way I can recover it?

I recently started a blog and I was about to finish my second Post. I was cleaning up some stuff and decided to empty my Trash. I wasn’t paying much attention to it because I wasn’t expecting my Draft to be there. I accidentally deleted it. There’s any way I can at least visualize it […]

get_delete_post_link( $post->ID ) is blank when logged in as “subscriber”

Trying to create a delete link on frontend, but when logged in as a subscriber the get_delete_post_link( $post->ID ) variable is blank. Link is fine when logged in as administrator. Am I missing something?

Run a function when post is deleted?

Is it possible to run a function every time a post is deleted. The function has to be run when the post is deleted from the admin or by the wp_delete_post() function.

How do I reset my footer.php to its original state? (theme: Origami)

I accidentally deleted some codes from my footer.php trying to get rid of the ‘Theme By Origami’ footer, and now the footer is all messed up. How do i reset it to its original state? I feel so stupid, I should have backed up the text before deleting it, Im so careless.. My website: http://www.agnesphotoandfilm.co.uk/ […]

How to recover permanently deleted blog posts?

I accidentally deleted about 20 blog posts and they were in my trash folder for over a month and now have permanently deleted. I was wondering if there’s a way to recover these? For example I have seen mention of MySql database and phpMyAdmin, and was wondering if these would be applicable in my case […]

How do I reclaim either deleted pages or their permalinks?

A client deleted the the main administrator account. All the site’s core pages linked to the account, so they disappeared as well. The last known backup was in February, so can’t roll the database back to the backup without loosing new users and posts. The client has started rebuilding the core pages by copying and […]

Remove the deleted user comment

Problem I have a user based site, so when user deletes his profile somehow his/her comments stay visible. There is no name and blank avatar with the comment. Is there any way to delete the comments of a user if the user deletes his/her profile and how? Is there a function of somehow? This really […]