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

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