Title: function.php add_action does not work
Last modified: December 20, 2017

---

# function.php add_action does not work

 *  [christos312](https://wordpress.org/support/users/christos312/)
 * (@christos312)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/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/](https://sarkware.com/wc-fields-factory-api/)
 * But it doesnt seem to work. what am i doing wrong?
    -  This topic was modified 8 years, 4 months ago by [christos312](https://wordpress.org/support/users/christos312/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Saravana Kumar K](https://wordpress.org/support/users/mycholan/)
 * (@mycholan)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/function-php-add_action-does-not-work/#post-9802029)
 * From version 2.0.0 I have replaced `/` with `_` on all Wc Fields Factory related
   actions and filters. (It’s on the release note).
 * So
 * `add_action( 'wccpf/before/field/start', 'wccpf_field_wrapper_start' );`
 * has to be like this
 * `add_action( 'wccpf_before_field_start', 'wccpf_field_wrapper_start' );`

Viewing 1 replies (of 1 total)

The topic ‘function.php add_action does not work’ is closed to new replies.

 * ![](https://ps.w.org/wc-fields-factory/assets/icon-128x128.jpg?rev=2738843)
 * [WC Fields Factory](https://wordpress.org/plugins/wc-fields-factory/)
 * [Support Threads](https://wordpress.org/support/plugin/wc-fields-factory/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-fields-factory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-fields-factory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-fields-factory/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Saravana Kumar K](https://wordpress.org/support/users/mycholan/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/function-php-add_action-does-not-work/#post-9802029)
 * Status: not a support question