Skip to content

Commit

Permalink
Merge pull request #1 from woodandgold/patch-1
Browse files Browse the repository at this point in the history
updated wpuf_edit_attachment()
  • Loading branch information
tareq1988 committed Mar 4, 2012
2 parents 7c362bf + 055a8a2 commit 151d2b5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions wpuf-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,19 @@ function wpuf_edit_attachment( $post_id ) {
if ( $attach ) {
$count = 1;
foreach ($attach as $a) {
$param = "?pid={$post_id}&attach_id={$a['id']}&action=del";
$text .= 'Attachment ' . $count . ': <a href="' . $a['url'] . '">' . $a['title'] . '</a>';
$text .= ' - <a href="' . wp_nonce_url( $param, 'wpuf_attach_del' ) . '" onclick="return confirm(\'Are you sure to delete this attachment?\');">Delete</a><br>';

echo 'Attachment ' . $count . ': <a href="' . $a['url'] . '">' . $a['title'] . '</a>';
echo "<form name=\"wpuf_edit_attachment\" id=\"wpuf_edit_attachment_{$post_id}\" action=\"\" method=\"POST\">";
echo "<input type=\"hidden\" name=\"attach_id\" value=\"{$a['id']}\" />";
echo "<input type=\"hidden\" name=\"action\" value=\"del\" />";
wp_nonce_field( 'wpuf_attach_del');
echo '<input class="wpuf_attachment_delete" type="submit" name="wpuf_attachment_delete" value="delete" onclick="return confirm(\'Are you sure to delete this attachment?\');">';
echo "</form>";
echo "<br>";
$count++;

}
echo $text;

}
}

Expand Down

0 comments on commit 151d2b5

Please sign in to comment.