Inventory_Presser_Customize_Admin_Dashboard::delete_all_post_attachments()


Source

File: includes/class-customize-admin-dashboard.php

		$post_id = isset( $_POST['post_ID'] ) ? $_POST['post_ID'] : 0;

		if( ! isset( $post_id ) )
		{
			return; // Will die in case you run a function like this: delete_post_media($post_id); if you will remove this line - ALL ATTACHMENTS WHO HAS A PARENT WILL BE DELETED PERMANENTLY!
		}
		elseif ( 0 == $post_id )
		{
			return; // Will die in case you have 0 set. there's no page id called 0 :)
		}
		elseif( is_array( $post_id ) )
		{
			return; // Will die in case you place there an array of pages.
		}
		else
		{
			INVP::delete_attachments( $post_id );
		}
	}

	/**
	 * enable_order_by_attachment_count
	 * 
	 * Handle the ORDER BY on the vehicle list (edit.php) when sorting by photo 
	 * count.
	 *
	 * @param  array $pieces
	 * @param  WP_Query $query
	 * @return array
	 */
	function enable_order_by_attachment_count( $pieces, $query )
	{
		if( ! is_admin() ) { return $pieces; }