[wp-trac] [WordPress Trac] #40954: Create Category within posts screen error

WordPress Trac noreply at wordpress.org
Wed Oct 22 21:05:32 UTC 2025


#40954: Create Category within posts screen error
-------------------------------+-------------------------
 Reporter:  cfastenrath        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:  4.8
 Severity:  normal             |  Resolution:  invalid
 Keywords:  close              |     Focuses:  javascript
-------------------------------+-------------------------

Comment (by myd2vzmpdk):

 you can add a small jQuery script to auto-refresh the category list after
 adding a new one.
 Place this in your admin footer or inside your theme’s functions.php like
 this:



 {{{#!php
 <?php
 add_action('admin_footer', function() {
 ?>
 <script type="text/javascript">
 jQuery(document).ajaxComplete(function(event, xhr, settings) {
   if (settings.data && settings.data.indexOf('action=add-category') !==
 -1) {
     // Reload category checklist after adding new category
     jQuery('#categorychecklist').load(location.href + ' #categorychecklist
 > *');
   }
 });
 </script>
 <?php
 });

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40954#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list