Created
October 10, 2022 14:46
-
-
Save albionselimaj/ea69ed26162fffb5b307490395db0075 to your computer and use it in GitHub Desktop.
Index post on publish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'wp_insert_post', function( $post_id ) { | |
$post = \Voxel\Post::get( $post_id ); | |
if ( $post && $post->is_managed_by_voxel() && $post->get_status() === 'publish' ) { | |
$post->index(); | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment