• Resolved ashtee

    (@ictinus)


    We’ve replaced our WordPress Authors with ACF fields, is there a filter hook to pass those values to the authors or another way to pass that data?

Viewing 1 replies (of 1 total)
  • Not sure if this helps but we needed to use a custom field

    add_filter('apple_news_exporter_byline', 'custom_author', 10, 2);
    
    function custom_author($byline, $post_id) {
    	   global $post;
           $post = get_post($post_id);
    	   $date_format = 'M j, Y';
    	   $guestAuthor = get_post_meta($post->ID, 'guest_author', true);
           if ($guestAuthor) {
    		   		
    				$byline = sprintf(
    				'by %1$s | %2$s',
    				$guestAuthor,
    				date( $date_format, strtotime( $post->post_date ) )
    	   			);
                  
           } else {
                 $byline = 'no author'.$post->ID;
           }
    	   return $byline;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Filter Hook for Authors?’ is closed to new replies.