Changeset 57686 for trunk/src/wp-includes/fonts/class-wp-font-library.php
- Timestamp:
- 02/21/2024 07:24:14 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/fonts/class-wp-font-library.php
r57548 r57686 38 38 * @since 6.5.0 39 39 * 40 * @param string $slug Font collection slug. 41 * @param array $data_or_file Font collection data array or a path/URL to a JSON file 42 * containing the font collection. 43 * See {@see wp_register_font_collection()} for the supported fields. 40 * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, 41 * and underscores. See sanitize_title(). 42 * @param array $args Font collection data. See wp_register_font_collection() for information on accepted arguments. 44 43 * @return WP_Font_Collection|WP_Error A font collection if it was registered successfully, 45 44 * or WP_Error object on failure. 46 45 */ 47 public function register_font_collection( $slug, $data_or_file) {48 $new_collection = new WP_Font_Collection( $slug, $ data_or_file);46 public function register_font_collection( string $slug, array $args ) { 47 $new_collection = new WP_Font_Collection( $slug, $args ); 49 48 50 49 if ( $this->is_collection_registered( $new_collection->slug ) ) { … … 73 72 * @return bool True if the font collection was unregistered successfully and false otherwise. 74 73 */ 75 public function unregister_font_collection( $slug ) {74 public function unregister_font_collection( string $slug ) { 76 75 if ( ! $this->is_collection_registered( $slug ) ) { 77 76 _doing_it_wrong( … … 95 94 * @return bool True if the font collection is registered and false otherwise. 96 95 */ 97 private function is_collection_registered( $slug ) {96 private function is_collection_registered( string $slug ) { 98 97 return array_key_exists( $slug, $this->collections ); 99 98 } … … 118 117 * @return WP_Font_Collection|null Font collection object, or null if the font collection doesn't exist. 119 118 */ 120 public function get_font_collection( $slug ) {119 public function get_font_collection( string $slug ) { 121 120 if ( $this->is_collection_registered( $slug ) ) { 122 121 return $this->collections[ $slug ];
Note: See TracChangeset
for help on using the changeset viewer.