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

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