'; $section_description .= esc_html__( 'Add your own JS code here to customize the appearance and layout of your site.', 'blogmagazine' ); $section_description .= '

'; $section_description .= '

' . esc_html__( 'When using a keyboard to navigate:', 'blogmagazine' ) . '

'; $section_description .= ''; if ( 'false' !== wp_get_current_user()->syntax_highlighting ) { $section_description .= '

'; $section_description .= sprintf( /* translators: 1: link to user profile, 2: additional link attributes, 3: accessibility text */ __( 'The edit field automatically highlights code syntax. You can disable this in your user profile%3$s to work in plain text mode.', 'blogmagazine' ), esc_url( get_edit_profile_url() ), 'class="external-link" target="_blank"', sprintf( ' %s', /* translators: accessibility text */ esc_html__( '(opens in a new tab)', 'blogmagazine' ) ) ); $section_description .= '

'; } $section_description .= '

'; $section_description .= ''; $section_description .= '

'; $wp_customize->add_section( 'additional_js_section', array( 'title' => esc_html__( 'Additional JS', 'blogmagazine' ), 'priority' => 20, 'panel' => 'site_code_editor', 'description_hidden' => true, 'description' => $section_description, ) ); $wp_customize->add_setting( 'custom_javascript_code', array( 'type' => 'option', 'sanitize_callback' => 'esc_js' ) ); $wp_customize->add_control( new WP_Customize_Code_Editor_Control( $wp_customize, 'custom_javascript_code', array( 'label' => esc_html__( 'Additional JS', 'blogmagazine' ), 'section' => 'additional_js_section', 'code_type' => 'javascript', 'input_attrs' => array( 'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4', ), ) ) );