Code Duplication    Length = 18-18 lines in 2 locations

includes/CMB2_Base.php 1 location

@@ 126-143 (lines=18) @@
123
	 * @since  2.2.2
124
	 * @return string  Page object type name.
125
	 */
126
	public function current_object_type() {
127
		global $pagenow;
128
		$type = 'post';
129
130
		if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
131
			$type = 'user';
132
		}
133
134
		if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
135
			$type = 'comment';
136
		}
137
138
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
139
			$type = 'term';
140
		}
141
142
		return $type;
143
	}
144
145
	/**
146
	 * Set object property.

includes/CMB2.php 1 location

@@ 891-908 (lines=18) @@
888
	 * @since  2.2.2
889
	 * @return string  Page object type name.
890
	 */
891
	public function current_object_type() {
892
		global $pagenow;
893
		$type = 'post';
894
895
		if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
896
			$type = 'user';
897
		}
898
899
		if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
900
			$type = 'comment';
901
		}
902
903
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
904
			$type = 'term';
905
		}
906
907
		return $type;
908
	}
909
910
	/**
911
	 * Set metabox property.