Hallo,
ich rufe mein Plugin durch z.B. [lop3 h="1354642035"] auf. Das funktioniert.
Habe ich aber nun zwei Artikel mit unterschiedlich konfigurierte Plugins auf einer Seite untereinanderstehen (also in einem Artikel [lop3 h="1354642035"] und im anderen [lop3 h="1354644711"]) dann stellen sich beide Plugins gleich dar.
Rufe ich die Artikel einzeln auf, klappt es wieder.
Schuld daran ist folgendes
PHP
if($_POST['send_new_participant']){
require_once(LOP3_PATH . "new_participant_check.php");
}
if ($atts['h']){
update_option('entry_var',$atts['h']);
require_once(LOP3_PATH . "select_wp_lop3_head.php");
require_once(LOP3_PATH . "select_wp_lop3_config.php");
}
require_once(LOP3_PATH . "new_participant_module.php");
require_once(LOP3_PATH . "function.php");
Alles anzeigen
Ändere ich die Art der Einbindung auf require(... dann klappt das nur bedingt.
PHP
if($_POST['send_new_participant']){
if ($atts['h']){
update_option('entry_var',$atts['h']);
require(LOP3_PATH . "select_wp_lop3_head.php");
require(LOP3_PATH . "select_wp_lop3_config.php");
}
require_once(LOP3_PATH . "new_participant_module.php");
require_once(LOP3_PATH . "function.php");
Alles anzeigen
Das stellt zumindest einen Teil korrekt dar.
PHP
if($_POST['send_new_participant']){
if ($atts['h']){
update_option('entry_var',$atts['h']);
require(LOP3_PATH . "select_wp_lop3_head.php");
require(LOP3_PATH . "select_wp_lop3_config.php");
}
require(LOP3_PATH . "new_participant_module.php");
require(LOP3_PATH . "function.php");
Alles anzeigen
Dann sollte das die Lösung sein, führt aber zu einem "Fatal error: Cannot redeclare".
Kann man eingebundene Seite am ende eines Plugins wieder "rauswerfen"?
Include hat auch nicht geholfen.