Permalink
Browse files

Merge branch 'master' of github.com:tareq1988/WP-User-Frontend

  • Loading branch information...
tareq1988 committed Mar 4, 2012
2 parents 85b0bcc + a338c4b commit a860a6d55988ba3e3ad0f8e343914963a1a11d85
Showing with 16 additions and 5 deletions.
  1. +5 −1 wpuf-edit-post.php
  2. +11 −4 wpuf-functions.php
View
@@ -152,7 +152,7 @@ function wpuf_edit_show_form( $post ) {
<?php } ?>
<?php wpuf_attachment_fields(); ?>
- <?php wpuf_edit_attachment( $post->ID ); ?>
+
<?php do_action( 'wpuf_add_post_form_tags', $post_type ); ?>
<?php wpuf_build_custom_field_form( 'bottom', true, $post->ID ); ?>
@@ -164,6 +164,10 @@ function wpuf_edit_show_form( $post ) {
</li>
</ul>
</form>
+ <div class="wpuf-edit-attachment">
+ <?php wpuf_edit_attachment( $post->ID ); ?>
+ </div>
+
<?php
}
View
@@ -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;
+
}
}

0 comments on commit a860a6d

Please sign in to comment.