[wp-hackers] Delete Row - Refreshes Page but not DB

Nikola Nikolov nikolov.tmw at gmail.com
Sun Oct 20 15:44:28 UTC 2013


Well the thing is that WordPress takes care of some extra stuff when an
attachment is deleted - usually if it's an image, WordPress will also
delete all of the sizes for that image, etc.

I'm looking into the core code for wp_delete_attachment and I can't seem to
find anything that would not let an attachment to be deleted, based on the
current user's role(it also doesn't make a lot of sense to have such a
restriction for a core method - usually restrictions occur before a core
method is ran - at the time of parsing a request for instance).

What is the failure alert that you're getting? Does wp_delete_attachment
just return false?


On Sun, Oct 20, 2013 at 2:26 PM, BenderisGreat <greglancaster71 at gmail.com>wrote:

> I enabled the error log, and I have a local error log as well.  No new
> errors
> are being generated.  Its weird for sure.  I am pretty sure this is because
> subscribers are not able to delete posts and I am using;
>
> $del_image = wp_delete_attachment( $file, true  );
>
> I think it would be smarter to convert that to an sql query (maybe
> wordpress
> wont catch it as a delete post function in sql?)
>
> What do you think?  No errors being generated other than a failure alert.
>
>
>
> --
> View this message in context:
> http://wordpress-hackers.1065353.n5.nabble.com/Delete-Row-Refreshes-Page-but-not-DB-tp42393p42580.html
> Sent from the Wordpress Hackers mailing list archive at Nabble.com.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list