Making WordPress.org


Ignore:
Timestamp:
09/23/2017 03:55:48 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Convert Ratings_Compat and Stickies_Compat constructor arguments to an array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-stickies-compat.php

    r5868 r5960  
    1313    var $term     = null;
    1414
    15     public function __construct( $compat, $slug, $taxonomy, $object, $term, $authors = array(), $contributors = array(), $support_reps = array() ) {
    16         if ( empty( $compat ) || empty( $slug ) || empty( $taxonomy ) || empty( $object ) || empty( $term ) ) {
     15    public function __construct( $args ) {
     16        $args = wp_parse_args( $args, array(
     17            'compat'       => '',
     18            'slug'         => '',
     19            'taxonomy'     => '',
     20            'object'       => '',
     21            'term'         => '',
     22            'authors'      => array(),
     23            'contributors' => array(),
     24            'support_reps' => array(),
     25        ) );
     26
     27        if ( ! $args['compat'] || ! $args['slug'] || ! $args['taxonomy'] || ! $args['object'] || ! $args['term'] ) {
    1728            return;
    1829        }
    1930
    20         $this->compat       = $compat;
    21         $this->slug         = $slug;
    22         $this->taxonomy     = $taxonomy;
    23         $this->object       = $object;
    24         $this->term         = $term;
    25         $this->authors      = $authors;
    26         $this->contributors = $contributors;
    27         $this->support_reps = $support_reps;
     31        $this->compat       = $args['compat'];
     32        $this->slug         = $args['slug'];
     33        $this->taxonomy     = $args['taxonomy'];
     34        $this->object       = $args['object'];
     35        $this->term         = $args['term'];
     36        $this->authors      = $args['authors'];
     37        $this->contributors = $args['contributors'];
     38        $this->support_reps = $args['support_reps'];
    2839
    2940        // Remove global stickies from sticky array.
Note: See TracChangeset for help on using the changeset viewer.