wp_insert_post_empty_content
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
apply_filters( 'wp_insert_post_empty_content', bool $maybe_empty, array $postarr )
Описание
Запись считается «пустой», если выполнены оба условия:
Тип записи поддерживает поля заголовка, редактора и цитаты
Поля заголовка, редактора и цитаты все пусты
Возврат истинного значения из фильтра фактически прерывает вставку новой записи и возвращает 0. Если $wp_error равно true, вместо этого будет возвращён WP_Error.
Оригинал (английский)
The post is considered “empty” if both:
- The post type supports the title, editor, and excerpt fields
- The title, editor, and excerpt fields are all empty
Returning a truthy value from the filter will effectively short-circuit the new post being inserted and return 0. If $wp_error is true, a WP_Error will be returned instead.
Фильтруемое значение
Параметры
$maybe_empty
bool
обязательный
$postarr
array
обязательный
Исходный код
wp-includes/post.php:4602
if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
История изменений
| Версия | Описание |
|---|---|
| 3.3.0 | Introduced. |

