[wp-trac] [WordPress Trac] #55329: add_clean_index function throws PHP notice error

WordPress Trac noreply at wordpress.org
Wed Nov 19 08:56:59 UTC 2025


#55329: add_clean_index function throws PHP notice error
-----------------------------+------------------------------
 Reporter:  gvgvgvijayan     |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  administration
-----------------------------+------------------------------

Comment (by philipzimmerm56):

 This pull request introduces a new utility function, has_index(), which
 checks if an index exists for a specific column in a given database table.
 Additionally, the add_clean_index() function has been refactored to use
 this new helper function, ensuring that indexes are only added when they
 don't already exist and preventing unnecessary index drops or duplicate
 indexes.

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


More information about the wp-trac mailing list