Welcartの管理画面で設定したカスタムメンバーフィールドなどカスタムフィールドの入力フォームに記入例など文字列を追加する方法を書いていきます。
カスタムメンバーフィールドに記入例を追加する
Welcartのカスタムフィールドに文字列やタグを追加する “usces_filter_custom_field_input_value” というフィルターフックに追加する独自関数を functions.php 等に追加します。
/**
 * カスタムメンバーフィールドなど
 * カスタムフィールドに文字列を追加するカスタマイズ
 */
function ag_usces_filter_custom_field_input_value( $html, $key, $entry )
{
    // カスタムメンバーフィールドのフィールドキーが
	// "birthday" の場合に追加処理を行う
	if ( $key === 'birthday' ) {
		$html .= ' 2020-09-01';
	}
    return $html;
}
add_filter( 'usces_filter_custom_field_input_value', 'ag_usces_filter_custom_field_input_value', 10, 3 );動作環境情報
エックスサーバー(x10) PHP 7.3.16 MySQL 5.7 WordPress 5.5.1

 
  
  
  
  

コメント