Passed
Pull Request — dev/6.2.0 (#709)
by
unknown
137:18 queued 67:47
created

DeletePostsPage::get_bulkwp_menu_position()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 9
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
namespace BulkWP\BulkDelete\Core\Posts;
4
5
use BulkWP\BulkDelete\Core\Base\BaseDeletePage;
6
7
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
8
9
/**
10
 * Bulk Delete Posts Page.
11
 *
12
 * Shows the list of modules that allows you to delete posts.
13
 *
14
 * @since 6.0.0
15
 */
16
class DeletePostsPage extends BaseDeletePage {
17
	/**
18
	 * Initialize and setup variables.
19
	 */
20
	protected function initialize() {
21
		$this->page_slug = 'bulk-delete-posts';
22
		$this->item_type = 'posts';
23
24
		$this->label = array(
25
			'page_title' => __( 'Bulk Delete Posts', 'bulk-delete' ),
26
			'menu_title' => __( 'Bulk Delete Posts', 'bulk-delete' ),
27
		);
28
29
		$this->messages = array(
30
			'warning_message' => __( 'WARNING: Posts deleted once cannot be retrieved back. Use with caution.', 'bulk-delete' ),
31
		);
32
33
		$this->show_link_in_plugin_list = true;
34
	}
35
36
	public function register() {
37
		add_menu_page(
38
			__( 'Bulk WP', 'bulk-delete' ),
39
			__( 'Bulk WP', 'bulk-delete' ),
40
			$this->capability,
41
			$this->page_slug,
42
			array( $this, 'render_page' ),
43
			'dashicons-trash',
44
			$this->get_bulkwp_menu_position()
45
		);
46
47
		parent::register();
48
	}
49
50
	/**
51
	 * Add Help tabs.
52
	 *
53
	 * @param array $help_tabs Help tabs.
54
	 *
55
	 * @return array Modified list of tabs.
56
	 */
57
	protected function add_help_tab( $help_tabs ) {
58
		$overview_tab = array(
59
			'title'    => __( 'Overview', 'bulk-delete' ),
60
			'id'       => 'overview_tab',
61
			'content'  => '<p>' . __( 'This screen contains different modules that allows you to delete posts or schedule them for deletion.', 'bulk-delete' ) . '</p>',
62
			'callback' => false,
63
		);
64
65
		$help_tabs['overview_tab'] = $overview_tab;
66
67
		return $help_tabs;
68
	}
69
}
70