*/ public function get_required_assets(): array { return array( \Postlinkly\Admin\Assets\AssetRegistrar::HANDLE_DASHBOARD_CSS ); } /** * @since 1.1.0 */ public function render(): void { if ( ! current_user_can( $this->get_capability() ) ) { wp_die( esc_html__( 'You do not have permission to view this page.', 'postlinkly' ) ); } $template = $this->template_path( 'dashboard.php' ); if ( is_readable( $template ) ) { include $template; } } /** * Returns the absolute path to a template file. * * @since 1.1.0 * * @param string $file Template filename. * * @return string */ private function template_path( string $file ): string { $base = defined( 'POSTLINKLY_PLUGIN_DIR' ) ? (string) POSTLINKLY_PLUGIN_DIR : ''; return $base . 'templates/admin/' . $file; } }