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
- Edit plugin without hooks in functions.php
- Making plugin unique to not conflict with plugins with the same name
- How to find out if option exists but is empty?
- Is dynamic forms/entries possible in Widget?
- How to assign user a role if none is present when logging in
- How to get posts by content?
- Trigger a custom wordpress plugin with a linux cron
- update_meta_user difference in i:1 and b:1, how to write b:1
- Registration Form Validation in wordpress
- Add_rewrite_rule doesn’t add custom url in plugin
- How to add inline css/js inside a shortcode
- Upload files programmatically to users
- Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?
- WP Plugin Developers – Accessing my wordpress site [closed]
- How to achieve certain page (url) accessible to certain users
- Next and/or previous post content
- How to pull code snippet from functionality plugin?
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- Best approach to fetch data from wp options to js file or php file
- Is it possible to create Custom Post plug-in?
- why doesn’t this update part of this plugin work? it take me to nothing here page
- Using a custom plugin to capture input data via Ajax and PHP
- Display post lists in 2nd paragraph
- How does task scheduler plugin implements cron that is not dependent on page load request? [closed]
- Session destroyed on page redirect
- Is there a way to test that readme looks in other language before submitting translation?
- Can I load the textdomain before a plugin is activated?
- Create tabs in admin options page from custom post type loop
- ob_start() combined with wp_query
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Settings API saved values not getting shown in the dropdownbox
- Is there any way to make myself an admin?
- populating a form field with output from a custom plugin function
- Understanding State in WordPress Multisites
- Custom Login Page — wp_signon Headers Already Sent?
- Why Does The `auto_update_plugin` Hook Disable Management?
- Is there a way to add custom endpoint to specific page only
- IF condition based on wp_remote_get output
- Is there a script to collect all hooks and filters provided by a plugin?
- How WordPress core manage the plugin installation
- Why is my WordPress Plugin page requesting my FTP Login Credentials?
- Post status doesn’t update to ‘future’ every time?
- Unable to give correct path in wordpress
- Disable variations on woo commerce if out of stock
- WordPress /users/me endpoint request forbidden
- adding custom code as a wordpress plugin
- count the number of views of a post excluding own views
- Plugin Hook When New Author Added
- Custom Post Type, Custom Columns List
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- How to set Google Analytics tracking code on WordPress plugin directory page?
- Show Custom Post on Frontend
- Problem with checked box on wp car manager plugin
- 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 Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Load my Inline js footer area
- Remove action added in plugin class from theme
- wc_get_product_terms() throws “Notice: Undefined offset: 0”
- Woocommerce list variations that are added already to cart in Single Product
- Plugin json page
- Using multi-dimensional array with filter
- WordPress Admin sub-level menu issue
- How do I add a textarea (multirow) option to my WordPress plugin?
- PHP header() not available to use in my plugin
- Passing ajax variable to more than one wordpress plugin function
- Displaying friend’s posts only
- Why isn’t my plugin seeing other classes?
- How Can the_post Be Hooked Like the_content and the_excerpt?
- How to add jquery to my custom post type wp plugin
- Update post meta not working on wp_postmeta
- Check if user is in a group of another site within multisite network [closed]
- Synch Custom Post Types (and Custom Fields, Cats, etc.) Between WordPress Sites
- Redirect url in plugin to somewhere else?
- wp_insert_post_data filter to set category
- Site is setup statically – how to make it content managable?
- is there a way I can add or remove some plugin options?
- Modifying lightbox plugin to allow for quoting, Does this exist? [closed]
- What can I do to customize a widget provided with this plugin? from where have I to start?
- How to escape html code?
- Function not being called on form submit, only blank admin-post.php page
- How to give specific class name to category in wordpress with code snippets