Making WordPress.org


Ignore:
Timestamp:
04/21/2016 07:41:53 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Housekeeping.

  • Updates and corrects doc blocks.
  • Simplifies overqualified class references.
  • Corrects function args and return types.
  • Adds missing labels to input elements.
  • Makes sure variables are set before using them.

See #1584.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r2991 r2994  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory;
     3use WordPressdotorg\Plugin_Directory\Admin\Customizations;
    34
    45/**
     
    2627        add_filter( 'the_content', array( $this, 'filter_post_content_to_correct_page' ), 1 );
    2728        add_filter( 'rest_api_allowed_post_types', array( $this, 'filter_allowed_post_types' ) );
    28         add_filter( 'pre_update_option_jetpack_options', array( $this, 'filter_jetpack_options' ), 10, 2 );
     29        add_filter( 'pre_update_option_jetpack_options', array( $this, 'filter_jetpack_options' ) );
    2930
    3031        add_filter( 'map_meta_cap', array( __NAMESPACE__ . '\Capabilities', 'map_meta_cap' ), 10, 4 );
     
    3940        // Cannot be included on `admin_init` to allow access to menu hooks
    4041        if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) {
    41             Admin\Customizations::instance();
     42            Customizations::instance();
    4243
    4344            add_action( 'transition_post_status', array( __NAMESPACE__ . '\Admin\Status_Transitions', 'instance' ) );
     
    200201     * Setting up the site requires setting up the theme and proper
    201202     * rewrite permastructs.
    202      *
    203      * @global \WP_Rewrite $wp_rewrite WordPress rewrite component.
    204203     */
    205204    public function activate() {
     205
     206        /**
     207         * @var \WP_Rewrite $wp_rewrite WordPress rewrite component.
     208         */
    206209        global $wp_rewrite;
    207210
     
    220223        }
    221224
    222         // Enable the WordPress.org Plugin Repo Theme.
     225        /**
     226         * Enable the WordPress.org Plugin Repo Theme.
     227         *
     228         * @var \WP_Theme $theme
     229         */
    223230        foreach ( wp_get_themes() as $theme ) {
    224231            if ( $theme->get( 'Name' ) === 'WordPress.org Plugins' ) {
     
    398405     *
    399406     * @param mixed $new_value
    400      * @param mixed $old_value
    401407     * @return mixed
    402408     */
    403     public function filter_jetpack_options( $new_value, $old_value ) {
    404         if ( is_array($new_value) && array_key_exists( 'public', $new_value ) )
     409    public function filter_jetpack_options( $new_value ) {
     410        if ( is_array( $new_value ) && array_key_exists( 'public', $new_value ) )
    405411            $new_value['public'] = 1;
    406412
Note: See TracChangeset for help on using the changeset viewer.