gonmial
Forum Replies Created
-
If someone interested in this, I solve this problem with this code:
use FluentSupport\App\Modules\PermissionManager; function CreateNewAgentInFluentSupport($email){ $data = array(); $data['email'] = $email; $user = get_user_by('email', $data['email']); $data['user_id'] = $user->ID; if (empty($data['first_name'])) { $data['first_name'] = $user->first_name; } if (empty($data['last_name'])) { $data['last_name'] = $user->last_name; } $permissions = array('fst_manage_own_tickets'); try { $agentsApi = FluentSupportApi('agents'); $newAgent = $agentsApi->createAgentWithOrWithoutWpUser($data); if (!$newAgent==false) { PermissionManager::attachPermissions($user, $permissions); } else { return 'User not created'; } } catch (Throwable $e) { return 'Get error: '.$e->getMessage(); } }Thanks
ok, thank you
Thank you. That’s all need.
Forum: Plugins
In reply to: [WP Telegram (Auto Post and Notifications)] change channelThank 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 );Forum: Plugins
In reply to: [Conditional Menus] menu disappearI solve this problem. Thank you.
Forum: Plugins
In reply to: [RSS for Yandex Turbo] Ошибка валидацииок, спасибо
Forum: Plugins
In reply to: [RSS for Yandex Turbo] Ошибка валидацииОграничил rss до одного поста. Убрал вообще все мыслимые и немыслимыет теги. Все равно не пашет.