<?php
require_once __DIR__ . '/admin.php';
wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
if ( ! current_user_can( 'manage_links' ) ) {
wp_link_manager_disabled_message();
}
if ( ! empty( $_POST['deletebookmarks'] ) ) {
$action = 'deletebookmarks';
}
if ( ! empty( $_POST['move'] ) ) {
$action = 'move';
}
if ( ! empty( $_POST['linkcheck'] ) ) {
$linkcheck = $_POST['linkcheck'];
}
$this_file = admin_url( 'link-manager.php' );
switch ( $action ) {
case 'deletebookmarks':
check_admin_referer( 'bulk-bookmarks' );
if ( count( $linkcheck ) === 0 ) {
wp_redirect( $this_file );
exit;
}
$deleted = 0;
foreach ( $linkcheck as $link_id ) {
$link_id = (int) $link_id;