woocommerce_states
The WordPress Core woocommerce states hook.
Description
Parameters (1)
- 0. $states (unknown)
- The states.
Usage
- To run the hook, copy the example below.
- $states = apply_filters( 'woocommerce_states', $states );
- if ( !empty( $states ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the woocommerce_states callback
- function filter_woocommerce_states( $states ) {
- // make filter magic happen here...
- return $states;
- };
- // add the filter
- add_filter( 'woocommerce_states', 'filter_woocommerce_states', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'woocommerce_states', 'filter_woocommerce_states', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /includes/class-wc-countries.php
- $this->states = apply_filters( 'woocommerce_states', $states );