Making WordPress.org


Ignore:
Timestamp:
04/26/2016 07:33:28 AM (8 years ago)
Author:
dd32
Message:

Plugin Directory: Add a Review Widget to the theme, and all the other required things for Widgets.
This adds a namespace to the theme and begins to reduce the duplication of template functionality between wp-admin and the theme.

See #1584.
Fixes #1575.

File:
1 edited

Legend:

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

    r2499 r3009  
    11<?php
     2namespace WordPressdotorg\Plugin_Directory\Theme;
    23
    34/**
     
    1819    ) );
    1920
     21    register_sidebar( array(
     22        'name'          => 'Single Plugin View Sidebar',
     23        'id'            => 'single-plugin-sidebar',
     24        'before_widget' => '<div id="%1$s" class="widget %2$s">',
     25        'after_widget'  => '</div>',
     26    ) );
     27
    2028    // No need for canonical lookups
    21     //remove_action( 'template_redirect', 'redirect_canonical' );
    22     remove_action( 'template_redirect', 'wp_old_slug_redirect' );
     29    remove_action( 'template_redirect', __NAMESPACE__ . '\wp_old_slug_redirect' );
    2330}
    24 add_action( 'after_setup_theme', 'wporg_plugins_setup' );
     31add_action( 'after_setup_theme', __NAMESPACE__ . '\wporg_plugins_setup' );
    2532
    2633/**
     
    4552    add_filter( 'jetpack_implode_frontend_css', '__return_false' );
    4653}
    47 add_action( 'wp_enqueue_scripts', 'wporg_plugins_scripts' );
     54add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\wporg_plugins_scripts' );
    4855
    4956function wporg_plugins_body_class( $classes ) {
     
    5158    return $classes;
    5259}
    53 add_filter( 'body_class', 'wporg_plugins_body_class' );
     60add_filter( 'body_class', __NAMESPACE__ . '\wporg_plugins_body_class' );
Note: See TracChangeset for help on using the changeset viewer.