cwcfp_field_locations
The cwcfp_field_locations filter allows users to modify the locations available for Conditional Fields to be displayed on the checkout page.
The filter receives one argument:
- $locations: An array of locations in a $hook => $readable format
$locations = array( 'woocommerce_before_checkout_billing_form' => __( 'Before Billing Form', 'conditional-woo-checkout-field-pro' ), 'woocommerce_after_checkout_billing_form' => __( 'After Billing Form', 'conditional-woo-checkout-field-pro' ), 'woocommerce_before_checkout_shipping_form' => __( 'Before Shipping Form', 'conditional-woo-checkout-field-pro' ), 'woocommerce_after_checkout_shipping_form' => __( 'After Shipping Form', 'conditional-woo-checkout-field-pro' ), 'woocommerce_before_order_notes' => __( 'Before Order Notes', 'conditional-woo-checkout-field-pro' ), 'woocommerce_after_order_notes' => __( 'After Order Notes', 'conditional-woo-checkout-field-pro' ), );
There may be other locations made available by your theme that you can add through this filter.
add_filter( 'cwcfp_field_locations', 'add_location_for_conditional_fields' ); function add_location_for_conditional_fields( $locations ){ $locations['my_custom_location_hook'] = 'Some text you want displayed in the WooCommerce > Conditional Fields > Settings tab > Locations menu for your custom location hook'; return $locations; }
You would then select your custom location in the WooCommerce > Conditional Fields > Settings tab > Locations dropdown menu.