Make WordPress Core

Changeset 20157


Ignore:
Timestamp:
03/08/2012 01:12:06 PM (13 years ago)
Author:
westi
Message:

XMLRPC: Add some xmlrpc_call_success_* actions to some of the credit/edit/delete calls. Fixes #17109 props ericmann.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r20156 r20157  
    20372037        }
    20382038
    2039         return($cat_id);
     2039        do_action( 'xmlrpc_call_success_wp_newCategory', $cat_id, $args );
     2040
     2041        return $cat_id;
    20402042    }
    20412043
     
    20642066            return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) );
    20652067
    2066         return wp_delete_term( $category_id, 'category' );
     2068        $status = wp_delete_term( $category_id, 'category' );
     2069
     2070        if( true == $status )
     2071            do_action( 'xmlrpc_call_success_wp_deleteCategory', $category_id, $args );
     2072
     2073        return $status;
    20672074    }
    20682075
     
    22762283        do_action('xmlrpc_call', 'wp.deleteComment');
    22772284
    2278         return wp_delete_comment($comment_ID);
     2285        $status = wp_delete_comment( $comment_ID );
     2286
     2287        if( true == $status )
     2288            do_action( 'xmlrpc_call_success_wp_deleteComment', $comment_ID, $args );
     2289
     2290        return $status;
    22792291    }
    22802292
     
    23632375        if ( !$result )
    23642376            return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.'));
     2377
     2378        do_action( 'xmlrpc_call_success_wp_editComment', $comment_ID, $args );
    23652379
    23662380        return true;
     
    24472461        do_action('xmlrpc_call', 'wp.newComment');
    24482462
    2449         return wp_new_comment($comment);
     2463        $comment_ID = wp_new_comment( $comment );
     2464
     2465        do_action( 'xmlrpc_call_success_wp_newComment', $comment_ID, $args );
     2466
     2467        return $comment_ID;
    24502468    }
    24512469
     
    42154233        $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );
    42164234        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) );
     4235
     4236        do_action( 'xmlrpc_call_success_mw_newMediaObject', $id, $args );
    42174237
    42184238        return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ), 'upload' );
Note: See TracChangeset for help on using the changeset viewer.