• Resolved WP-Henne

    (@wp-henne)


    Hello!

    I am in the process of setting up a Blog->Telegram connection and am using the Excerpt plugin: https://www.ads-software.com/plugins/advanced-excerpt/

    Then when I switch to “excerpt” instead of “content” in the post to Telegram settings area, no excerpt is sent to Telegram.

    The mentioned plugin not only removes shortcodes, but it can also exclude embedded media etc. from the excerpt (so that e.g. no media links are sent to Telegram).

    For all other things on the website, the excerpt plugin works as expected. I suspect it is due to the order of hooks or similar that it is not working with the plugin.

    I’ll be happy to provide more details!
    Thanks a lot!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter WP-Henne

    (@wp-henne)

    This is from FAQ of “Advanced Excerpt Plugin”:

    “This plugin fetches the post from The Loop and there is currently no way to pass a post ID or any custom input to it.”

    OK so far. And now i’d like to ask you to implement anything like cut tags from excerpt in WP Telegram Plugin?

    Linke at option page “Advanced Excerpt Plugin”:

    https://ibb.co/MpKcYdn
    https://ibb.co/7Ns6j4x

    to prevent something like this from occurring: https://ibb.co/MDbJ0sG

    So a link to an element not embedded via shortcode comes into the post.

    Many thanks for any advice!

    Plugin Author Irshad Ahmad

    (@irshadahmad21)

    Have you updated the Excerpt Source option in Post to Telegram settings?

    Thread Starter WP-Henne

    (@wp-henne)

    Thank You @irshadahmad21

    With this settings:

    https://ibb.co/5vKRSTx
    https://ibb.co/GcRfx4p

    i get only the pix, the Post-Title and the ACF-Result, but no excerpt in Telegram:

    https://ibb.co/Hzj9SM8

    Plugin Author Irshad Ahmad

    (@irshadahmad21)

    You can enable the_content filter in that plugin and then use {post_content} instead.

    Thread Starter WP-Henne

    (@wp-henne)

    Yes, thank You. I know this and even if i use the excerpt-setting in WP Telegram, this works.

    But i like to use an automatic solution to cut unnecessary elements while posting to Telegram.

    Any other hint?

    Thank You again!

    Plugin Author Irshad Ahmad

    (@irshadahmad21)

    Set the Excerpt Source?option to Post Excerpt in?Post to Telegram settings and try this code

    function custom_excerpt_for_wptelegram( $excerpt, $post_id ) {
    	// use the excerpt which "Advanced Excerpt" plugin hooks into
    	return get_the_excerpt( $post_id );
    }
    add_action( 'wptelegram_p2tg_before_process', function () {
    	add_filter( 'post_excerpt', 'custom_excerpt_for_wptelegram', 10, 2 );
    } );
    add_action( 'wptelegram_p2tg_after_process', function () {
    	remove_filter( 'post_excerpt', 'custom_excerpt_for_wptelegram', 10, 2 );
    } );

    If that doesn’t work, try this

    /* WP Telegram | Use custom excerpt */
    add_filter( 'wptelegram_p2tg_post_data_post_excerpt_value', function ( $excerpt, $post ) {
    	// use the excerpt which "Advanced Excerpt" plugin hooks into
    	return get_the_excerpt( $post );
    }, 10, 2 );
    Thread Starter WP-Henne

    (@wp-henne)

    @irshadahmad21

    Thank you very much, this takes me a small step further, but it’s also weird now!

    Depending on the setting, I now actually have no unwanted items written to Telegram, but instead the text snippet to Telegram is now much shorter and I don’t see why.

    I need some time to describe this in more detail and will then send you screen shots.

    This is just an interim message that I am trying. And many thanks to you! Happy New Year ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘With an activated Excerpt plugin, no Excerpt is posted to Telegram’ is closed to new replies.