Make WordPress Core


Ignore:
Timestamp:
11/19/2015 04:24:35 PM (10 years ago)
Author:
johnbillion
Message:

Move the show_ui logic into the get_edit_post_link() and get_edit_term_link() functions to facilitate post types and terms which specify show_ui as false but provide a custom editing UI via the get_edit_post_link and get_edit_term_link filters.

Fixes #33763
Fixes #33938

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-functions.php

    r35623 r35704  
    10131013    $args = apply_filters( 'register_post_type_args', $args, $post_type );
    10141014
     1015    $has_edit_link = ! empty( $args['_edit_link'] );
     1016
    10151017    // Args prefixed with an underscore are reserved for internal use.
    10161018    $defaults = array(
     
    10821084    if ( null === $args->map_meta_cap )
    10831085        $args->map_meta_cap = false;
     1086
     1087    // If there's no specified edit link and no UI, remove the edit link.
     1088    if ( ! $args->show_ui && ! $has_edit_link ) {
     1089        $args->_edit_link = '';
     1090    }
    10841091
    10851092    $args->cap = get_post_type_capabilities( $args );
Note: See TracChangeset for help on using the changeset viewer.