Skip to content

NoahY/q2a-shortcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Question2Answer Shortcode

Description

This is a plugin for Question2Answer that allows shortcode replacement in posts.

Features

  • replace any text with any other text
  • option to replace within HTML tags or exclude them from replace
  • regular expression matching (see Regular Expressions below)

Installation

  1. Install Question2Answer
  2. Get the source code for this plugin from github, either using git, or downloading directly:
    • To download using git, install git and then type git clone git://github.com/NoahY/q2a-shortcode.git shortcode at the command prompt (on Linux, Windows is a bit different)
    • To download directly, go to the project page and click Download
  3. navigate to your site, go to Admin -> Plugins on your q2a install and select the 'Enable shortcode' option, enter in some shortcode, then 'Save'.

Regular Expressions

Regular expressions allow to replace patterns with specific text that may be based on the search pattern. For example, putting:

/[mycode]([^]]+)[/mycode]/

in the search box and:

Hello, $1!

in the replace box, would replace [mycode]User[/mycode] with Hello, User!.

For more info on regular expressions, google it.

Disclaimer

This is beta code. It is probably okay for production environments, but may not work exactly as expected. Refunds will not be given. If it breaks, you get to keep both parts.

Release

All code herein is Copylefted.

About Q2A

Question2Answer is a free and open source platform for Q&A sites. For more information, visit:

http://www.question2answer.org/

About

Allows shortcode replacement in posts for Question2Answer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages