Making WordPress.org


Ignore:
Timestamp:
06/11/2016 10:07:10 PM (10 years ago)
Author:
obenland
Message:

Plugin Directory: Let plugin authors select categories on upload.

Also refactors create_plugin_post() to me more of a direct wrapper of
wp_insert_post(). Front-end needs styles.

See #1573.

File:
1 edited

Legend:

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

    r3331 r3335  
    2929                add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
    3030                add_action( 'save_post_plugin', array( $this, 'save_plugin_post' ) );
    31                 add_filter( 'tax_input_pre', array( $this, 'filter_tax_input' ) );
    3231
    3332                add_action( 'load-edit.php', array( $this, 'bulk_reject_plugins' ) );
     
    469468                        update_post_meta( $post_id, 'tested', wp_slash( wp_unslash( $_POST['tested_with'] ) ) );
    470469                }
    471         }
    472 
    473         /**
    474          * Filters the value of tax_inputs before saving.
    475          *
    476          * @param array $tax_input Array of taxonomies with selected terms.
    477          * @return array
    478          */
    479         public function filter_tax_input( $tax_input ) {
    480 
    481                 // Limit the amount of assignable categories to 3.
    482                 if ( isset( $tax_input['plugin_category'] ) ) {
    483                         $tax_input['plugin_category'] = array_slice( array_filter( $tax_input['plugin_category'] ), 0, 3 );
    484                 }
    485 
    486                 return $tax_input;
    487470        }
    488471
Note: See TracChangeset for help on using the changeset viewer.