@@ 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; |
@@ 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. |