Skip to content

Commit

Permalink
Merge branch 'trunk' into add/data-source-snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
shekharnwagh authored Jan 23, 2025
2 parents 95d5861 + 63354fb commit da51b5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions inc/Formatting/FieldFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ final class FieldFormatter {
* @psalm-suppress UndefinedClass
*/
public static function format_currency( mixed $value, ?string $iso_4127_currency_code = null, ?string $locale = null ): string {
// The PHP 'intl' extension is not available in WordPress Playground.
if ( ! class_exists( 'NumberFormatter' ) || ! function_exists( 'numfmt_create' ) ) {
return strval( $value );
}

$format = numfmt_create( $locale ?? get_locale(), NumberFormatter::CURRENCY );
$currency_code = $iso_4127_currency_code ?? $format->getTextAttribute( NumberFormatter::CURRENCY_CODE );
return numfmt_format_currency( $format, (float) $value, $currency_code );
Expand Down
4 changes: 2 additions & 2 deletions remote-data-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author: WPVIP
* Author URI: https://wpvip.com
* Text Domain: remote-data-blocks
* Version: 0.7.1
* Version: 0.7.2
* Requires at least: 6.7
* Requires PHP: 8.1
*/
Expand All @@ -18,7 +18,7 @@

define( 'REMOTE_DATA_BLOCKS__PLUGIN_ROOT', __FILE__ );
define( 'REMOTE_DATA_BLOCKS__PLUGIN_DIRECTORY', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'REMOTE_DATA_BLOCKS__PLUGIN_VERSION', '0.7.1' );
define( 'REMOTE_DATA_BLOCKS__PLUGIN_VERSION', '0.7.2' );

define( 'REMOTE_DATA_BLOCKS__REST_NAMESPACE', 'remote-data-blocks/v1' );

Expand Down

0 comments on commit da51b5f

Please sign in to comment.