Make WordPress Core

Opened 14 years ago

Closed 10 years ago

#22293 closed enhancement (fixed)

New filter for wp_update_term and wp_insert_term

Reported by: baernty Owned by: SergeyBiryukov
Priority: normal Milestone: 4.7
Component: Taxonomy Version:
Severity: normal Keywords: has-patch 4.7-early
Cc: Focuses:

Description

I need a filter for $slug in this function. I want to check if there is a page with the same slug, because i don't use the category base.

Thanks very much.

Attachments (2)

22293.diff​ (2.0 KB ) - added by atimmer 11 years ago.
22293.2.diff​ (1.8 KB ) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (15)

#1 @baernty
14 years ago

  • Cc baernty added

#2 @baernty
14 years ago

and of course, also for a new term in wp_insert_term
THANKS!

#3 @SergeyBiryukov
14 years ago

create_term or edit_term actions can be used to update the slug right after the term is created or updated.

#4 @nacin
13 years ago

  • Component General → Taxonomy

#5 @boonebgorges
12 years ago

#27678 was marked as a duplicate.

#6 @chriscct7
11 years ago

  • Keywords needs-patch added

#7 @atimmer
11 years ago

  • Summary New Filter for wp_update_term → New filter for wp_update_term and wp_insert_term

@atimmer
11 years ago

#8 @atimmer
11 years ago

  • Keywords has-patch added; needs-patch removed

22293.diff adds a filter to both wp_insert_term and wp_update_term to filter the slug that will be saved.

#9 @SergeyBiryukov
11 years ago

  • Keywords 4.6-early added
  • Milestone Awaiting Review → Future Release
  • Owner set to SergeyBiryukov
  • Status new → reviewing

#10 @SergeyBiryukov
10 years ago

  • Keywords 4.7-early added; 4.6-early removed

22293.2.diff​ adds wp_insert_term_data and wp_update_term_data filters, which I think would be more useful than a filter just for the slug.

This ticket was mentioned in ​Slack in #core by helen. ​View the logs.


10 years ago

#12 @helen
10 years ago

  • Milestone Future Release → 4.7

Go forth and Sergey-bot.

#13 @SergeyBiryukov
10 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 38484:

Taxonomy: Introduce wp_insert_term_data and wp_update_term_data filters for altering term data before it is inserted/updated in the database.

Props atimmer, SergeyBiryukov.
Fixes #22293.

Note: See TracTickets for help on using tickets.