Basic archtecture
Basic shortcode feature for PowerQA is same as WordPress.
Register shortcode
In PowerQA, you can register any shortcode functions to the core on your plugin.
if(function_exists('qa_add_shortcode')) {
qa_add_shortcode('users', 'qa_app_sc_users');
qa_add_shortcode('threads', 'qa_app_sc_threads');
qa_add_shortcode('sidebar', 'qa_app_sc_sidebar');
qa_add_shortcode('widget', 'qa_app_sc_widget');
qa_add_shortcode('loginform', 'qa_app_sc_loginform');
qa_add_shortcode('flexslider', 'qa_app_sc_flexslider');
qa_add_shortcode('youtube', 'qa_app_sc_youtube');
qa_add_shortcode('pdf', 'qa_app_sc_pdf');
qa_add_shortcode('map', 'qa_app_sc_map');
qa_add_shortcode('emap', 'qa_app_sc_emap');
qa_add_shortcode('video', 'qa_app_sc_video'); <<== 2016/12/22 added
qa_add_shortcode('audio', 'qa_app_sc_audio'); <<== 2016/12/22 added
qa_add_shortcode('feed', 'qa_app_sc_feed'); <<== 2017/05/19 added
}
qa_add_shortcode('np_notices', 'qa_np_sc_notices'); <<== 2016/10/20 added
- Function parameter1: shortcode name
- Function parameter2: shortcode function name
Places where you can use shortcodes
- Custom pages
- "Admin" > "Layout" > "Home page content - HTML allowed:"
- "Admin" > "PVS (Private Site) plugin > "Contents"
- "Admin" > "Widget Maker"
- "Admin" > "Dashboard"
- Posts (Question/Answer/Comment) <= By default, only administrators are allowed (You can change permission on "Admin" > "Permissions").
Examples