WordPress.org

Making WordPress.org


Ignore:
Timestamp:
10/31/2017 06:00:54 PM (2 years ago)
Author:
obenland
Message:

Main: Introduce Downloads page template

Also includes a brand new download button widget.

See #2861.

File:
1 edited

Legend:

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

    r6057 r6063  
    1818 */
    1919function setup() {
    20 
    2120    // This theme uses wp_nav_menu() in one location.
    2221    register_nav_menus( array(
    2322        'rosetta_main' => esc_html__( 'Rosetta', 'wporg' ),
    2423    ) );
    25 
    2624}
    2725add_action( 'after_setup_theme', __NAMESPACE__ . '\setup' );
     26
     27/**
     28 * Registers theme-specific widgets.
     29 */
     30function widgets() {
     31    include_once get_stylesheet_directory() . '/widgets/class-wporg-widget-download.php';
     32
     33    register_widget( __NAMESPACE__ . '\WPORG_Widget_Download' );
     34    register_widget( 'WP_Widget_Links' );
     35
     36    add_filter( 'widget_links_args', function( $args ) {
     37        $args['categorize']      = 0;
     38        $args['category_before'] = '';
     39        $args['category_after']  = '';
     40        $args['title_li']        = __( 'Resources', 'wporg' );
     41
     42        return $args;
     43    } );
     44}
     45add_action( 'widgets_init', __NAMESPACE__ . '\widgets' );
Note: See TracChangeset for help on using the changeset viewer.