Code Duplication    Length = 18-18 lines in 2 locations

includes/CMB2.php 1 location

@@ 853-870 (lines=18) @@
850
	 * @since  2.2.2
851
	 * @return string  Page object type name.
852
	 */
853
	public function current_object_type() {
854
		global $pagenow;
855
		$type = 'post';
856
857
		if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
858
			$type = 'user';
859
		}
860
861
		if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
862
			$type = 'comment';
863
		}
864
865
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
866
			$type = 'term';
867
		}
868
869
		return $type;
870
	}
871
872
	/**
873
	 * Set metabox property.

includes/CMB2_Base.php 1 location

@@ 109-126 (lines=18) @@
106
	 * @since  2.2.2
107
	 * @return string  Page object type name.
108
	 */
109
	public function current_object_type() {
110
		global $pagenow;
111
		$type = 'post';
112
113
		if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
114
			$type = 'user';
115
		}
116
117
		if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
118
			$type = 'comment';
119
		}
120
121
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
122
			$type = 'term';
123
		}
124
125
		return $type;
126
	}
127
128
	/**
129
	 * Set object property.