How can I add programmatically custom taxonomy terms to a custom type post when saving posts?

So, to answer my own question: I haven’t found any solution inside wp_insert_post_data. I suspect that the problem is connected to the fact that when wp_insert_post_data is executed the post in question is not yet in the database. And albeit I didn’t manage to find it in taxonomy.php, it is logical to assume that the … Read more

Custom taxonomy position in admin panel

It will definately not show in custom_1 because you probably must have defined it for custom_2.However, you can define a custom submenu with link same as that of the taxonomy in which the parent link is that of custom_2. Following is what i mean. add_submenu_page( ‘edit.php?post_type=custom_1’, ‘Page Title’, ‘Menu Title’, ‘add_users’,’edit-tags.php?taxonomy=custom_taxonomy’, ” );

How to restrict on selecting child taxonomy

Really, you could probably refine this more and come up with better names, I just wanted to make it functional ^_^ ! First thing’s first -> Let’s include JQuery because I don’t want to do this in vanilla JS. function lets_include_jquery() { wp_enqueue_script( ‘jquery’ ); } add_action( ‘admin_enqueue_scripts’, ‘lets_include_jquery’ ); Now let’s throw a script … Read more