Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding fonts library backend * load font library * Format php. * Update comment. * Fix array key merge. * Format php. * linting: lint and add comments where needed * linting: add comments on rest fonts library file * lint: fix filedocs * lint: fix lib loader errors * Misc updates to comments for consistency * Update controller name in load.php * Add an install method to the font family class to simplify the code * Renaming the Fonts Library class to Fonts Library Family to emphasize the class produces Font Family Objects * Renaming WP_Fonts_Library_Family to WP_Font_Family * lint: make sure coding standards test passes * Replace include for admin.php with file.php * Fix linter errors * adding 1 php test * fix test * Move a few methods from Font Family class to Fonts Library * move more methods to Fonts Library class * Breaking the classes in to smaller ones and adding tests * add tests font Font Family class * Create fonts dir at init of wordpress * Testing and refactoring WP_Font_Family class * PHP formatting * fix syntax * move comment * update wording Co-authored-by: Jeff Ong <[email protected]> * update comment Co-authored-by: Jeff Ong <[email protected]> * update comment * update comment * update comment * call to sanitize before creating the post * fix return of method * Addding a failing test for local fonts upload * micro-optimization Co-authored-by: Tonya Mork <[email protected]> * interting the order of static and access control keywords in method definition * To avoid fatal error when the class is introduced into Core, add a guard to the opening of the file. This guard will not be merged into Core, but rather will stay in Gutenberg. Co-authored-by: [email protected] * updating comments * adding missing access keywords for methods * WP_Theme_JSON_Gutenberg instead of WP_Theme_JSON * Moving init calls to a new file. * adding comment to file * format PHP * update comment Co-authored-by: Colin Stewart <[email protected]> * syntax change Co-authored-by: Colin Stewart <[email protected]> * syntax change Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Anton Vlasenko <[email protected]> * add missing 'new' while returning a WP_Error Co-authored-by: Anton Vlasenko <[email protected]> * fix return comment Co-authored-by: Anton Vlasenko <[email protected]> * renaming variable Co-authored-by: Anton Vlasenko <[email protected]> * stylistic change to early return * shortening the syntax and variable renaming * Stylistic change: switching the order of parameters of assertEquals call * simplify delete_asset method code * refactor uninstall endpoint response * fixing return type comment * fixing return type and refactor to early return * check is post_id is an error Co-authored-by: Colin Stewart <[email protected]> * using assertStringEndsWith assertion * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * replace assertEquals by assertSame * assertSame and assertCount * assertFileExists * assertFileDoesNotExist * simplify has_font_faces_method * return early if there are no fonts to be installed * fix assertWPError calls * adding public keyword to test cases * improving the suffix and sanitiztion for get_filename_from_font_face method * simplify uninstall method * updating comments * adding covers in php tests * require font slug in the get_filename_from_font_face method * improve get_datamethod test * add fixture for WP_Font_Family_Test * deleting unused data * renaminng test case * fixing WP_Font_Family_Utils_Test tests * format php * adding dataProviders in WP_Font_Family_Utils_Test * adding params comments in test cases * adding messages on tests with multiple assertions * test refactor * refactor test * php format * add comments to data_provider * change test case name * raname custom post type * add missing parameter in docbloc * adding comment * adding full stops at the end of param comments * change test assert type Co-authored-by: Colin Stewart <[email protected]> * change test assert type Co-authored-by: Colin Stewart <[email protected]> * change test assert type Co-authored-by: Colin Stewart <[email protected]> * use wp_handle_upload to write thee files and use wp-content/uploads/fonts as folder instead of wp-content/fonts * strict suffix check Co-authored-by: Anton Vlasenko <[email protected]> * update comment Co-authored-by: Anton Vlasenko <[email protected]> * update comment Co-authored-by: Anton Vlasenko <[email protected]> * moving fonts library loading before checking if its available * Fixes local font upload tests * allowing the installation of fonts with remote urls that won't be donwloaded * delete google fonts data and endpoint * PHP code formatting * lint * php lint * moving post_type registration to the WP_Fonts_Library class * change endpoint url * adding test file for WP_REST_Fonts_Library_Controller class * adding tests for innstall endpoint * add test for font family constructor failure * Font Family constructo raise an exception if the slug was not provided * add tests for uninstall endpoint * format php * add validation for install endpoint * fix comment Co-authored-by: Colin Stewart <[email protected]> * improve comment text Co-authored-by: Colin Stewart <[email protected]> * fix comment Co-authored-by: Colin Stewart <[email protected]> * fix comment Co-authored-by: Colin Stewart <[email protected]> * code format fix Co-authored-by: Colin Stewart <[email protected]> * fix test assertion and comment Co-authored-by: Colin Stewart <[email protected]> * fix comment Co-authored-by: Colin Stewart <[email protected]> * fix comment Co-authored-by: Colin Stewart <[email protected]> * fix comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * code formatting Co-authored-by: Colin Stewart <[email protected]> * fix comment Co-authored-by: Colin Stewart <[email protected]> * update test name Co-authored-by: Colin Stewart <[email protected]> * update assertion type Co-authored-by: Colin Stewart <[email protected]> * Improves test descripcion Co-authored-by: Colin Stewart <[email protected]> * code formatting Co-authored-by: Colin Stewart <[email protected]> * update test assertion type Co-authored-by: Colin Stewart <[email protected]> * comment update Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * code and comments style Co-authored-by: Colin Stewart <[email protected]> * comment style Co-authored-by: Colin Stewart <[email protected]> * comment update Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update comment Co-authored-by: Colin Stewart <[email protected]> * update assertion type Co-authored-by: Colin Stewart <[email protected]> * fix get_validation_error function * improving comment * improve comment * adding test method description * code format * lint fixes * fix test * removing unwated parameter comment * format * lint * Exclude fontsapi tests. Modifies the phpunit.xml file to exclude running the Fonts API tests. These tests will be removed once the Fonts Library is merged. * Exclude Fonts API in multisite tests * Core parity: since, formatting, package. To prepare the code for Core, this commit does the following: * Adds `@since` to each class, method, property. * Sets the since to 6.4.0, as this is targeted for release in WP 6.4.0. * Removes empty lines between @param and @return. * Adds empty line before each `return`. * Reduces long lines for readability. * Makes the `@package` WordPress. * Rewords comments to remove "we" words. * Adds empty line between code groups for readability. * init global function: renames & adds Core merge notes. The function is for the plugin only and will not be merged into Core. However, the code within the function will go into Core, albeit in different Core functions. `@core-merge` annotation is added with Core merge notes to help whomever creates the Core PR. * Moves post_type registration to init function. WP Core registers all post types in `create_initial_post_types()`. The code for registering will be placed within that global function. This commit removes the WP_Fonts_Library static method and moves the code into the gutenberg_init_fonts_library() function. This is done to prepare the Fonts Library for and ease work in merging into Core. * Remove function_exist wrap from Gutenberg init function. This function will only exists in Gutenberg, thus it does not the guard to protect it from the same function in Core (that is once the Fonts Library is merged into Core). * adding constant check to load Fonts Library files * Add constant to turn on Fonts Library in tests. * Add constant to turn on Fonts Library in mu tests. --------- Co-authored-by: Jeff Ong <[email protected]> Co-authored-by: Vicente Canales <[email protected]> Co-authored-by: Sarah Norris <[email protected]> Co-authored-by: Tonya Mork <[email protected]> Co-authored-by: Colin Stewart <[email protected]> Co-authored-by: Anton Vlasenko <[email protected]>
- Loading branch information