Making WordPress.org


Ignore:
Timestamp:
08/30/2021 10:45:11 PM (5 years ago)
Author:
coffee2code
Message:

Developer, Dashicons: Add anchor links next to each group name heading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/page-dashicons.php

    r11207 r11213  
    1010require_once __DIR__ . '/inc/dashicons.php';
    1111
    12 wp_enqueue_style(  'dashicons-page', get_template_directory_uri() . '/stylesheets/page-dashicons.css', array(), '20210826' );
    13 wp_enqueue_script( 'dashicons-page', get_template_directory_uri() . '/js/page-dashicons.js', array( 'jquery', 'wp-util' ), '20210826' );
     12wp_enqueue_style(  'dashicons-page', get_template_directory_uri() . '/stylesheets/page-dashicons.css', array(), '20210830' );
     13wp_enqueue_script( 'dashicons-page', get_template_directory_uri() . '/js/page-dashicons.js', array( 'jquery', 'wp-util' ), '20210830' );
    1414
    1515get_header(); ?>
     
    3737                <?php
    3838                foreach ( DevHub_Dashicons::get_dashicons() as $group => $group_info ) :
    39                     echo "<h4>{$group_info['label']}</h4>\n\n";
     39                    printf(
     40                        '<h4 id="%s">%s <a href="#%s" class="anchor"><span aria-hidden="true">#</span><span class="screen-reader-text">%s</span></a></h4>' . "\n\n",
     41                        esc_attr( 'icons-' . sanitize_title( $group ) ),
     42                        $group_info['label'],
     43                        esc_attr( 'icons-' . sanitize_title( $group ) ),
     44                        $group_info['label']
     45                    );
     46                   
    4047                    echo "<!-- {$group} -->\n";
    4148
Note: See TracChangeset for help on using the changeset viewer.