Exemplo n.º 1
0
<?php

$result = '';
if ($_POST) {
    if (isset($_POST['button-id']) && isset($_POST['bulk-action-select'])) {
        if ($_POST['bulk-action-select'] == 'trash') {
            $count = 0;
            foreach ($_POST['button-id'] as $id) {
                mbpro_button_move_to_trash($id);
                $count++;
            }
            if ($count == 1) {
                $result = __('Moved 1 button to the trash.', 'maxbuttons-pro');
            }
            if ($count > 1) {
                $result = sprintf(__('Moved %s buttons to the trash.', 'maxbuttons-pro'), $count);
            }
        }
    }
}
if (isset($_GET['message']) && $_GET['message'] == '1') {
    $result = __('Moved 1 button to the trash.', 'maxbuttons-pro');
}
$published_buttons = mbpro_get_published_buttons();
$published_buttons_count = mbpro_get_published_buttons_count();
$trashed_buttons_count = mbpro_get_trashed_buttons_count();
?>


<script type="text/javascript">
	jQuery(document).ready(function() {
Exemplo n.º 2
0
<?php

if (isset($_GET['id']) && $_GET['id'] != '') {
    mbpro_button_move_to_trash($_GET['id']);
}
?>

<script type="text/javascript">
	window.location = "<?php 
admin_url();
?>
admin.php?page=maxbuttons-controller&action=list&message=1";
</script>