WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

_wp_customize_changeset_filter_insert_post_data() WP 4.7.0

Filters changeset post data upon insert to ensure post_name is intact.

This is needed to prevent the post_name from being dropped when the post is transitioned into pending status by a contributor.

Хуков нет.

Возвращает

Массив. Filtered data.

Использование

_wp_customize_changeset_filter_insert_post_data( $post_data, $supplied_post_data );
$post_data(массив) (обязательный)
An array of slashed post data.
$supplied_post_data(массив) (обязательный)
An array of sanitized, but otherwise unmodified post data.

Заметки

  • Смотрите: wp_insert_post()

Список изменений

С версии 4.7.0 Введена.

Код _wp_customize_changeset_filter_insert_post_data() WP 5.5.1

<?php
function _wp_customize_changeset_filter_insert_post_data( $post_data, $supplied_post_data ) {
	if ( isset( $post_data['post_type'] ) && 'customize_changeset' === $post_data['post_type'] ) {

		// Prevent post_name from being dropped, such as when contributor saves a changeset post as pending.
		if ( empty( $post_data['post_name'] ) && ! empty( $supplied_post_data['post_name'] ) ) {
			$post_data['post_name'] = $supplied_post_data['post_name'];
		}
	}
	return $post_data;
}