Skip to content

tainacan/tainacan-sample-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tainacan Sample Plugin

This sample plugin demonstrates how to create a page inside the Tainacan plugin admin area (requires Tainacan >= 1.0.0). It already includes a build script in case you need scss and react-like scripts with the help of wp-scripts.

Configuration

In order to give this an appropriate name, let's supose you are building a page dedicated to Digital Archive Libraries. The plugin would then be named "Tainacan Online Libraries".

  • Rename all tainacan-sample-plugin folders to tainacan-online-libraries;
  • Replace every textual occurency of -sample-plugin by -online-libraries;
  • Replace every textual occurency of Sample Plugin by Online Libraries;
  • Replace every textual occurency of Sample_Plugin by Online_Libraries;

This should be enough to get you started.

Build it!

Make the script executable:

chmod u+x build.sh

We use sass to build create our css files, so it needs to be compiled. To simply build the necessary .scss files into bundled .css:

./build.sh

To, besides that, move the necessary plugin files to your WordPress plugin directory:

./build.sh /var/www/html/wp-content/plugins/

If you don't like the script you can bundle things by yourself:

cd tainacan-sample-plugin
npm install
npm run build

But keep in mind that the script also takes care of removing some source files not necessary for the plugin to work, such as .scss and .package.json.

How to use it?

Just move all files to a folder inside WordPress plugins folder (wp-content/plugins) (which is what the script does);

Download and activate Tainacan Sample Plugin. And Tainacan, of course;

About

A plugin that demonstrates page creation inside the Tainacan Admin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published