R
R
RigidStyle2018-05-31 03:02:51
WordPress
RigidStyle, 2018-05-31 03:02:51

Which function checks if the slug has been changed before saving?

It is necessary to check if the post slug has been changed before saving it, which function in WordPress is responsible for this? I know there is one, but I can't find it.
Actually why is this:

function delete_old_slugs() {
   срабатывает действие из плагина, удаляющего wp_old_slug из BD
}

if ( требуемая_функция == тру ) { 
add_action ( 'save_post', 'delete_old_slugs');
add_action ( 'publish_post', 'delete_old_slugs');
}

If the post slug has been changed, then when saving or publishing the post, delete the old slugs from the database that Voprdpress saves.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question