Я пытаюсь изменить плагин php wp для форматирования выходного значения $ как денег, используя valuemoney_format ('% i', $ value). "\ n";
Я пробовал
setlocale(LC_MONETARY, 'en_GB');
function format_value_money($value){
return valuemoney_format('%i', $value) . "\n";
}
и
$atts['placeholder'] = valuemoney_format('%i', $value) . "\n";
, а также
<span class="wpcf7-form-control-wrap %1$s"><input id="%5$s" oninput="output%5$s.value=%5$s.value" %2$s />%3$s</span><output class="contactform7-output" name="%1$s" id="output%5$s" for="%5$s">'%i'%4$s . "\n"</output>
значение форматируется какобычный текст (10000) и хотел бы показать значение в формате валюты (1000 фунтов стерлингов) или (1000 фунтов стерлингов)
<?php
function wpcf7_range_slider_extender_handler ( $tag ) {
$tag = new WPCF7_FormTag( $tag );
if ( empty( $tag->name ) ) {
return '';
}
$validation_error = wpcf7_get_validation_error( $tag->name );
$class = wpcf7_form_controls_class( $tag->type );
$class .= ' wpcf7-validates-as-number';
if ( $validation_error ) {
$class .= ' wpcf7-not-valid';
}
$atts = array();
$atts['class'] = $tag->get_class_option( $class );
$atts['id'] = $tag->get_id_option();
$atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
$atts['min'] = $tag->get_option( 'min', 'signed_int', true );
$atts['max'] = $tag->get_option( 'max', 'signed_int', true );
$atts['step'] = $tag->get_option( 'step', 'int', true );
if ( $tag->has_option( 'readonly' ) ) {
$atts['readonly'] = 'readonly';
}
if ( $tag->is_required() ) {
$atts['aria-required'] = 'true';
}
$atts['aria-invalid'] = $validation_error ? 'true' : 'false';
$value = (string) reset( $tag->values );
if ( $tag->has_option( 'placeholder' ) || $tag->has_option( 'watermark' ) ) {
$atts['placeholder'] = $value;
$value = '';
}
$value = $tag->get_default_option( $value );
$value = wpcf7_get_hangover( $tag->name, $value );
$atts['value'] = $value;
if ( wpcf7_support_html5() ) {
$atts['type'] = $tag->basetype;
} else {
$atts['type'] = 'text';
}
$atts['name'] = $tag->name;
$atts = wpcf7_format_atts( $atts );
$html = sprintf(
'<span class="wpcf7-form-control-wrap %1$s"><input id="%5$s" oninput="output%5$s.value=%5$s.value" %2$s />%3$s</span><output class="contactform7-output" name="%1$s" id="output%5$s" for="%5$s">%4$s</output>',
sanitize_html_class( $tag->name ), $atts, $validation_error, $value, sanitize_tag_name( $tag->name ));
return $html;