Code Duplication    Length = 13-15 lines in 2 locations

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

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

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

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