• Resolved gonmial

    (@gonmial)


    Hello. I want to change the channel in which the publication occurs, depending on the category of the post. Maybe you can tell in which plug-in module I can change the name of the channel.

Viewing 2 replies - 1 through 2 (of 2 total)
  • That’s not possible yet, coming soon…

    Thread Starter gonmial

    (@gonmial)

    Thank you.

    I solved this problem by inserting this code in send_responses() function in modules/p2tg/class-wptelegram-p2tg-post-sender.php

    $categories = get_the_category( self::$post->ID );
    $cat_array = [];
    $k=0;
    foreach ($categories as $cat) {

    $cat_array[$k] = ‘@’.$cat->category_nicename;
    $k++;

    }

    $channels = $cat_array;
    //$channels = explode( ‘,’, $this->options->get( ‘channels’, ” ) );
    //$channels = (array) apply_filters( ‘wptelegram_p2tg_send_to_channels’, $channels, $this->responses, self::$post, $this->options, $this->bot_api );

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘change channel’ is closed to new replies.