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
.
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 totainacan-online-libraries
; - Replace every textual occurency of
-sample-plugin
by-online-libraries
; - Replace every textual occurency of
Sample Plugin
byOnline Libraries
; - Replace every textual occurency of
Sample_Plugin
byOnline_Libraries
;
This should be enough to get you started.
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
.
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;