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() { |
| 597 | 597 | * |
| 598 | 598 | * @since 3.1.0 |
| 599 | 599 | * |
| 600 | | * @param string $action Action to perform. |
| | 600 | * @param string $action Optional. Action to perform; expects 'delete-post'. |
| 601 | 601 | */ |
| 602 | | function wp_ajax_delete_post( $action ) { |
| 603 | | if ( empty( $action ) ) |
| 604 | | $action = 'delete-post'; |
| | 602 | function wp_ajax_delete_post( $action = 'delete-post' ) { |
| 605 | 603 | $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0; |
| 606 | 604 | |
| 607 | 605 | check_ajax_referer( "{$action}_$id" ); |
| … |
… |
function wp_ajax_delete_post( $action ) { |
| 622 | 620 | * |
| 623 | 621 | * @since 3.1.0 |
| 624 | 622 | * |
| 625 | | * @param string $action Action to perform. |
| | 623 | * @param string $action Optional. Action to perform; expects 'trash-post'. |
| 626 | 624 | */ |
| 627 | | function wp_ajax_trash_post( $action ) { |
| 628 | | if ( empty( $action ) ) |
| 629 | | $action = 'trash-post'; |
| | 625 | function wp_ajax_trash_post( $action = 'trash-post' ) { |
| 630 | 626 | $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0; |
| 631 | 627 | |
| 632 | 628 | check_ajax_referer( "{$action}_$id" ); |
| … |
… |
function wp_ajax_trash_post( $action ) { |
| 652 | 648 | * |
| 653 | 649 | * @since 3.1.0 |
| 654 | 650 | * |
| 655 | | * @param string $action Action to perform. |
| | 651 | * @param string $action Optional. Action to perform; expects 'untrash-post'. |
| 656 | 652 | */ |
| 657 | | function wp_ajax_untrash_post( $action ) { |
| 658 | | if ( empty( $action ) ) |
| 659 | | $action = 'untrash-post'; |
| | 653 | function wp_ajax_untrash_post( $action = 'untrash-post' ) { |
| 660 | 654 | wp_ajax_trash_post( $action ); |
| 661 | 655 | } |
| 662 | 656 | |
| 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 | */ |
| | 662 | function wp_ajax_delete_page( $action = 'delete-page' ) { |
| 666 | 663 | $id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0; |
| 667 | 664 | |
| 668 | 665 | check_ajax_referer( "{$action}_$id" ); |
| … |
… |
function wp_ajax_dim_comment() { |
| 725 | 722 | * |
| 726 | 723 | * @since 3.1.0 |
| 727 | 724 | * |
| 728 | | * @param string $action Action to perform. |
| | 725 | * @param string $action Optional. Action to perform; expects 'add-link-category'. |
| 729 | 726 | */ |
| 730 | | function wp_ajax_add_link_category( $action ) { |
| 731 | | if ( empty( $action ) ) |
| 732 | | $action = 'add-link-category'; |
| | 727 | function wp_ajax_add_link_category( $action = 'add-link-category' ) { |
| 733 | 728 | check_ajax_referer( $action ); |
| 734 | 729 | if ( !current_user_can( 'manage_categories' ) ) |
| 735 | 730 | wp_die( -1 ); |
| … |
… |
function wp_ajax_get_tagcloud() { |
| 864 | 859 | * |
| 865 | 860 | * @since 3.1.0 |
| 866 | 861 | * |
| 867 | | * @param string $action Action to perform. |
| | 862 | * @param string $action Optional. Action to perform; expects 'get-comments'. |
| 868 | 863 | */ |
| 869 | | function wp_ajax_get_comments( $action ) { |
| | 864 | function wp_ajax_get_comments( $action = 'get-comments' ) { |
| 870 | 865 | global $wp_list_table, $post_id; |
| 871 | | if ( empty( $action ) ) |
| 872 | | $action = 'get-comments'; |
| 873 | 866 | |
| 874 | 867 | check_ajax_referer( $action ); |
| 875 | 868 | |
| … |
… |
function wp_ajax_get_comments( $action ) { |
| 915 | 908 | * |
| 916 | 909 | * @since 3.1.0 |
| 917 | 910 | * |
| 918 | | * @param string $action Action to perform. |
| | 911 | * @param string $action Optional. Action to perform; expects 'replyto-comment'. |
| 919 | 912 | */ |
| 920 | | function wp_ajax_replyto_comment( $action ) { |
| | 913 | function wp_ajax_replyto_comment( $action = 'replyto-comment') { |
| 921 | 914 | global $wp_list_table; |
| 922 | | if ( empty( $action ) ) |
| 923 | | $action = 'replyto-comment'; |
| 924 | 915 | |
| 925 | 916 | check_ajax_referer( $action, '_ajax_nonce-replyto-comment' ); |
| 926 | 917 | |
| … |
… |
function wp_ajax_add_meta() { |
| 1229 | 1220 | * |
| 1230 | 1221 | * @since 3.1.0 |
| 1231 | 1222 | * |
| 1232 | | * @param string $action Action to perform. |
| | 1223 | * @param string $action Optional. Action to perform; expects 'add-user'. |
| 1233 | 1224 | */ |
| 1234 | | function wp_ajax_add_user( $action ) { |
| | 1225 | function wp_ajax_add_user( $action = 'add-user' ) { |
| 1235 | 1226 | global $wp_list_table; |
| 1236 | | if ( empty( $action ) ) |
| 1237 | | $action = 'add-user'; |
| 1238 | | |
| | 1227 | |
| 1239 | 1228 | check_ajax_referer( $action ); |
| 1240 | 1229 | if ( ! current_user_can('create_users') ) |
| 1241 | 1230 | wp_die( -1 ); |
| … |
… |
function wp_ajax_parse_embed() { |
| 2733 | 2722 | ) ); |
| 2734 | 2723 | } |
| 2735 | 2724 | |
| | 2725 | /** |
| | 2726 | * Enables sandboxed previewing of media shortcodes in the visual editor. |
| | 2727 | * |
| | 2728 | * @since 4.0.0 |
| | 2729 | */ |
| 2736 | 2730 | function wp_ajax_parse_media_shortcode() { |
| 2737 | 2731 | global $post, $wp_scripts; |
| 2738 | 2732 | |