• Resolved avrant

    (@avrant)


    This is a GREAT plugin—thanks so much!

    One thing that is a consistent problem for me is when I go back and update older articles (perhaps for SEO optimization, etc). I don’t want these articles being resubmitted to Apple News—but I DO want my freshly published articles to get submitted automatically.

    While I love the “Automatically publish to Apple News” option, is there any chance you can add a way to disable sending it to Apple News when you simply Update an existing article (as opposed to hitting the “Publish” button for the first time)?

    An option labeled “Do not submit on article Updates” is what’s being asked for here. I had through that’s what setting ‘No’ on “Automatically update Apple News” meant, but alas, it still publishes on update.

    This would be an immensely helpful feature!

    My site is http://www.protoolreviews.com

    https://wordpress.org/plugins/publish-to-apple-news/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    There is a setting labeled “Automatically update Apple News” which prevents posts from being updated once they’re already in Apple News. However, what you’ve identified here is old posts being saved and published since they’ve never been in Apple News.

    The latest version of the plugin sets the date metadata for the post in Apple News which the app will soon use to sort content chronologically. This lessen the impact of old content being published.

    However, if you want to stop old content from being published altogether, you will need to use one of the available filter hooks and a little bit of code to do so. Here’s an example (please test this before pushing to your site!):

    public function skip_push( $skip, $post_id ) {
    	// Check if the post has been previously updated.
    	// If so, we don't need to check this.
    	// A deleted post will not return an ID,
    	// but that will short circuit later within the plugin.
    	$apple_news_id = get_post_meta( $post_id, 'apple_news_api_id', true );
    	if ( ! empty( $apple_news_id ) ) {
    		return $skip;
    	}
    
    	// Get the post
    	$post = get_post( $post_id );
    
    	// Compare the publish date to the current date.
    	// If more than 24 hours, then don't publish.
    	if ( ( time() - strtotime( $post->post_date ) ) > DAY_IN_SECONDS ) {
    
    		// Remove the pending designation if it exists
    		delete_post_meta( $post_id, 'apple_news_api_pending' );
    
    		// Remove the async in progress flag
    		delete_post_meta( $post_id, 'apple_news_api_async_in_progress' );
    
    		// Clear the cache for post status
    		delete_transient( 'apple_news_post_state_' . $post_id );
    
    		// Show an error message
    		Admin_Apple_Notice::error( __( 'This post is more than 24 hours old and cannot be published to Apple News.', 'your-textdomain' ) );
    
    		// Skip publishing
    		$skip = true;
    	}
    
    	return $skip;
    }
    add_filter( 'apple_news_skip_push', 'skip_push', 10, 2 );

    Auto-publish is not working for me after update to 1.0.8

    I can manually push any article or group of articles to apple news.

    All articles show as:
    Study: Warming giving US type of weather we prefer (id:760364)
    Options | Download | Publish
    Never N/A Not published

    Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    We’ll look into that.

    My problem is with scheduled posts, it is not the auto publish:
    https://wordpress.org/support/topic/schedule-articles-not-publishing-to-apple-news?replies=2

    Sorry, i should have posted there

    Plugin Author Bradford Campeau-Laurion

    (@potatomaster)

    The issue with scheduled posts was resolved in version 1.1.6

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable (or provide option) for Auto-publish on Article Update?’ is closed to new replies.