We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
関連:#162
add_filter( 'snow_monkey_forms/select/options', function( $options, $name, $setting ) { if ( 'select-1gc5lsikb' === $name ) { return array( 'あいうえお' => 'あいうえお', 'かきくけこ' => 'かきくけこ', 'さしすせそ' => 'さしすせそ', ); } return $options; }, 10, 3 ); // name が select-1gc5lsikb のとき、初期値を設定 add_filter( 'snow_monkey_forms/control/attributes', function( $attributes, $setting ) { if ( isset( $attributes['name'] ) && 'select-1gc5lsikb' === $attributes['name'] ) { $attributes['value'] = 'さしすせそ'; } return $attributes; }, 10, 2 );
add_filter( 'snow_monkey_forms/checkboxes/options', function( $options, $name, $setting ) { if ( 'checkboxes-1ekvl4g0n' === $name ) { return array( 'あいうえお' => 'あいうえお', 'かきくけこ' => 'かきくけこ', 'さしすせそ' => 'さしすせそ', ); } return $options; }, 10, 3 ); // name が checkboxes-1ekvl4g0n のとき、初期値を設定 add_filter( 'snow_monkey_forms/control/attributes', function( $attributes, $setting ) { if ( isset( $attributes['name'] ) && 'checkboxes-1ekvl4g0n' === $attributes['name'] ) { $attributes['values'] = [ 'あいうえお', 'さしすせそ' ]; } return $attributes; }, 10, 2 );
add_filter( 'snow_monkey_forms/radio_buttons/options', function( $options, $name, $setting ) { if ( 'radio-buttons-1ekvl55js' === $name ) { return array( 'あいうえお' => 'あいうえお', 'かきくけこ' => 'かきくけこ', 'さしすせそ' => 'さしすせそ', ); } return $options; }, 10, 3 ); // name が radio-buttons-1ekvl55js のとき、初期値を設定 add_filter( 'snow_monkey_forms/control/attributes', function( $attributes, $setting ) { if ( isset( $attributes['name'] ) && 'radio-buttons-1ekvl55js' === $attributes['name'] ) { $attributes['value'] = 'さしすせそ'; } return $attributes; }, 10, 2 );
The text was updated successfully, but these errors were encountered:
ec8ca75
Add tests #163
60f6fe1
お世話になります。 ちょうどチェックボックスのフックを使用する機会がありまして実装してみたのですが、 $attributes['value'] だと初期値が設定されず、 $attributes['values'] だど初期値が設定されました。
公式サイトでは $attributes['value'] になっているようですが、 $attributes['values']のまま運用を続けても問題ないでしょうか?
Sorry, something went wrong.
@uepirogram あ、公式サイトのアップデート記事を見られましたかね?そっちのほうはご指摘のように間違いがありました!この issue の頭のほうに書いているように、$attributes['values'] = [ 'あいうえお', 'さしすせそ' ];、values に配列を渡すのが正しいです!
$attributes['values'] = [ 'あいうえお', 'さしすせそ' ];
values
@inc2734 早速のご返信ありがとうございます!承知しました!
No branches or pull requests
関連:#162
セレクトボックス
チェックボックス
ラジオボタン
The text was updated successfully, but these errors were encountered: