Replace this with yours:
add_action( 'delete_user', 'yg_user_delete', 10, 1 );
function yg_user_delete( $user_id ) {
$user_info = get_userdata($user_id);
$user_name = $user_info->user_login;
print_r($user_info);
wp_delete_term( get_term_by('name', $user_name, 'user1')->term_id, 'user1', array() );
}
Related Posts:
- Best practice custom function, where to echo the variables?
- How to filter, restrict and return posts based on custom user meta information
- Make a SQL query with wpdb in WordPress
- SEARCH QUERY PLEASE HELP | call_user_func_array() expects parameter 1 to be a valid callback php
- What argument does my function need to echo get_results() query results
- How to do set post permalinks using 6 digit random unique function?
- Query with search and subscribers only output
- wp_Qwery works to slow
- Display most popular in the past two days
- meta_query not working as expected
- New WP_Query calls Pre_get_posts filter twice
- How to query custom post types with mixed AND & OR statements for custom fields
- Query most popular terms by taxonomy over 2 week period
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- how to access query string in wordpress?
- Custom query: Get all posts that are from a certain category?
- How to access custom WordPress database tables
- How to pass orderby params to $wpdb->prepare()?
- How can I override one post and make it display content for another post?
- Ajax future single post query doesn’t work when NOT logged in
- Conditional sorting with variable using WP Query
- Is it safe to access the underlying mysqli object from \wpdb for custom queries?
- Merge two search functions for custom post type
- WordPress query posts with multiple post_meta data
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- List of ways to access WordPress database?
- Error with function in functions.php?
- Specify strict ‘order by’ in WordPress query
- queried_object using pre_get_posts gets notices and warning
- Utilising an existing page while using the “s” query parameter
- Does WordPress have something like Drupal’s DB API?
- get_post() is not returning correct value
- Exclude authors IDs from WP_Query
- Loading two different AJAX requests on two different pages
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- How to load a script code only in posts?
- Multiple meta_key ordering with pre_get_posts
- How do I fit WP_Query arguments into a function?
- Create a notification for post field
- Add URL Rewrite Rule To WordPress
- Trying to get property of non-object in: $wp_query
- WordPress dynamic AJAX query
- relation OR instead of AND – Filtered term ID’s in loop
- Disable (or limit) queries when certain content (or data) is not needed (or showed)
- get_var is neither a string, integer, or array …?
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- how to translate countries output from wp database?
- What’s wrong with this wpdb query?
- Filter for replacing the WP_query object for a given category
- Elementor posts custom query based on tag [closed]
- WP_Query retuning empty array in rest api
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- duplicated posts when using pagination
- Passing a SQL query to the WP Query
- Save queried result into database
- Pagination repeating posts on search results
- Any way to use FETCH_KEY_PAIR with $wpdb?
- How to check if logged in user have pending custom post?
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- Custom WordPress post query for displaying time-released content on website
- How to get user avatar via WPDB
- Custom query for custom post type not getting correct post ID
- Modify post image in full size
- Finding post ID dynamically on click
- how to move a page from one drop down menu to another drop down menu
- How to upload 3 attachments to current post?
- remove_action – pre_get_posts – does not restore original query
- Global page ID variable empty error
- In which file to use $wpdb and its functions for database operations and queries in wordpress?
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Get post Number with local loop and template
- Save query in function for custom gallery
- Seach and categories not working when ignoring sticky posts in main loop
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Calling a function with WP_Query only ever brings the first result
- complex query question
- Select Unique Posts for a List of Tags
- Rewrite rule pagination on different url levels
- Fetching $_POST from Page Template into functions.php
- How To Use WP_Query To Get The Custom Post type Posts With Keywords
- Include post_status check within $wpdb query
- wpdb get_results() returns only 2 rows
- Declare inline background image in functions.php
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- Optimising amount of calls to custom fields
- Hiding all posts/products/pages from a site based on a custom taxonomy/domain name
- pre_get_posts or $where, which one to use?
- ordering and optimizing functions
- Fire query on ajax post url page
- $wp_query when new WP_Query
- Slow getting posts from category
- Search Query that Includes Custom Table
- Why WP_Query in functions.php is not working when get_posts works?
- Custom query (author is post_author or meta co_author) with Pagenavi pagination
- WP_Query search by multiple meta key and distance
- Different sql queries count indicator on the main page [closed]
- wpdb LIKE request shows all database data
- Convert a WP Query into a simpler SQL query to fetch only COUNT of posts
- How much does $wpdb->prepare(), then $wpdb->query() VS straight $wpdb->query(), can slow down the load time of whole page
- Adding css tweak based on page template