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