Skip to content
Closed
Changes from 1 commit
Commits
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
format php
  • Loading branch information
matiasbenedetto committed Nov 16, 2023
commit 30168a6356235e6451ce950947d36221c2450e74
13 changes: 6 additions & 7 deletions lib/experimental/fonts/font-library/font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ function wp_register_font_collection( $config ) {

/*
* Sanitize font family content
*
*
* @param array $data An array of slashed, sanitized, and processed post data.
* @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data.
*
*
* @return array The post data that will be inserted in the database.
*/
function sanitize_font_family_content( $data, $postarr ) {
// Check if the post type is 'wp_font_family'
if ( isset( $postarr['post_type'] ) && $postarr['post_type'] === 'wp_font_family' ) {
if ( isset( $postarr['post_type'] ) && $postarr['post_type'] === 'wp_font_family' ) {
$result = WP_Font_Family_Utils::sanitize( $data['post_content'] );
}
// Return the (possibly modified) data
return $data;
}
// Return the (possibly modified) data
return $data;
}

add_filter( 'wp_insert_post_data', 'sanitize_font_family_content', 10, 2 );
Expand All @@ -85,4 +85,3 @@ function sanitize_font_family_content( $data, $postarr ) {
);

wp_register_font_collection( $default_font_collection );