Make WordPress Core


Ignore:
Timestamp:
04/25/2013 07:28:33 AM (11 years ago)
Author:
markjaquith
Message:

Screen option for Post Format UI.

props nacin. see #23930.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ajax-actions.php

    r24019 r24092  
    11361136}
    11371137
     1138function wp_ajax_show_post_format_ui() {
     1139    error_log( serialize( $_REQUEST ) );
     1140
     1141    if ( empty( $_POST['post_type'] ) )
     1142        wp_die( 0 );
     1143
     1144    check_ajax_referer( 'show-post-format-ui_' . $_POST['post_type'], 'nonce' );
     1145
     1146    if ( ! $post_type_object = get_post_type_object( $_POST['post_type'] ) )
     1147        wp_die( 0 );
     1148
     1149    if ( ! current_user_can( $post_type_object->cap->edit_posts ) )
     1150        wp_die( -1 );
     1151
     1152    update_user_option( get_current_user_id(), 'post_formats_' . $post_type_object->name, empty( $_POST['show'] ) ? 0 : 1 );
     1153
     1154    wp_die( 1 );
     1155}
     1156
    11381157function wp_ajax_hidden_columns() {
    11391158    check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
Note: See TracChangeset for help on using the changeset viewer.