Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_head', function () {
- if ( ! is_singular( 'post') ) return;
- $post_id = get_queried_object_id();
- glog($post_id);
- $jnews_podcast_option = get_post_meta( $post_id, 'jnews_podcast_option', true );
- $enable = ( isset( $jnews_podcast_option['enable_podcast'] ) && '1' === $jnews_podcast_option['enable_podcast'] );
- $upload = isset( $jnews_podcast_option['upload'] ) && ! empty( $jnews_podcast_option['upload'] ) ? $jnews_podcast_option['upload'] : '';
- if ( ! ( $enable && ! empty( $upload ) ) ) return;
- if ( ! defined( 'JNEWS_PODCAST' ) ) return;
- $podcast = JNEWS_PODCAST\Player\Player::get_instance();
- remove_action( 'jnews_share_top_bar', [$podcast, 'render_player_in_post'], 99 );
- add_action( 'jnews_source_via_single_post', function () use ($post_id, $podcast) {
- $podcast->render_player_in_post($post_id);
- }, 0 );
- }, 0);
Add Comment
Please, Sign In to add comment