Reputation
10,161
Next privilege 15,000 Rep.
Protect questions
Badges
16 35
Newest
 Nice Answer
Impact
~392k people reached

Jul
16
reviewed Approve How to order posts by meta value?
Jul
11
reviewed Reject get_option() vs get_theme_mod(): Why is one slower?
Jul
8
comment How to not allow users to create new tags, but allow to them to use existing ones
Great. In the case of WP_Error, you won't see that error message anywhere unless you work with the error object specifically. The reason why we throw a WP_Error in this instance is because wp_insert_term() in wp-includes/taxonomy.php checks for an error object using wp_is_error() and if true, it will return the $term passed to the function as opposed to inserting it into the database. I suggest you take a look at the aforementioned function in WP core to get an idea of whats happening. Here is a reference to WP_Error too: codex.wordpress.org/Class_Reference/WP_Error
Jul
7
comment How to not allow users to create new tags, but allow to them to use existing ones
See pastebin.com/nX9ZLubH
Jul
7
comment How to not allow users to create new tags, but allow to them to use existing ones
Time to start debugging then. In wp-config.php set the following constants, define('WP_DEBUG', true);, define('WP_DEBUG_LOG', true);, and define('WP_DEBUG_DISPLAY', false); then in the function snippet above, log a call to error_log($taxonomy); and another call to error_log(implode(', ', $user->roles)); then add a tag then update the post, this will then create a debug.log file in the wp-content directory. You need to work out whether or not this function is being called and whether or not it is entering the conditional statement correctly because this callback works for me.
Jul
7
comment How to not allow users to create new tags, but allow to them to use existing ones
What is the user role you are trying to prevent? Also are you trying to prevent tags for the correct taxonomy, in this case post_tag and not some other taxonomy like categories or some custom taxonomy?
Jul
5
revised Echo one category as title when post has multiple categories?
remove all cap words, not necessary.
Jul
5
answered How to not allow users to create new tags, but allow to them to use existing ones
Jul
5
awarded  Cleanup
Jul
4
reviewed Approve How should I use wpdb class to submit a form in admin dashboard?
Jul
4
reviewed Approve Problem in adding new site on WP multisite
Jun
29
reviewed Approve Where is the stylesheet code?
Jun
26
reviewed Approve Add custom column to Users admin panel with Types user custom fields?
Jun
23
revised Update post meta using save_post hook in multisite
formatting
Jun
22
reviewed Approve How to display pagination links for WP_User_Query?
Jun
20
reviewed Approve Running a song lyrics site on WordPress
Jun
16
reviewed Approve How can I make WordPress serve homepage to different URL?
Jun
16
reviewed Approve Offline Wordpress Application
Jun
10
revised Subdomain is not working
added 2 characters in body
Jun
9
comment generate unique slug while inserting post
If you do not specify a post_name parameter, WordPress will create the slug for you automatically based on the post_title. If a post already exists with the same post_name, WordPress will append a number to the end of the slug, such as {slug}-2 and {slug}-3 etc.