Code Duplication    Length = 13-15 lines in 2 locations

projects/packages/identity-crisis/src/class-identity-crisis.php 1 location

@@ 165-179 (lines=15) @@
162
	 *
163
	 * @return null
164
	 */
165
	public function non_admins_current_screen_check( $current_screen ) {
166
		self::$current_screen = $current_screen;
167
		if ( isset( $current_screen->id ) && 'toplevel_page_jetpack' === $current_screen->id ) {
168
			return null;
169
		}
170
171
		// If the user has dismissed the notice, and we're not currently on a Jetpack page,
172
		// then do not show the non-admin notice.
173
		if ( isset( $_COOKIE, $_COOKIE['jetpack_idc_dismiss_notice'] ) ) {
174
			remove_action( 'admin_notices', array( $this, 'display_non_admin_idc_notice' ) );
175
			remove_action( 'admin_enqueue_scripts', array( $this, 'enqueue_idc_notice_files' ) );
176
		}
177
178
		return null;
179
	}
180
181
	/**
182
	 * Renders the admin bar button.

projects/plugins/jetpack/class.jetpack-idc.php 1 location

@@ 125-137 (lines=13) @@
122
		}
123
	}
124
125
	function non_admins_current_screen_check( $current_screen ) {
126
		self::$current_screen = $current_screen;
127
		if ( isset( $current_screen->id ) && 'toplevel_page_jetpack' == $current_screen->id ) {
128
			return null;
129
		}
130
131
		// If the user has dismissed the notice, and we're not currently on a Jetpack page,
132
		// then do not show the non-admin notice.
133
		if ( isset( $_COOKIE, $_COOKIE['jetpack_idc_dismiss_notice'] ) ) {
134
			remove_action( 'admin_notices', array( $this, 'display_non_admin_idc_notice' ) );
135
			remove_action( 'admin_enqueue_scripts', array( $this, 'enqueue_idc_notice_files' ) );
136
		}
137
	}
138
139
	function display_admin_bar_button() {
140
		global $wp_admin_bar;