/** * * @package [Parent Theme] * @author gaviasthemes * @license http://www.gnu.org/licenses/gpl-2.0.html GNU Public License * */ function kunco_child_scripts() { wp_enqueue_style( 'kunco-parent-style', get_template_directory_uri(). '/style.css'); wp_enqueue_style( 'kunco-child-style', get_stylesheet_uri()); } add_action( 'wp_enqueue_scripts', 'kunco_child_scripts', 9999 ); function charitable_text_switcher( $translations, $text, $domain ) { if ( 0 === strpos( $domain, 'charitable' ) && $text == 'Donate' ) { return __( 'Donasi', 'charitable' ); } return $translations; } add_filter( 'gettext', 'charitable_text_switcher', 10, 3 ); add_action( 'init', function() { /* Create the `Charitable_Donation_Field` object. */ $field = new Charitable_Donation_Field( 'my_custom_field', array( 'label' => 'Donasi Untuk', 'data_type' => 'meta', 'donation_form' => array( 'type' => 'radio', 'required' => true, 'show_before' => 'first_name', 'options' => array( 'Siswa TK' => 'Siswa TK', 'Siswa SD' => 'Siswa SD', 'Siswa SMP' => 'Siswa SMP', 'Siswa SMA' => 'Siswa SMA', 'Dana Pembangunan' => 'Dana Pembangunan' ), ), 'admin_form' => true, 'show_in_meta' => true, 'show_in_export' => true, 'email_tag' => array( 'description' => __( 'The custom field value' ), ), ) ); /* Get the `Charitable_Donation_Field_Registry` instance. */ $fields = charitable()->donation_fields(); /* Add the new field. */ $fields->register_field( $field ); } ); add_filter( 'charitable_donation_form_user_fields', function( $fields, $form ) { /* If the field doesn't exist, stop right here. */ if ( ! array_key_exists( 'my_custom_field', $fields ) ) { return $fields; } /* Match any campaign that DOESN'T have a slug of 'special-campaign' */ if ( 'yayasan-gema-kasih-yobel' !== $form->get_campaign()->post_name ) { unset( $fields['my_custom_field'] ); } return $fields; }, 10, 2 );