Code Duplication    Length = 18-18 lines in 2 locations

includes/CMB2_Base.php 1 location

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

includes/CMB2.php 1 location

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