' . esc_html__( 'The outline appears as soon as the post has headings.', '3task-toolbar-for-classic-editor' ) . '

'; } /** * Script and texts on the classic edit screen. * * @param string $hook_suffix Admin page. */ public static function enqueue( $hook_suffix ): void { if ( ! in_array( $hook_suffix, array( 'post.php', 'post-new.php' ), true ) || ! current_user_can( 'edit_posts' ) || ! self::classic_screen() ) { return; } wp_enqueue_style( 'threece-outline', THREECE_URL . 'assets/css/outline.css', array(), THREECE_VERSION ); wp_enqueue_script( 'threece-outline', THREECE_URL . 'assets/js/outline.js', array( 'jquery' ), THREECE_VERSION, true ); wp_add_inline_script( 'threece-outline', 'window.threeceOutlineTexts = ' . wp_json_encode( array( 'none' => __( 'The outline appears as soon as the post has headings.', '3task-toolbar-for-classic-editor' ), 'empty' => __( '(empty heading)', '3task-toolbar-for-classic-editor' ), 'checks' => __( 'Checks', '3task-toolbar-for-classic-editor' ), 'fine' => __( 'Nothing to point out.', '3task-toolbar-for-classic-editor' ), /* translators: 1: level of the heading, 2: level expected at most */ 'skippedLevel' => __( 'H%1$d follows a higher heading directly, H%2$d is missing in between.', '3task-toolbar-for-classic-editor' ), 'h1' => __( 'H1 in the text: the title of the post already is the H1. Use H2 here.', '3task-toolbar-for-classic-editor' ), 'imageAlt' => __( 'Image without alternative text. Describe what it shows, leave it empty only for pure decoration.', '3task-toolbar-for-classic-editor' ), 'emptyLink' => __( 'Link without text: screen readers only announce “link”.', '3task-toolbar-for-classic-editor' ), /* translators: %s: link text */ 'vagueLink' => __( 'Link text “%s” says nothing on its own. Name where the link leads.', '3task-toolbar-for-classic-editor' ), 'tableHeader' => __( 'Table without a header row. Mark the first row as header in the table properties.', '3task-toolbar-for-classic-editor' ), 'emptyHeading' => __( 'Empty heading.', '3task-toolbar-for-classic-editor' ), ) ) . ';', 'before' ); } /** * Whether the current edit screen uses the classic editor. * * @return bool */ private static function classic_screen() { $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null; return ! ( $screen && $screen->is_block_editor() ); } }