Advertisement
phpface

Filter the embed post args and after post added

Jul 26th, 2023
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. /**
  2.  *
  3.  * Filter the post args before sending to wp_insert_post()
  4.  *
  5.  * @link https://developer.wordpress.org/reference/functions/wp_insert_post/
  6.  *
  7.  */
  8. add_filter( 'streamtube/core/embed/postarr', function( $post_args, $source, $oembed_data ){
  9.  
  10.  
  11.     return $post_args;
  12. }, 10, 3 );
  13.  
  14.  
  15. /**
  16.  *
  17.  * Fires after post added
  18.  *
  19.  * @param object WP_Post $imported_post
  20.  *
  21.  */
  22. add_action( 'streamtube/core/embed/imported', function( $imported_post, $source, $oembed_data ){
  23.  
  24.  
  25.    
  26. }, 10, 3 );
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement