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 print the excuted sql right after its execution
- Return only Count from a wp_query request?
- Is it possible to completely stop WP_Query retrieving posts?
- how does $wpdb differ to WP_Query?
- Is it true $wpdb->get_results is faster than WP_Query in most cases?
- new WP_Query() – what is the earliest valid hook?
- Identify which loop you are hooking into; primary or secondary?
- Pagination custom query
- Order by two meta keys
- How to make an activities stream mixing posts and comments?
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Shortcode returns escaped HTML tags
- Calling a custom excerpt function in a local loop
- Get number of comments after modifying comment query
- How to change a custom query into a standard loop?
- Dynamically Override Fancy Title – Part II
- query posts in functions.php and update a field
- How to count data records in wordpress which have same meta_value in wp_postmeta table?
- $wpdb->insert inserting two rows in database
- Gravity Forms field entries into wp_query loop [closed]
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- Detect featured image among the attached images
- How to change posts order on Category and Tag archives?
- posts_per_page not working
- How would I format a query that depends on post parent taxonomy
- $wpdb select date range of posts
- Exclude category for main query and custom
- Wp_query function to search from product_title ‘OR’ product tags name
- Getting post revision and printing them on the post content site
- Iterating through $wpdb query without using get_results for large query results
- How to use the query hook/filter?
- WP Query using tax_query & meta_query
- Set global $wp_query/$post variable for dynamic page generation
- 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?
- How to pass orderby params to $wpdb->prepare()?
- Is it safe to access the underlying mysqli object from \wpdb for custom queries?
- Merge two search functions for custom post type
- List of ways to access WordPress database?
- Error with function in functions.php?
- Specify strict ‘order by’ in WordPress query
- Utilising an existing page while using the “s” query parameter
- Does WordPress have something like Drupal’s DB API?
- Exclude authors IDs from WP_Query
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- How do I fit WP_Query arguments into a function?
- Create a notification for post field
- Add URL Rewrite Rule To WordPress
- 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 …?
- 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]
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- Save queried result into database
- Doing $wpdb->get_results returns NULL, doing the same query in my DB returns correct value
- Finding post ID dynamically on click
- how to move a page from one drop down menu to another drop down menu
- remove_action – pre_get_posts – does not restore original query
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Save query in function for custom gallery
- Problem with custom WP_Query and underlying pagination/posts_per_page
- Calling a function with WP_Query only ever brings the first result
- 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
- I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views
- ordering and optimizing functions
- Fire query on ajax post url page
- $wp_query when new WP_Query
- Slow getting posts from category
- 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]
- Convert a WP Query into a simpler SQL query to fetch only COUNT of posts
- Adding css tweak based on page template
- WP_Query and DES sort for Custom Taxonomy based upon a meta field?
- How to write a query-function as a query-shortcode?
- 1500+ duplicate queries via get_option function (query monitor)
- get_post_meta bringing back results, but $wpdb->postmeta doesn’t
- Is there another way to retrieve a post_id from post_meta other than a SQL query?
- Excluding a category from frontpage but not from WP_Query