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

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