Title: Must Use Plugins &#8211; mu-plugins help
Last modified: September 22, 2019

---

# Must Use Plugins – mu-plugins help

 *  Resolved [ukndoit](https://wordpress.org/support/users/ukndoit/)
 * (@ukndoit)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/must-use-plugins-mu-plugins-help/)
 * I am creating a php code to listen for a post from a webhook.
 * So I put it in mu-plugin since it will execute and never be overwritten when 
   updates happen.
 * I have never created a plugin, so no idea how to do it with a plugin.
 * My question is, if it finds a post from the webhook, then does what I need it
   to, then have it print the header with 200 ok, then exit, why won’t the things
   that wp does work, such as:
 * `wp_create_user( $_user_name, $random_password, $_user_name );`
 * That code causes my site to get an error.
    if I put the // in front, no error.
   if I let it do it, I do get an error.
 * Also other things did not work, such as get_user_by did not work, but creating
   this function:
 *     ```
       function get_user_by( $field, $value ) {
           $userdata = WP_User::get_data_by( $field, $value );
   
           if ( ! $userdata ) {
               return false;
           }
   
           $user = new WP_User;
           $user->init( $userdata );
   
           return $user;
       }
       ```
   
 * that does work… so how do I do this:
    `wp_create_user( $_user_name, $random_password,
   $_user_name );`
 * if it does not work?
 * Is there a better way to create some code that would work, without using the 
   mu-plugin?
 * Thanks,
    -Richard

Viewing 1 replies (of 1 total)

 *  Thread Starter [ukndoit](https://wordpress.org/support/users/ukndoit/)
 * (@ukndoit)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/must-use-plugins-mu-plugins-help/#post-11956536)
 * I FIXED IT 🙂 🙂 🙂
 * used the add_action to create a function…
 * that fixed it.
 * not sure if it prints the header 200 ok or not… the way it needs to, and not 
   sure how to test that, but so far so good.

Viewing 1 replies (of 1 total)

The topic ‘Must Use Plugins – mu-plugins help’ is closed to new replies.

## Tags

 * [mu-plugins](https://wordpress.org/support/topic-tag/mu-plugins/)
 * [webhooks](https://wordpress.org/support/topic-tag/webhooks/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 1 participant
 * Last reply from: [ukndoit](https://wordpress.org/support/users/ukndoit/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/must-use-plugins-mu-plugins-help/#post-11956536)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
