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

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