Skip links
🔧
Need help with installation?
Send an email to [email protected] to get a quote.

Shortcodes

Table of Contents

A WordPress shortcode is a brief and specific code snippet used in WordPress to perform a particular function. MagicAI is supporting the shortcodes.

Currently defined shortcodes:

Text / Post Generators

You can use text and post generators on your website frontend with this shortcode: [magicai-generator]

Allowed Attributes:

  • type
    • custom
    • code
    • product
    • post
    • post_youtube_video
    • post_rss
  • model
    • any OpenAI model. Example: gpt-3-5.turbo
  • max_tokens
    • 1 – 16000 (default 800)
  • temperature
    • 0 – 1 (default 0.75)
  • frequency_penalty
    • 0 – 1 (default 0)
  • presence_penalty
    • 0 – 1 (default 0.6)
  • api_key
    • Custom API key for this shortcode. It’s not required! Maybe helps to manage OpenAI Keys billing.
  • is_user_logged_in
    • true/false – if true, non-logged in users will not be able to see the content of this shortcode.

Examples

Custom Generator

Allowed Attributes: type is_user_logged_in

Example usage:

[magicai-generator type="custom" is_user_logged_in="false"]

Code Generator

Allowed Attributes: type model max_tokens temperature frequency_penalty presence_penalty api_key is_user_logged_in

Example usage:

[magicai-generator type="code" model="gpt-3.5-turbo-instruct" max_tokens="100" temperature="1" frequency_penalty="0" presence_penalty="0.6" api_key="sk-your-key" is_user_logged_in="true"]

Product Generator

Allowed Attributes: type model max_tokens temperature frequency_penalty presence_penalty api_key is_user_logged_in

Example usage:

[magicai-generator type="product" model="gpt-3.5-turbo-instruct" max_tokens="100" temperature="1" frequency_penalty="0" presence_penalty="0.6" api_key="sk-your-key" is_user_logged_in="true"]

Post Generator

Allowed Attributes: type model max_tokens temperature frequency_penalty presence_penalty api_key is_user_logged_in

Example usage:

[magicai-generator type="post" model="gpt-4" max_tokens="100" temperature="1" frequency_penalty="0" presence_penalty="0.6" api_key="sk-your-key" is_user_logged_in="true"]

Youtube Video to Post Generator

Allowed Attributes: type model max_tokens temperature frequency_penalty presence_penalty api_key is_user_logged_in

Example usage:

[magicai-generator type="post_youtube" model="gpt-3.5-16k" max_tokens="8000" temperature="1" frequency_penalty="0" presence_penalty="0.6" api_key="sk-your-key" is_user_logged_in="true"]

RSS to Post Generator

Allowed Attributes: type model max_tokens temperature frequency_penalty presence_penalty api_key is_user_logged_in

Example usage:

[magicai-generator type="post_rss" model="gpt-3.5-turbo" max_tokens="100" temperature="1" frequency_penalty="0" presence_penalty="0.6" api_key="sk-your-key" is_user_logged_in="true"]

Image Generator

You can use image generator on your website frontend with this shortcode: [magicai-image-generator]

Allowed Attributes:

  • hide
    Hide DALL-E / SD selectors tab.
    • dalle
    • sd
  • dalle_api_key
    • Custom API key for this shortcode. It’s not required! Maybe helps to manage OpenAI Keys billing.
  • dalle_n
    • 1 – 10 (number of results) – default: 1
  • dalle_size
    • 256×256
    • 512×512
    • 1024×1024
  • sd_api_key
    • Custom API key for this shortcode. It’s not required! Maybe helps to manage StableDiffusion Keys billing.
  • sd_model
    • stable-diffusion-v1.5
    • stable-diffusion-512-v2-1
    • stable-diffusion-xl-beta-v2-2-2
    • stable-diffusion-xl-1024-v0-9
    • stable-diffusion-xl-1024-v1-0
  • sd_n
    • 1-10 (number of results)  – default: 1
  • sd_size
    • 256
    • 512
    • 1024
  • user_filter
    Filter image results for any user or all user.
    • true (detect current user)
    • false (display all images)
    • intager (user_id)
  • is_user_logged_in
    • true/false – if true, non-logged in users will not be able to see the content of this shortcode.

Examples

Basic:
[magicai-image-generator]
Hide SD
[magicai-image-generator hide="sd"]
Hide SD + Custom options
[magicai-image-generator hide="sd" size="1024" sd_api_key="your-key"]
Both Generator and User Filter (USER_ID) – (Show only user_id 45’s images)
[magicai-image-generator user_filter="45"]
You can create more combination with attributes.

Chat

You can use chat with ai feature on your website frontend with this shortcode: [magicai-chat]

Allowed Attributes:

  • user_filter
    Filter chat histor for any user or all user.
    • true (detect current user)
    • false (display all images)
    • intager (user_id)
  • is_user_logged_in
    • true/false – if true, non-logged in users will not be able to see the content of this shortcode.

Examples

Basic:
[magicai-chat]
Show All Chats:
[magicai-chat user_filter="false"]
Show Custom User Chats:
[magicai-chat user_filter="3"]
Allow Chat for Public (can also be accessed by users who are not logged in):
[magicai-chat is_user_logged_in="false"]

Logs

You can activity feature on your website frontend with this shortcode: [magicai-logs]

Allowed Attributes:

  • user_filter
    Filter chat histor for any user or all user.
    • true (detect current user)
    • false (display all images)
    • intager (user_id)
  • count
    Define how many log records to show (default: 5)
    • intager

Examples

Basic:
[magicai-logs]
Show All user’s logs:
[magicai-logs user_filter="false"]
Show current user’s last 20 logs:
[magicai-logs count="20"]

Documents

You can show saved documents on your website frontend with this shortcode: [magicai-documents]

Allowed Attributes:

  • user_filter
    Filter chat histor for any user or all user.
    • true (detect current user)
    • false (display all images)
    • intager (user_id)

Examples

Basic:

[magicai-documents]

Show All user’s documents:

[magicai-documents user_filter="false"]

Show specific user’s documents:

[magicai-documents user_filter="20"]

On this page