getOption('ReactModule-active') !== '1') { return; } add_shortcode( 'fasoon-form', [$this, 'add_shortcode'] ); } public function add_shortcode(){ $baseDir = FASOON_PLUGIN_DIR."/react-modules/mutation-form/static"; $baseURL = FASOON_PLUGIN_URL."/react-modules/mutation-form/static"; $jsFiles = array(); foreach (glob($baseDir."/js/*.js") as $file) { $fileParts = explode('/',$file); $jsFiles[] = $fileParts[count($fileParts)-1]; } $cssFiles = array(); foreach (glob($baseDir."/css/*.css") as $file) { $fileParts = explode('/',$file); $cssFiles[] = $fileParts[count($fileParts)-1]; } $code = ' '; foreach($cssFiles as $file){ $code .= ""; } $code .= '
'; foreach(array_reverse($jsFiles) as $file){ $code .= ""; } return $code; } public function getModuleName(): string { return 'ReactModule'; } public function getOptions(): array { return [ new \Vietswiss\Option('active', $this->getModuleName(), 'ReactModule-active', 'boolean', '1'), ]; } }