Making WordPress.org

Changeset 6069


Ignore:
Timestamp:
11/01/2017 10:04:29 PM (7 years ago)
Author:
iandunn
Message:

Gutenberg Tweaks: Organize Gutenberg tweaks into dedicated file.

I'll be adding several more in the next commit, so it'll be better to have a central place for them all.

Location:
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php

    r6056 r6069  
    277277    return $options;
    278278});
    279 
    280 /**
    281  * Limit which post types get a Gutenberg edit link.
    282  *
    283  * Many of WordCamp.org's CPTs make extensive use of meta boxes. Since these are not currently supported in the
    284  * Gutenberg editor, this limits the Gutenberg content editing links to posts and pages.
    285  *
    286  * TODO: revisit this when Gutenberg supports "advanced" meta boxes.
    287  */
    288 add_filter( 'gutenberg_can_edit_post_type', function( $bool, $post_type ) {
    289     $allowed_post_types = array(
    290         'post',
    291         'page',
    292     );
    293 
    294     if ( ! in_array( $post_type, $allowed_post_types, true ) ) {
    295         return false;
    296     }
    297 
    298     return $bool;
    299 }, 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.