Возможно ли, что файл в каталоге плагина используется в качестве настраиваемого шаблона страницы?
Также, как вы создаете плагин для создания страницы?
Я разрабатываю плагин для клиента на основе темы, он хочет, чтобы этот плагин создавал страницы продаж, имея возможность использовать свою тему на главной странице. Это продукт, который я делаю для него на рынок, поэтому его нужно автоматизировать через плагин.
Возможно ли это?
ИЗМЕНИТЬ
У меня есть крючки активации/деактивации в основном файле плагинов, и он не работает. Здесь код:
$filename = __FILE__;
register_activation_hook($filename, 'superActivation');
register_deactivation_hook($filename, 'superDeactivation');
global $myFile; global $fh; global $stringData; global $filename;
$myFile = "testFile.txt";
$stringData = "Testing\n";
$fh = fopen($myFile, 'w') or die("can't open file");
function superActivation() {
global $myFile; global $fh; global $stringData; global $filename;
fwrite($fh, $stringData);
fclose($fh);
}
function superDeactivation() {
$myFile = "testFile.txt";
unlink($myFile);
}