Make WordPress Core


Ignore:
Timestamp:
02/06/2024 08:40:38 AM (17 months ago)
Author:
youknowriad
Message:

Editor: Introduce the Font Library post types and low level APIs.

This is the first step towards adding the font library to WordPress.
This commit includes the font library and font face CPTs.
It also adds the necessary APIs and classes to register and manipulate font collections.

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

Props youknowriad, get_dave, grantmkin, swissspidy, hellofromtonya, mukesh27, mcsf.
See #59166.

File:
1 edited

Legend:

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

    r57524 r57539  
    562562                'revisions',
    563563            ),
     564        )
     565    );
     566
     567    register_post_type(
     568        'wp_font_family',
     569        array(
     570            'labels'                         => array(
     571                'name'          => __( 'Font Families' ),
     572                'singular_name' => __( 'Font Family' ),
     573            ),
     574            'public'                         => false,
     575            '_builtin'                       => true, /* internal use only. don't use this when registering your own post type. */
     576            'hierarchical'                   => false,
     577            'capabilities'                   => array(
     578                'read'                   => 'edit_theme_options',
     579                'read_private_posts'     => 'edit_theme_options',
     580                'create_posts'           => 'edit_theme_options',
     581                'publish_posts'          => 'edit_theme_options',
     582                'edit_posts'             => 'edit_theme_options',
     583                'edit_others_posts'      => 'edit_theme_options',
     584                'edit_published_posts'   => 'edit_theme_options',
     585                'delete_posts'           => 'edit_theme_options',
     586                'delete_others_posts'    => 'edit_theme_options',
     587                'delete_published_posts' => 'edit_theme_options',
     588            ),
     589            'map_meta_cap'                   => true,
     590            'query_var'                      => false,
     591            'show_in_rest'                   => false,
     592            'rewrite'                        => false,
     593        )
     594    );
     595
     596    register_post_type(
     597        'wp_font_face',
     598        array(
     599            'labels'                         => array(
     600                'name'          => __( 'Font Faces' ),
     601                'singular_name' => __( 'Font Face' ),
     602            ),
     603            'public'                         => false,
     604            '_builtin'                       => true, /* internal use only. don't use this when registering your own post type. */
     605            'hierarchical'                   => false,
     606            'capabilities'                   => array(
     607                'read'                   => 'edit_theme_options',
     608                'read_private_posts'     => 'edit_theme_options',
     609                'create_posts'           => 'edit_theme_options',
     610                'publish_posts'          => 'edit_theme_options',
     611                'edit_posts'             => 'edit_theme_options',
     612                'edit_others_posts'      => 'edit_theme_options',
     613                'edit_published_posts'   => 'edit_theme_options',
     614                'delete_posts'           => 'edit_theme_options',
     615                'delete_others_posts'    => 'edit_theme_options',
     616                'delete_published_posts' => 'edit_theme_options',
     617            ),
     618            'map_meta_cap'                   => true,
     619            'query_var'                      => false,
     620            'show_in_rest'                   => false,
     621            'rewrite'                        => false,
    564622        )
    565623    );
Note: See TracChangeset for help on using the changeset viewer.