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/admin/class-customizations.php

    r2982 r2994  
    3131
    3232        add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
    33         add_action( 'save_post_plugin', array( $this, 'save_plugin_post' ), 10, 2 );
     33        add_action( 'save_post_plugin', array( $this, 'save_plugin_post' ) );
    3434
    3535        add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
     
    158158    /**
    159159     * Filter the query in wp-admin to list only plugins relevant to the current user.
     160     *
     161     * @param \WP_Query $query
    160162     */
    161163    public function pre_get_posts( $query ) {
    162         global $wpdb;
    163164        if ( ! $query->is_main_query() ) {
    164165            return;
     
    186187     *
    187188     * @ignore
     189     *
     190     * @param string $where WHERE clause.
     191     * @return string
    188192     */
    189193    public function pre_get_posts_sql_name_or_user( $where ) {
     
    224228     * @param array    $post_states An array of post display states.
    225229     * @param \WP_Post $post        The current post object.
     230     * @return array
    226231     */
    227232    public function post_states( $post_states, $post ) {
     
    310315     *
    311316     * @param int      $post_id The post_id being updated.
    312      * @param \WP_Post $post    The WP_Post object being updated.
    313      */
    314     public function save_plugin_post( $post_id, $post ) {
     317     */
     318    public function save_plugin_post( $post_id ) {
    315319        // Save meta information
    316320        if ( isset( $_POST['tested_with'] ) && isset( $_POST['hidden_tested_with'] ) && $_POST['tested_with'] != $_POST['hidden_tested_with'] ) {
     
    471475        );
    472476
    473         if ( $comment_auto_approved ) {
     477        if ( $comment_auto_approved && isset( $parent ) ) {
    474478            $response['supplemental']['parent_approved'] = $parent->comment_ID;
    475479            $response['supplemental']['parent_post_id']  = $parent->comment_post_ID;
Note: See TracChangeset for help on using the changeset viewer.