Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (7 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

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

    r5910 r6287  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory;
     3
    34use WP_User;
    45
     
    5455
    5556            $reviews = $wpdb->get_results( $wpdb->prepare(
    56             "SELECT
     57                "SELECT
    5758                    ID, post_content, post_title, post_author, post_modified,
    5859                    r.rating as post_rating
    59             FROM ratings r
    60                 LEFT JOIN wporg_419_posts p ON r.post_id = p.ID
    61             WHERE r.object_type = 'plugin' AND r.object_slug = %s AND p.post_status = 'publish'
    62             ORDER BY r.review_id DESC
    63             LIMIT %d", $plugin_slug, $number ) );
     60                FROM ratings r
     61                    LEFT JOIN wporg_419_posts p ON r.post_id = p.ID
     62                WHERE r.object_type = 'plugin' AND r.object_slug = %s AND p.post_status = 'publish'
     63                ORDER BY r.review_id DESC
     64                LIMIT %d",
     65                $plugin_slug,
     66                $number
     67            ) );
    6468
    6569            wp_cache_set( "{$plugin_slug}_last{$number}", $reviews, 'plugin-reviews', HOUR_IN_SECONDS );
     
    241245
    242246        if ( false === ( $support_reps = wp_cache_get( $plugin_slug, 'plugin-support-reps' ) ) ) {
    243             $post = Plugin_Directory::get_plugin_post( $plugin_slug );
     247            $post         = Plugin_Directory::get_plugin_post( $plugin_slug );
    244248            $support_reps = wp_get_object_terms( $post->ID, 'plugin_support_reps', array( 'fields' => 'names' ) );
    245249
     
    341345        if ( $subscribe ) {
    342346            $users[] = $user->ID;
    343             $users = array_unique( $users );
     347            $users   = array_unique( $users );
    344348        } else {
    345349            if ( false !== ( $pos = array_search( $user->ID, $users, true ) ) ) {
     
    423427        }
    424428
    425         $users_favorites = get_user_meta( $user->ID, 'plugin_favorites', true ) ?: array();
    426 
     429        $users_favorites   = get_user_meta( $user->ID, 'plugin_favorites', true ) ?: array();
    427430        $already_favorited = in_array( $post->post_name, $users_favorites, true );
    428431
     
    447450     *
    448451     * @param string $plugin_slug       The plugin to retrieve subscribers for.
    449      * @param bool   $include_committers Whether to include Plugin Committers in the list. Default false. 
     452     * @param bool   $include_committers Whether to include Plugin Committers in the list. Default false.
    450453     * @return array Array of \WP_User's who are subscribed.
    451454     */
     
    468471
    469472        // Plugin Committers are always subscrived to plugin commits.
    470         $committers  = self::get_plugin_committers( $plugin_slug );
     473        $committers = self::get_plugin_committers( $plugin_slug );
    471474        foreach ( $committers as $committer ) {
    472475            if ( $committer && $user = get_user_by( 'login', $committer ) ) {
Note: See TracChangeset for help on using the changeset viewer.