Completed
Push — development ( 987e6d...b78414 )
by
unknown
04:31
created

Nav_Menu_Datastore::load_values()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Carbon_Fields\Datastore;
4
5
use Carbon_Fields\Field\Field;
6
7
class Nav_Menu_Datastore extends Post_Meta_Datastore {
8
	/**
9
	 * Delete the field value(s) from the database.
10
	 *
11
	 * @param Field $field The field to delete.
12
	 */
13
	public function delete( Field $field ) {
14
		// Not needed, the deletion is handled on delete_post automatically
15
	}
16
17
	/**
18
	 * Delete complex field value(s) from the database.
19
	 *
20
	 * @param mixed $field The field to delete values for.
21
	 */
22
	public function delete_values( $field ) {
23
		// Not needed, the deletion is handled on delete_post automatically
24
	}
25
26
	/**
27
	 * Retrieve the initial field name
28
	 */
29
	public function get_field_name( $field ) {
30
		if ( !empty( $field->nav_menu_datastore_field_name ) ) {
0 ignored issues
show
introduced by
Expected 1 space after "!"; 0 found
Loading history...
31
			$field_name = $field->nav_menu_datastore_field_name;
32
		} else {
33
			$field_name = $field->get_name();
34
		}
35
36
		return $field_name;
37
	}
38
}
39