context === null ) { $this->context = new AccessContext( $this->get_data() ); } return $this->context; } /** * Get the raw context data. * * @since 4.10.0 * * @return array */ protected function get_data(): array { return [ 'is_pro' => wp_mail_smtp()->is_pro(), // Mirrors the capability the Dashboard submenu is registered with, so a site // filtering it does not reach a page whose AJAX actions all reject it. 'can_manage' => current_user_can( wp_mail_smtp()->get_capability_manage_options() ), 'user_id' => get_current_user_id(), 'dismissals' => Helpers::get_user_meta_array( AccessContext::DISMISSED_META_KEY ), 'widget_settings' => Helpers::get_user_meta_array( AbstractWidget::SETTINGS_META_KEY ), ]; } }