add wp-future

This commit is contained in:
2022-04-26 00:46:54 +03:00
parent eb335f8d52
commit cebc3aca47
8 changed files with 99 additions and 52 deletions

View File

@@ -213,11 +213,11 @@ function lat_slug( $post_id ){
if ( wp_is_post_revision( $post_id ))
return;
$post = get_posts($post_id);
$name = urldecode($post[0]->post_name);
$currpost = get_post($post_id);
$name = urldecode($currpost->post_name);
if (isContainsRussianLetters($name)) { //если есть русские буковки
$title = express_slug($post[0]->post_title);
$title = express_slug($currpost->post_title);
$latname = vij_slug($title);
remove_action( 'save_post', 'lat_slug' ); // избегаем зацикливания
wp_update_post( array( 'ID' => $post_id, 'post_name' => $latname ) );