Making WordPress.org

Changeset 814


Ignore:
Timestamp:
08/26/2014 08:09:07 AM (10 years ago)
Author:
coffee2code
Message:

Code Reference: add resource page for dashicons

props ryelle
fixes #252

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
4 added
2 edited

Legend:

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

    r813 r814  
    5555    add_action( 'template_redirect', __NAMESPACE__ . '\\redirect_single_search_match' );
    5656    add_action( 'template_redirect', __NAMESPACE__ . '\\redirect_handbook' );
     57    add_action( 'template_redirect', __NAMESPACE__ . '\\redirect_resources' );
    5758    add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\theme_scripts_styles' );
    5859    add_filter( 'post_type_link', __NAMESPACE__ . '\\method_permalink', 10, 2 );
     
    402403
    403404/**
     405 * Redirects a naked /resources/ request to dashicons page.
     406 *
     407 * Temporary until a resource page other than dashicons is created.
     408 */
     409function redirect_resources() {
     410    if ( is_page( 'resources' ) ) {
     411        wp_redirect( get_permalink( get_page_by_title( 'dashicons' ) ) );
     412        exit();
     413    }
     414}
     415
     416/**
    404417 * Makes phpDoc @link references clickable.
    405418 *
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r813 r814  
    355355        $parts = explode( '/', $_SERVER['REQUEST_URI'] );
    356356        switch ( $parts[1] ) {
     357            case 'resources':
     358                return sprintf( __( 'Developer Resources: %s', 'wporg' ), get_the_title() );
    357359            case 'reference':
    358360                return __( 'Code Reference', 'wporg' );
Note: See TracChangeset for help on using the changeset viewer.