function.php add_action does not work
-
Hello, I am using the following code
add_action( 'wccpf/before/field/start', 'wccpf_field_wrapper_start' ); function wccpf_field_wrapper_start( $field ) { var_dump($field); /* Individual wrapper element start */ echo '<div class="your-custom-field-wrapper-class">'; /* You can even test for any specific field and add your own elements elements accordingly */ if( $field["type"] == "file" ) { echo '<h5>Please upload images with size of less than 1MB</h5>'; } } add_action( 'wccpf/after/field/end', 'wccpf_field_wrapper_end' ); function wccpf_field_wrapper_end( $field ) { /* Individual wrapper element end */ echo '</div>'; }
I added the code above in my functions.php file in my theme.
I found this code here https://sarkware.com/wc-fields-factory-api/
But it doesnt seem to work. what am i doing wrong?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘function.php add_action does not work’ is closed to new replies.