Code Duplication    Length = 7-7 lines in 5 locations

core/Container/Comment_Meta_Container.php 1 location

@@ 22-28 (lines=7) @@
19
	 * @param string $title title of the container
20
	 * @param string $type Type of the container
21
	 **/
22
	public function __construct( $unique_id, $title, $type ) {
23
		parent::__construct( $unique_id, $title, $type );
24
25
		if ( ! $this->get_datastore() ) {
26
			$this->set_datastore( Datastore::make( 'comment_meta' ), $this->has_default_datastore() );
27
		}
28
	}
29
30
	/**
31
	 * Perform instance initialization

core/Container/Theme_Options_Container.php 1 location

@@ 29-35 (lines=7) @@
26
	 * @param string $title title of the container
27
	 * @param string $type Type of the container
28
	 **/
29
	public function __construct( $unique_id, $title, $type ) {
30
		parent::__construct( $unique_id, $title, $type );
31
32
		if ( ! $this->get_datastore() ) {
33
			$this->set_datastore( Datastore::make( 'theme_options' ), $this->has_default_datastore() );
34
		}
35
	}
36
37
	/**
38
	 * Attach container as a theme options page/subpage.

core/Container/Post_Meta_Container.php 1 location

@@ 68-74 (lines=7) @@
65
	 * @param string $title title of the container
66
	 * @param string $type Type of the container
67
	 **/
68
	public function __construct( $unique_id, $title, $type ) {
69
		parent::__construct( $unique_id, $title, $type );
70
71
		if ( ! $this->get_datastore() ) {
72
			$this->set_datastore( Datastore::make( 'post_meta' ), $this->has_default_datastore() );
73
		}
74
	}
75
76
	/**
77
	 * Create DataStore instance, set post ID to operate with (if such exists).

core/Container/Term_Meta_Container.php 1 location

@@ 40-46 (lines=7) @@
37
	 * @param string $title title of the container
38
	 * @param string $type Type of the container
39
	 **/
40
	public function __construct( $unique_id, $title, $type ) {
41
		parent::__construct( $unique_id, $title, $type );
42
43
		if ( ! $this->get_datastore() ) {
44
			$this->set_datastore( Datastore::make( 'term_meta' ), $this->has_default_datastore() );
45
		}
46
	}
47
48
	/**
49
	 * Bind attach() and save() to the appropriate WordPress actions.

core/Container/User_Meta_Container.php 1 location

@@ 40-46 (lines=7) @@
37
	 * @param string $title title of the container
38
	 * @param string $type Type of the container
39
	 **/
40
	public function __construct( $unique_id, $title, $type ) {
41
		parent::__construct( $unique_id, $title, $type );
42
43
		if ( ! $this->get_datastore() ) {
44
			$this->set_datastore( Datastore::make( 'user_meta' ), $this->has_default_datastore() );
45
		}
46
	}
47
48
	/**
49
	 * Bind attach() and save() to the appropriate WordPress actions.