acf_update_internal_post_type_active_status()
Activates or deactivates an ACF post.
Хуков нет.
Возвращает
true|false.
Использование
acf_update_internal_post_type_active_status( $id, $activate, $post_type );
- $id(int|строка) (обязательный)
- The field_group ID, key or name.
- $activate(true|false)
- True if the post should be activated.
По умолчанию:true - $post_type(строка)
- The post type being activated/deactivated.
По умолчанию:'acf-field-group'
Код acf_update_internal_post_type_active_status() acf update internal post type active status ACF 6.4.2
function acf_update_internal_post_type_active_status( $id, $activate = true, $post_type = 'acf-field-group' ) {
$instance = acf_get_internal_post_type_instance( $post_type );
if ( $instance ) {
return $instance->update_post_active_status( $id, $activate );
}
return false;
}