-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig-shortcode.php
More file actions
49 lines (49 loc) · 3.08 KB
/
config-shortcode.php
File metadata and controls
49 lines (49 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Shortcode Configuration
*
* $config['shortcode']['id'] => $options (array)(Required) An array containining the shortcode options. $options explain below.
* Id must be unique within your namespace.
*
* Ex: $config['shortcode']['sc1'] => $sc1_options;
* $config['shortcode']['sc2'] => $sc2_options;
*
* array $options :
*
* 'uses' => (string)(Required) The shortcode class to use. The class must extends atkwp\components\ShortcodeComponent class.
* Ex: 'uses' => __NAMESPACE__ . '\shortcodes\EventShortcode'
*
* 'name' => (string)(Required) A sting holding the name of your shortcode. This is the name a Wp user will need to enter in a post or page in order to display the shortcode in front end.
* Ex: I have create a shortcode using the name 'my-plugin-sc', then in order to display the shortcode in a post or page
* I will use this shortcode syntax: [my-plugin-sc].
*
* 'atk' => (bool)(Optional) A boolean value to indicate whether you want your shortcode class to use atk js and css file. When set to true, it will load atk js and css file.
* False is the default.
* Ex: If you use an atk form using ajax submit in your shortcode display, this value need to be true.
*
* 'js' => (array)(Optional) An array of javascript file path (without the extension) to load with this shortcode.
* File path value is relative to your plugin assets/js directory.
* Ex: test.js file is located under assets/js/vendor/test.js then the path value should be 'vendor/test'
*
* 'js-inc' => (array)(Optional) An array of already registered WordPress javascript files to load with the shortcode.
*
* 'css' => (array)(Optional) An array of css file path (without the extension) to load with this shortcode.
* File path value is relative to your plugin assets/css directory.
* Ex: test.css file is located under assets/css/test.css then the path value should be 'test'
*
* Note: Any attribute name = value pair added to the shortcode code will be passed as args array in your shortcode class.
*
* Ex: When using this code to display a shortcode: [my-plugin-sc option1='value' option2='value' ]
* option1 and option2 value are accessible using $this->args['option1'] or $this->args['option2'] in your shortcode class.
*
*========================================================================================================================*/
/*
* Example:
*
* $config['shortcode']['event-registration'] = ['name' => 'atksample-register-form',
* 'uses' => __NAMESPACE__.'\shortcodes\EventRegistrationFormShortcode',
* 'atk' => true,
* 'js' => [],
* 'css' => [],
* ];
*/