PluginProbe
Post Grid Gutenberg Blocks – PostX / 5.0.41
Post Grid Gutenberg Blocks – PostX v5.0.41
5.0.41 5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 All 238 releases
ultimate-post / addons / chatgpt / init.php

init.php in Post Grid Gutenberg Blocks – PostX 5.0.41, at addons/chatgpt/init.php

56 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined( 'ABSPATH' ) || exit;
3
4 add_action( 'init', 'ultp_chatgpt_init' );
5 function ultp_chatgpt_init() {
6 if ( ultimate_post()->get_setting( 'ultp_chatgpt' ) == 'true' ) {
7 add_filter( 'ultp_settings', 'get_chatgpt_settings', 10, 1 );
8 }
9 }
10
11 function get_chatgpt_settings( $config ) {
12 $arr = array(
13 'ultp_chatgpt' => array(
14 'label' => __( 'ChatGPT', 'ultimate-post' ),
15 'attr' => array(
16 'chatgpt_heading' => array(
17 'type' => 'heading',
18 'label' => __( 'ChatGPT Settings', 'ultimate-post' ),
19 ),
20 'chatgpt_secret_key' => array(
21 'type' => 'text',
22 'label' => __( 'OpenAI API Secret Key', 'ultimate-post' ),
23 'desc' => __( 'For using ChatGPT addon, you have to add your OpenAI secret key.', 'ultimate-post' ),
24 'link' => __( 'https://platform.openai.com/account/api-keys' ),
25 'linkText' => __( 'Get key.', 'ultimate-post' ),
26 ),
27 'chatgpt_model' => array(
28 'type' => 'select',
29 'label' => __( 'OpenAI Model', 'ultimate-post' ),
30 'desc' => __( 'Choose your preferable OpenAI model', 'ultimate-post' ),
31 'options' => array(
32 'gpt-3.5-turbo' => 'gpt-3.5-turbo',
33 'text-davinci-002' => 'text-davinci-002',
34 'text-davinci-003' => 'text-davinci-003',
35 'gpt-4' => 'gpt-4',
36 ),
37 'default' => 'gpt-3.5-turbo',
38 ),
39 'chatgpt_response_time' => array(
40 'type' => 'number',
41 'label' => __( 'Response Time', 'ultimate-post' ),
42 'desc' => __( 'Choose your preferable OpenAI response time', 'ultimate-post' ),
43 'default' => 60,
44 ),
45 'chatgpt_max_tokens' => array(
46 'type' => 'number',
47 'label' => __( 'Max Tokens', 'ultimate-post' ),
48 'desc' => __( 'Choose your preferable OpenAI max Number of Tokens to be generated by ChatGPT', 'ultimate-post' ),
49 'default' => 400,
50 ),
51 ),
52 ),
53 );
54 return array_merge( $config, $arr );
55 }
56