Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5dbb7fc
Font Library: add wp_font_face post type and scaffold font face REST …
creativecoder Jan 9, 2024
e89854a
Font Library: create font faces through the REST API (#57702)
creativecoder Jan 11, 2024
998f084
Refactor Font Family Controller (#57785)
creativecoder Jan 12, 2024
90b5717
Font Family and Font Face REST API endpoints: better data handling an…
creativecoder Jan 15, 2024
efffcc8
Font Families REST API endpoint: ensure unique font family slugs (#57…
creativecoder Jan 16, 2024
c263a04
Font Library: delete child font faces and font assets when deleting p…
creativecoder Jan 16, 2024
e8ca12c
Font Library: refactor client side install functions to work with rev…
jffng Jan 17, 2024
13b5640
Cleanup/font library view error handling (#57926)
pbking Jan 17, 2024
3e37968
Font Faces endpoint: prevent creating font faces with duplicate setti…
creativecoder Jan 17, 2024
d1f8dcf
Font Library: Update uninstall/delete on client side (#57932)
mikachan Jan 18, 2024
3e5e987
Update packages/edit-site/src/components/global-styles/font-library-m…
mikachan Jan 18, 2024
dd885b5
Font Library: address JS feedback in #57688 (#57961)
mikachan Jan 18, 2024
2ed7a3b
Font Library REST API endpoints: address initial feedback from featur…
creativecoder Jan 19, 2024
c0e9949
Font Library: font collection refactor to use the new schema (#57884)
matiasbenedetto Jan 19, 2024
51345f0
Fix font asset download when font faces are installed (#58021)
creativecoder Jan 19, 2024
d45d540
Font Families and Faces: disable autosaves using empty class (#58018)
creativecoder Jan 19, 2024
1320d20
Adds migration for legacy font family content (#58032)
creativecoder Jan 22, 2024
4dce262
Font Library: Fix font collection filtering (#58091)
matiasbenedetto Jan 23, 2024
3da3f45
Merge branch 'trunk' into try/font-library-refactor
mikachan Jan 23, 2024
2743793
Fix load.php
mikachan Jan 23, 2024
b98c028
Font Library: fix to activate and display the right activation state …
matiasbenedetto Jan 23, 2024
921ec13
Fix font face files not being deleted with family (#58128)
creativecoder Jan 23, 2024
14b9e53
Font Library Preview: fix quoting of fontFamily property (#58127)
creativecoder Jan 23, 2024
f460811
Fix Font Library Tests_Font_Library_Hooks test missed in #58128
creativecoder Jan 23, 2024
51e4bed
Font library: Fix React key prop warnings (#57939)
mikachan Jan 23, 2024
23ce4e9
removing repeated comment
matiasbenedetto Jan 23, 2024
eb30f83
Update default Google fonts collection URL
mikachan Jan 23, 2024
dde2059
Font Library: Prevent error when installing a system font twice (#58141)
creativecoder Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Font Families and Faces: disable autosaves using empty class (#58018)
  • Loading branch information
creativecoder committed Jan 22, 2024
commit d45d54005a1c4318b9a6684962233b952e311210

This file was deleted.

6 changes: 4 additions & 2 deletions lib/experimental/fonts/font-library/font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function gutenberg_init_font_library_routes() {
'show_in_rest' => true,
'rest_base' => 'font-families',
'rest_controller_class' => 'WP_REST_Font_Families_Controller',
'autosave_rest_controller_class' => 'WP_REST_Autosave_Fonts_Controller',
// Disable autosave endpoints for font families.
'autosave_rest_controller_class' => 'stdClass',
);
register_post_type( 'wp_font_family', $args );

Expand Down Expand Up @@ -83,7 +84,8 @@ function gutenberg_init_font_library_routes() {
'show_in_rest' => true,
'rest_base' => 'font-families/(?P<font_family_id>[\d]+)/font-faces',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seem incorrect.

'rest_controller_class' => 'WP_REST_Font_Faces_Controller',
'autosave_rest_controller_class' => 'WP_REST_Autosave_Fonts_Controller',
// Disable autosave endpoints for font faces.
'autosave_rest_controller_class' => 'stdClass',
)
);

Expand Down
1 change: 0 additions & 1 deletion lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ function gutenberg_is_experiment_enabled( $name ) {
require __DIR__ . '/experimental/fonts/font-library/class-wp-rest-font-families-controller.php';
require __DIR__ . '/experimental/fonts/font-library/class-wp-rest-font-faces-controller.php';
require __DIR__ . '/experimental/fonts/font-library/class-wp-rest-font-collections-controller.php';
require __DIR__ . '/experimental/fonts/font-library/class-wp-rest-autosave-fonts-controller.php';
require __DIR__ . '/experimental/fonts/font-library/font-library.php';
}

Expand Down
16 changes: 16 additions & 0 deletions phpunit/tests/fonts/font-library/wpRestFontFacesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ public function test_register_routes() {
);
}

public function test_font_faces_no_autosave_routes() {
// @core-merge: Enable this test.
$this->markTestSkipped( 'This test only works with WP 6.4 and above. Enable it once 6.5 is released.' );
$routes = rest_get_server()->get_routes();
$this->assertArrayNotHasKey(
'/wp/v2/font-families/(?P<font_family_id>[\d]+)/font-faces/(?P<id>[\d]+)/autosaves',
$routes,
'Font faces autosaves route exists.'
);
$this->assertArrayNotHasKey(
'/wp/v2/font-families/(?P<font_family_id>[\d]+)/font-faces/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)',
$routes,
'Font faces autosaves by id route exists.'
);
}

/**
* @covers WP_REST_Font_Faces_Controller::get_context_param
*/
Expand Down
16 changes: 16 additions & 0 deletions phpunit/tests/fonts/font-library/wpRestFontFamiliesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ public function test_register_routes() {
);
}

public function test_font_families_no_autosave_routes() {
// @core-merge: Enable this test.
$this->markTestSkipped( 'This test only works with WP 6.4 and above. Enable it once 6.5 is released.' );
$routes = rest_get_server()->get_routes();
$this->assertArrayNotHasKey(
'/wp/v2/font-families/(?P<id>[\d]+)/autosaves',
$routes,
'Font families autosaves route exists.'
);
$this->assertArrayNotHasKey(
'/wp/v2/font-families/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)',
$routes,
'Font families autosaves by id route exists.'
);
}

/**
* @covers WP_REST_Font_Families_Controller::get_context_param
*/
Expand Down