• Resolved Pandasonic2

    (@pandasonic2)


    It’s a fantastic plugin. I need only one more feature: excluding private post. If I publish a post as private it’s send to telegram. How can this be avoided? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Manzoor Wani (a11n)

    (@manzoorwanijk)

    Many users want private posts to be sent, because they have some private membership based channels and groups. So, we made that behavior to be the default one. Now, to avoid private posts being sent to Telegram, you can add this piece of code to functions.php of your active/child theme

    /* WP Telegram - do not send private posts */
    add_filter(
    	'wptelegram_p2tg_valid_post_statuses',
    	function ( $statuses ) {
    
    		$key = array_search( 'private', $statuses['live'] );
    
    		if ( false !== $key ) {
    			unset( $statuses['live'][ $key ] );
    		}
    
    		return $statuses;
    	}
    );
    
    Thread Starter Pandasonic2

    (@pandasonic2)

    Thank you very much. It works!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude private post’ is closed to new replies.