Astra_Starter_Content::register_listener( int $post_ID, WP_Post $post, bool $update )
Register listener to insert post.
Description
Parameters
- $post_ID
-
(int) (Required) Post Id.
- $post
-
(WP_Post) (Required) Post object.
- $update
-
(bool) (Required) Is update.
Source
File: inc/compatibility/class-astra-starter-content.php
public function register_listener( $post_ID, $post, $update ) {
if ( $update ) {
return;
}
$custom_draft_post_name = get_post_meta( $post_ID, '_customize_draft_post_name', true );
$is_from_starter_content = ! empty( $custom_draft_post_name );
if ( ! $is_from_starter_content ) {
return;
}
if ( 'page' === $post->post_type ) {
update_post_meta( $post_ID, 'site-content-layout', 'plain-container' );
update_post_meta( $post_ID, 'theme-transparent-header-meta', 'enabled' );
update_post_meta( $post_ID, 'site-sidebar-layout', 'no-sidebar' );
update_post_meta( $post_ID, 'site-post-title', 'disabled' );
}
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |