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/Post_Meta_Container.php 1 location

@@ 52-58 (lines=7) @@
49
	 * @param string $title title of the container
50
	 * @param string $type Type of the container
51
	 **/
52
	public function __construct( $unique_id, $title, $type ) {
53
		parent::__construct( $unique_id, $title, $type );
54
55
		if ( ! $this->get_datastore() ) {
56
			$this->set_datastore( Datastore::make( 'post_meta' ), $this->has_default_datastore() );
57
		}
58
	}
59
60
	/**
61
	 * Create DataStore instance, set post ID to operate with (if such exists).

core/Container/Term_Meta_Container.php 1 location

@@ 26-32 (lines=7) @@
23
	 * @param string $title title of the container
24
	 * @param string $type Type of the container
25
	 **/
26
	public function __construct( $unique_id, $title, $type ) {
27
		parent::__construct( $unique_id, $title, $type );
28
29
		if ( ! $this->get_datastore() ) {
30
			$this->set_datastore( Datastore::make( 'term_meta' ), $this->has_default_datastore() );
31
		}
32
	}
33
34
	/**
35
	 * Bind attach() and save() to the appropriate WordPress actions.

core/Container/User_Meta_Container.php 1 location

@@ 28-34 (lines=7) @@
25
	 * @param string $title title of the container
26
	 * @param string $type Type of the container
27
	 **/
28
	public function __construct( $unique_id, $title, $type ) {
29
		parent::__construct( $unique_id, $title, $type );
30
31
		if ( ! $this->get_datastore() ) {
32
			$this->set_datastore( Datastore::make( 'user_meta' ), $this->has_default_datastore() );
33
		}
34
	}
35
36
	/**
37
	 * Bind attach() and save() to the appropriate WordPress actions.

core/Container/Theme_Options_Container.php 1 location

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