$value ) { $options[] = [ 'label' => $value, 'value' => $key, ]; } return $options; } wp_localize_script( 'aiify-aiify-editor-script', 'aiify', [ 'prompts' => AIIFY_WRITER_PROMPTS, 'edits' => array_keys( AIIFY_EDIT_PROMPTS ), 'after' => array_keys( AIIFY_GENERATE_AFTER_PROMPTS ), 'before' => array_keys( AIIFY_GENERATE_BEFORE_PROMPTS ), 'styles' => array_to_options( AIIFY_STYLES ), 'style' => AIIFY_WRITING_STYLE, 'tones' => array_to_options( AIIFY_TONES ), 'tone' => AIIFY_WRITING_TONE, 'maxWords' => AIIFY_WRITING_MAX_WORDS, 'nonce' => wp_create_nonce( "secure-nonce" ), 'currentPlan' => aii_fs()->get_plan_name(), 'paragraphPrompt' => AIIFY_PARAGRAPH_BLOCK_PROMPT, ] ); add_filter( 'write_your_story', function () { return AIIFY_PARAGRAPH_BLOCK_PROMPT; }, 100, 0 ); } } if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) { require AIIFY_INCLUDES . 'settings.php'; //allow only on admin ( or ajax ) add_action( 'admin_init', __NAMESPACE__ . '\\register_aiify_block' ); }