wp_insert_user will not create a non-existing user with a set ID, it will return an error.
The way to do this would be to first do:
global $wpdb;
$wpdb->insert( $wpdb->users, array( 'ID' => 136166 ) );
wp_insert_user( ... );
The code above will first create an empty user row with the set ID (it will fail hard if the ID already exists, duplicate entry for primary key ) which you can then modify using the API as needed.
Related Posts:
- Where the Nickname is being used in WordPress
- WordPress Capabilities: edit_user vs edit_users
- Allowing Custom Capability to Manage Plugin Options
- Building a scalable WordPress favouriting plugin – one serialised meta value array or many meta records
- Checking for user role in a custom plugin
- Allow Facebook to preview posts before published
- How to write a plugin to add users to a mail list
- How to keep users unique id stored in session in addition to IP in WordPress plugin?
- How to make a customize role and view a specific plugins base on that role?
- Redirection of users away from wp-admin (but not administrators)
- Modifying Author Link to add Author Meta in URL
- How to set add question capability for author role in wp pro quiz plugin
- Can a Plugin Override New User Default Role Type
- Add User Role: Pre-saved in User-Meta [SOLVED]
- Search users with custom meta data
- How To Create A File Archive in WordPress?
- Allow a particular user to access a particular plugin?
- Confusing problem with displaying message recipient metadata
- What are the common security flaws I need to look for? [closed]
- Creating a WordPress admin page without a menu for a plugin
- Creating a user’s own folder on user registration
- Common functionality between my own plugins
- Problem requiring/including plugin files with plugin_dir_path( __FILE__ )
- How To Ignore a Filter On Applying Filter the Content In a Function
- Which functions in theme or plugin load first
- Adding Image in readme.txt file of wordpress plugin
- Saving Plugin settings to the database
- Add CSS animation as Preloader to WordPress
- Restricting users to a specific front end page [closed]
- remove custom taxonomy metabox form custom post type
- $wpdb->get_results() does not fetch results with unicode ‘WHERE’ clause
- Deleting images through upload folder, but not deleting from media library
- how to use ajax to display from database and load more in wordpress plugin
- WordPress plugin installation
- Get image URL from media library in input
- How could I execute my plugin just in frontend (not in backend)
- Create or Update thousands of woocommerce products via PHP
- Custom height/width for thickbox in WP Backend
- add action wp_head not working
- How can sanitize $_FILES[‘haq_slider’] field
- How to trigger $_GET request within admin plugin page?
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- WordPress plugin – Error “Plugin generate 2890 characters of unexpected output when activated”
- Woocommerce plugin for minimum order and add-to-card-step
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- Change plugin main file name (that is currently in the repo)
- Get plugin option in another PHP file
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- wp_remote_get() returns 403 while file_get_contents() does not
- WordPress get_avatar function not correct working
- Understanding State in WordPress Multisites
- Can I use Symfony components in a plugin that I want to submit to the WordPress plugin repository?
- Custom license for WordPress plugin
- Custom Login Page — wp_signon Headers Already Sent?
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- How to create plugin/ page that reads from database
- Why is my WordPress Plugin page requesting my FTP Login Credentials?
- Cross Sells are not being shown in Cart Page. Please Help!
- Plugin not properly prepared for localization
- WordPress /users/me endpoint request forbidden
- adding custom code as a wordpress plugin
- Show media-uploads to all users
- How to add filter for wordpress plugin?
- Custom Post Type, Custom Columns List
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- How to upload large media file in chunks, without any plugin?
- How to set Google Analytics tracking code on WordPress plugin directory page?
- How to add styles to a submenu page?
- How to store a secret for a plugin inside public_html
- Problem with checked box on wp car manager plugin
- How to use functions found inside pluggable.php with my plugin files
- Create a link that calls our custom function in WordPress
- Update a previous version of plugin when the new plugin is built from the scratch
- WordPress Product Detail and catalog
- Woocommerce list variations that are added already to cart in Single Product
- Plugin json page
- How do I add a textarea (multirow) option to my WordPress plugin?
- Passing ajax variable to more than one wordpress plugin function
- search into subcategories plugin subcategory value not come
- Why isn’t my plugin seeing other classes?
- How Can the_post Be Hooked Like the_content and the_excerpt?
- How to tell which Plugin is displaying?
- Get Core Functionality from Within a (Secondary) Plugin File
- wp_insert_post_data filter to set category
- Plugin keeps saying needs to be updated and it’s in a constant loop [closed]
- is there a way I can add or remove some plugin options?
- How to provide access to specific plugin to all the user roles except subscriber in wordpress
- Output pure JSON wordpress
- how to remove a rel=”nofollow” using call to action plugin
- Activate plugin button do nothing [closed]
- Create Custom Coupon Type
- Is it possible to create post in wordpress using postman?
- wp_enqueue_script doesn’t load JS in plugin
- AI Code For OpenAI
- Read page- or post-content across different builder-plugins
- How to make WordPress Plugin run on single specific Admin Page
- Frontend Enqueued Files in the Backend
- Why WP CLI command is not visible in VIP CLI