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

@@ 902-919 (lines=18) @@
899
	 * @since  2.2.2
900
	 * @return string  Page object type name.
901
	 */
902
	public function current_object_type() {
903
		global $pagenow;
904
		$type = 'post';
905
906
		if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
907
			$type = 'user';
908
		}
909
910
		if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
911
			$type = 'comment';
912
		}
913
914
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
915
			$type = 'term';
916
		}
917
918
		return $type;
919
	}
920
921
	/**
922
	 * Set metabox property.