Make WordPress Core

Ticket #31206: 31206.diff

File 31206.diff, 4.0 KB (added by morganestes, 9 years ago)

Initial patch with additional missing doc blocks.

  • src/wp-admin/includes/ajax-actions.php

    diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
    index 23cb62f..b191e10 100644
    function wp_ajax_delete_meta() { 
    597597 *
    598598 * @since 3.1.0
    599599 *
    600  * @param string $action Action to perform.
     600 * @param string $action Optional. Action to perform; expects 'delete-post'.
    601601 */
    602 function wp_ajax_delete_post( $action ) {
    603         if ( empty( $action ) )
    604                 $action = 'delete-post';
     602function wp_ajax_delete_post( $action = 'delete-post' ) {
    605603        $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    606604
    607605        check_ajax_referer( "{$action}_$id" );
    function wp_ajax_delete_post( $action ) { 
    622620 *
    623621 * @since 3.1.0
    624622 *
    625  * @param string $action Action to perform.
     623 * @param string $action Optional. Action to perform; expects 'trash-post'.
    626624 */
    627 function wp_ajax_trash_post( $action ) {
    628         if ( empty( $action ) )
    629                 $action = 'trash-post';
     625function wp_ajax_trash_post( $action = 'trash-post' ) {
    630626        $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    631627
    632628        check_ajax_referer( "{$action}_$id" );
    function wp_ajax_trash_post( $action ) { 
    652648 *
    653649 * @since 3.1.0
    654650 *
    655  * @param string $action Action to perform.
     651 * @param string $action Optional. Action to perform; expects 'untrash-post'.
    656652 */
    657 function wp_ajax_untrash_post( $action ) {
    658         if ( empty( $action ) )
    659                 $action = 'untrash-post';
     653function wp_ajax_untrash_post( $action = 'untrash-post' ) {
    660654        wp_ajax_trash_post( $action );
    661655}
    662656
    663 function wp_ajax_delete_page( $action ) {
    664         if ( empty( $action ) )
    665                 $action = 'delete-page';
     657/**
     658 * Ajax handler to delete a page.
     659 *
     660 * @param string $action Optional. Action to perform; expects 'delete-page'.
     661 */
     662function wp_ajax_delete_page( $action = 'delete-page' ) {
    666663        $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
    667664
    668665        check_ajax_referer( "{$action}_$id" );
    function wp_ajax_dim_comment() { 
    725722 *
    726723 * @since 3.1.0
    727724 *
    728  * @param string $action Action to perform.
     725 * @param string $action Optional. Action to perform; expects 'add-link-category'.
    729726 */
    730 function wp_ajax_add_link_category( $action ) {
    731         if ( empty( $action ) )
    732                 $action = 'add-link-category';
     727function wp_ajax_add_link_category( $action = 'add-link-category' ) {
    733728        check_ajax_referer( $action );
    734729        if ( !current_user_can( 'manage_categories' ) )
    735730                wp_die( -1 );
    function wp_ajax_get_tagcloud() { 
    864859 *
    865860 * @since 3.1.0
    866861 *
    867  * @param string $action Action to perform.
     862 * @param string $action Optional. Action to perform; expects 'get-comments'.
    868863 */
    869 function wp_ajax_get_comments( $action ) {
     864function wp_ajax_get_comments( $action = 'get-comments' ) {
    870865        global $wp_list_table, $post_id;
    871         if ( empty( $action ) )
    872                 $action = 'get-comments';
    873866
    874867        check_ajax_referer( $action );
    875868
    function wp_ajax_get_comments( $action ) { 
    915908 *
    916909 * @since 3.1.0
    917910 *
    918  * @param string $action Action to perform.
     911 * @param string $action Optional. Action to perform; expects 'replyto-comment'.
    919912 */
    920 function wp_ajax_replyto_comment( $action ) {
     913function wp_ajax_replyto_comment( $action = 'replyto-comment') {
    921914        global $wp_list_table;
    922         if ( empty( $action ) )
    923                 $action = 'replyto-comment';
    924915
    925916        check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
    926917
    function wp_ajax_add_meta() { 
    12291220 *
    12301221 * @since 3.1.0
    12311222 *
    1232  * @param string $action Action to perform.
     1223 * @param string $action Optional. Action to perform; expects 'add-user'.
    12331224 */
    1234 function wp_ajax_add_user( $action ) {
     1225function wp_ajax_add_user( $action = 'add-user' ) {
    12351226        global $wp_list_table;
    1236         if ( empty( $action ) )
    1237                 $action = 'add-user';
    1238 
     1227       
    12391228        check_ajax_referer( $action );
    12401229        if ( ! current_user_can('create_users') )
    12411230                wp_die( -1 );
    function wp_ajax_parse_embed() { 
    27332722        ) );
    27342723}
    27352724
     2725/**
     2726 * Enables sandboxed previewing of media shortcodes in the visual editor.
     2727 *
     2728 * @since 4.0.0
     2729 */
    27362730function wp_ajax_parse_media_shortcode() {
    27372731        global $post, $wp_scripts;
    27382732