How to add user details to different tables immediately after user registration

Removing the table names from the column names when using $wpdb->insert() is what worked for me: function add_to_affuser($user_id) { global $wpdb; $user_info = get_userdata($user_id ); $wpdb->insert( ‘mytbl_A’, array(‘name’ => $user_info->user_login, ’email’ => $user_info->user_email ), array(‘%s’, ‘%s’) ); } add_action( ‘user_register’, ‘add_to_affuser’); function add_to_aff($user_id) { global $wpdb; $user_info = get_userdata($user_id); $wpdb->insert( ‘mytbl_B’, array(‘user_id’ => $user_info->ID ), … Read more

How to limit number of number of categories displayed by categories widget

You could show the Category widgets as a dropdown instead, if you have large number of categories. I’m not sure how useful it is to limit categories when ordered by name. You might try to order by count to display the most used categories: add_filter( ‘widget_categories_args’, function( $args ) { $args[‘number’] = 1; $args[‘orderby’] = … Read more

As a plugin developer, how do I remove a plugin from the global plugin directory? [duplicate]

Just delete the content of your plugin directory using subversion in the SVN repository. svn co http://plugins.svn.wordpress.org/your-plugin your-plugin In other words, these instructions may help you update the plugin files. svn status svn update svn commit -m “Emptied my plugins…” If you need to delete files use this svn st | grep ‘^!’ | awk … Read more

Remove custom post type slug from URL and add taxonomy Slug

You can set up simple tax/cpt permalinks with the rewrite argument when you register the post type: function wpd_product_brand_types() { register_taxonomy( ‘brand’, ‘product’, array( ‘rewrite’ => array( ‘slug’ => ‘brand’, ‘with_front’ => false ) ) ); register_post_type( ‘product’, array( ‘label’ => ‘Products’, ‘public’ => true, ‘supports’ => array( ‘title’ ), ‘rewrite’ => array( ‘slug’ => … Read more