Pro Version Documentation

AI Code Assistant

Estimated reading: 2 minutes 3 views

The AI Code Assistant helps you write, fix, and improve PHP, CSS, and JavaScript snippets directly inside the snippet editor. It uses your own OpenAI API key and can read your current code and apply suggested changes with one click.

Get an OpenAI API key

  • Go to platform.openai.com/api-keys and sign in.
  • Click Create new secret key.
  • Copy the key (it starts with sk-). Store it somewhere safe — you won’t see it again.

Enter the API key in Post Snippets

  • Navigate to Admin Dashboard > Post Snippets > AI Chatbot.
  • Paste your key into the OpenAI API Key field.
  • Click the Save Changes button.a

Open a snippet editor

The AI assistant only appears on snippet edit screens. Open one of these from the Post Snippets menu:

  • Add Custom Code — PHP / HTML snippets
  • Add Custom CSS — CSS snippets
  • Add Custom JS — JavaScript snippets

You can create a new snippet or edit an existing one.

Open the AI assistant

  • On the snippet edit page, look for the gold chat bubble in the bottom-right corner.
  • Click it to open the AI Code Assistant panel.
  • If your API key is set, you’ll see a welcome message. If not, you’ll get a link back to settings.

Ask questions and use your code

Type your question in the text box at the bottom and press Enter or click the send arrow.

What you can ask

GoalExample prompt
Explain codeWhat does this function do?
Fix errorsFix the syntax error in my code
Generate snippetCreate a shortcode that shows the post title
Improve CSSAdd hover effect and rounded corners
Refactor JSRefactor this to use event delegation

When your message mentions fixing, improving, or changing code, the assistant automatically reads the active editor (PHP, CSS, or JS) and includes that code in the request.

Apply or copy the response

When the AI returns code, you’ll see a formatted code block with two buttons:

  • Apply Snippet — pastes the code into the matching editor (PHP → Custom Code, CSS → CSS editor, JS → JS editor).
  • Copy Code — copies the code to your clipboard.
  • In this case, we are selecting the Apply Snippet option. This option automatically applies the code.

Leave a Reply

Your email address will not be published. Required fields are marked *

Share this Doc

AI Code Assistant

Or copy link

CONTENTS
Scroll to Top