Code Duplication    Length = 18-18 lines in 2 locations

includes/CMB2_Base.php 1 location

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

includes/CMB2.php 1 location

@@ 859-876 (lines=18) @@
856
	 * @since  2.2.2
857
	 * @return string  Page object type name.
858
	 */
859
	public function current_object_type() {
860
		global $pagenow;
861
		$type = 'post';
862
863
		if ( in_array( $pagenow, array( 'user-edit.php', 'profile.php', 'user-new.php' ), true ) ) {
864
			$type = 'user';
865
		}
866
867
		if ( in_array( $pagenow, array( 'edit-comments.php', 'comment.php' ), true ) ) {
868
			$type = 'comment';
869
		}
870
871
		if ( in_array( $pagenow, array( 'edit-tags.php', 'term.php' ), true ) ) {
872
			$type = 'term';
873
		}
874
875
		return $type;
876
	}
877
878
	/**
879
	 * Set metabox property.