$prepared_post->post_title = $settings['name'];
$prepared_post->post_name = sanitize_title( $settings['slug'] );
// Remove duplicate information from settings.
unset( $settings['name'] );
unset( $settings['slug'] );
$prepared_post->post_content = wp_json_encode( $settings );
return $prepared_post;
}
/**
* Gets the font family's settings from the post.
*
* @since 6.5.0
*
* @param WP_Post $post Font family post object.
* @return array Font family settings array.
*/
protected function get_settings_from_post( $post ) {
$settings_json = json_decode( $post->post_content, true );
// Default to empty strings if the settings are missing.
return array(
'name' => isset( $post->post_title ) && $post->post_title ? $post->post_title : '',
'slug' => isset( $post->post_name ) && $post->post_name ? $post->post_name : '',
'fontFamily' => isset( $settings_json['fontFamily'] ) && $settings_json['fontFamily'] ? $settings_json['fontFamily'] : '',
'preview' => isset( $settings_json['preview'] ) && $settings_json['preview'] ? $settings_json['preview'] : '',
);
}
}
Fatal error: require_once(): Failed opening required '/var/www/html/helitower.com.br/web/wp-includes/blocks/query.php' (include_path='.:/usr/share/pear') in /var/www/html/helitower.com.br/web/wp-includes/blocks/require-dynamic-blocks.php on line 50
Fatal error: Uncaught Error: Call to a member function set() on null in /var/www/html/helitower.com.br/web/wp-includes/l10n.php:854
Stack trace:
#0 /var/www/html/helitower.com.br/web/wp-includes/l10n.php(957): load_textdomain('default', '/var/www/html/h...', 'pt_BR')
#1 /var/www/html/helitower.com.br/web/wp-includes/class-wp-fatal-error-handler.php(49): load_default_textdomain()
#2 [internal function]: WP_Fatal_Error_Handler->handle()
#3 {main}
thrown in /var/www/html/helitower.com.br/web/wp-includes/l10n.php on line 854