GochiSiyan

move to bottom

May 9th, 2022 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. add_action('wp_head', function () {
  2. if ( ! is_singular( 'post') ) return;
  3.  
  4. $post_id = get_queried_object_id();
  5. glog($post_id);
  6. $jnews_podcast_option = get_post_meta( $post_id, 'jnews_podcast_option', true );
  7. $enable = ( isset( $jnews_podcast_option['enable_podcast'] ) && '1' === $jnews_podcast_option['enable_podcast'] );
  8. $upload = isset( $jnews_podcast_option['upload'] ) && ! empty( $jnews_podcast_option['upload'] ) ? $jnews_podcast_option['upload'] : '';
  9. if ( ! ( $enable && ! empty( $upload ) ) ) return;
  10.  
  11. if ( ! defined( 'JNEWS_PODCAST' ) ) return;
  12. $podcast = JNEWS_PODCAST\Player\Player::get_instance();
  13. remove_action( 'jnews_share_top_bar', [$podcast, 'render_player_in_post'], 99 );
  14. add_action( 'jnews_source_via_single_post', function () use ($post_id, $podcast) {
  15. $podcast->render_player_in_post($post_id);
  16. }, 0 );
  17. }, 0);
Add Comment
Please, Sign In to add comment