Support » Plugin: Publish To Apple News » Custom Field Before Content

  • Resolved kevin_curry


    I’m attempting to load videos from a custom field before the content and having no luck. Here is the code I’m using:

    function add_post_meta_content($content) {
     $meta = get_post_meta( get_the_ID(), 'csco_post_embed', true );
     return .$meta.$content;
    add_filter('apple_news_exporter_content_pre', add_post_meta_content);
    apply_filters( 'apple_news_exporter_content_pre', $post->post_content, $post->ID );
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter kevin_curry


    Here’s the answer in case someone else comes looking:

    function add_post_meta_content($content, $post_id) {
        $meta = wp_oembed_get( get_post_meta( $post_id, 'csco_post_embed', true ) );
        return $meta.$content;
    add_filter('apple_news_exporter_content_pre', add_post_meta_content, 10, 2);
    Plugin Author Kevin Fodness


    Thanks for the post, @kevin_curry. I’m going to close this issue, since it seems like you’ve solved for your use case. Let us know if you encounter any additional difficulty.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Field Before Content’ is closed to new replies.