ACF_UI_Options_Page::update_post
Updates the settings for ACF UI options pages.
Method of the class: ACF_UI_Options_Page{}
No Hooks.
Returns
Array.
Usage
$ACF_UI_Options_Page = new ACF_UI_Options_Page(); $ACF_UI_Options_Page->update_post( $post );
- $post(array) (required)
- The ACF post to update.
Changelog
| Since 6.2 | Introduced. |
ACF_UI_Options_Page::update_post() ACF UI Options Page::update post code ACF 6.8.8
public function update_post( $post ) {
if ( isset( $post['parent_slug'] ) && 'none' !== $post['parent_slug'] ) {
$ui_options_pages = $this->get_posts();
foreach ( $ui_options_pages as $options_page ) {
if ( $options_page['menu_slug'] === $post['parent_slug'] ) {
$post['_parent'] = $options_page['ID'];
break;
}
}
}
return parent::update_post( $post );
}