Title: Replace function
Last modified: August 19, 2016

---

# Replace function

 *  [13rust](https://wordpress.org/support/users/13rust/)
 * (@13rust)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/replace-function/)
 * Hi! I know English not very good, so I will write briefly.
    Can I change function
   in other module by my own function? For example, I need to replace ‘si_captcha_comment_form_wp3’
   function in Si-captcha module. Can I do this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [maxk](https://wordpress.org/support/users/maxk/)
 * (@maxk)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/replace-function/#post-1854513)
 * Hi 13rust,
    Unless you rewrite the function in si-captcha.php, which is a bad
   idea, it is not possible to do this since si_captcha_comment_form_wp3() does 
   not implement any filters.
 *  Good luck!
    -Max
 *  Moderator [Sergey Biryukov](https://wordpress.org/support/users/sergeybiryukov/)
 * (@sergeybiryukov)
 * WordPress Dev
 * [15 years, 4 months ago](https://wordpress.org/support/topic/replace-function/#post-1854515)
 * You can “unhook” the plugin’s function and replace it with your own:
 *     ```
       function my_captcha_comment_form() {
       	global $si_image_captcha;
   
       	// ...
   
       	remove_action('comment_form', array(&$si_image_captcha, 'si_captcha_comment_form'), 1);
       }
   
       function replace_si_captcha_comment_form_wp3() {
       	global $si_image_captcha;
   
       	remove_action('comment_form_after_fields', array(&$si_image_captcha, 'si_captcha_comment_form_wp3'), 1);
       	remove_action('comment_form_logged_in_after', array(&$si_image_captcha, 'si_captcha_comment_form_wp3'), 1);
   
       	add_action('comment_form_after_fields', 'my_captcha_comment_form', 1);
       	add_action('comment_form_logged_in_after', 'my_captcha_comment_form', 1);
       }
       add_action('init', 'replace_si_captcha_comment_form_wp3');
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Replace function’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 3 participants
 * Last reply from: [Sergey Biryukov](https://wordpress.org/support/users/sergeybiryukov/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/replace-function/#post-1854515)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
