Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tareq1988/WP-User-Frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq1988 committed Mar 4, 2012
2 parents 85b0bcc + a338c4b commit a860a6d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion wpuf-edit-post.php
Expand Up @@ -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 ); ?>

Expand All @@ -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
}

Expand Down
15 changes: 11 additions & 4 deletions wpuf-functions.php
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 a860a6d

Please sign in to comment.