Completed
Push — 312-fix/delete-post-meta-modul... ( fbbe37...602413 )
by Sudar
14:44 queued 11:16
created

Bulk_Delete_Post_Meta::delete_post_meta()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
use BulkWP\BulkDelete\Core\Metas\Modules\DeletePostMetaModule;
4
5
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
6
7
/**
8
 * Utility class for deleting Post Meta.
9
 *
10
 * All the methods from this class has been migrated to `DeletePostMetaModule` class.
11
 * This class is still present for backward compatibility purpose, since some of the old add-ons still depend on this class.
12
 *
13
 * @since 5.4
14
 * @since 6.0.0 Deprecated.
15
 */
16
class Bulk_Delete_Post_Meta {
17
	/**
18
	 * Cron Hook.
19
	 *
20
	 * @since 5.4
21
	 */
22
	const CRON_HOOK = 'do-bulk-delete-post-meta';
23
24
	/**
25
	 * Delete Post Meta.
26
	 *
27
	 * @static
28
	 *
29
	 * @since  5.4
30
	 * @since  6.0.0 Deprecated.
31
	 *
32
	 * @param array $delete_options Options for deleting.
33
	 *
34
	 * @return int Number of posts that were deleted
35
	 */
36
	public static function delete_post_meta( $delete_options ) {
37
		$module = new DeletePostMetaModule();
38
39
		return $module->delete( $delete_options );
40
	}
41
}
42