これは誰もがこの問題を解決する方法を知っている機能コード
function sgOnloadPopup()
{
$page = get_queried_object_id();
$popup = "sg_promotional_popup";
/* If popup is set on page load */
$popupId = SGPopup::getPagePopupId($page, $popup);
/* get all popups id which set in current page by class */
$popupsIdByClass = getPopupIdInPageByClass($page);
if(POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE){
delete_option("SG_MULTIPLE_POPUP");
/* Retrun all popups id width selected On All Pages */
$popupsId = SgPopupPro::allowPopupInAllPages($page);
$data = get_option("SG_ALL_POSTS");
if(!empty($data) && is_array($data) && !(is_page() || is_home() || is_front_page())) {
/*if(!empty(get_option("SG_ALL_POSTS")) && is_array(get_option("SG_ALL_POSTS")) && !(is_page() || is_home() || is_front_page())) {*/
/* Add to popups Queue */
$popupsId = array_merge(get_option("SG_ALL_POSTS"), $popupsId);
}
if(!empty(get_option("SG_ALL_PAGES")) && is_array(get_option("SG_ALL_PAGES")) && (is_page() || is_home() || is_front_page())) {
/* Add to popups Queue */
$popupsId = array_merge(get_option("SG_ALL_PAGES"), $popupsId);
}
/* $popupsId[0] its last selected popup id */
if(isset($popupsId[0])) {
delete_option("SG_MULTIPLE_POPUP");
if(count($popupsId) > 0) {
update_option("SG_MULTIPLE_POPUP",$popupsId);
}
foreach ($popupsId as $queuePupupId) {
showPopupInPage($queuePupupId);
}
$popupsId = json_encode($popupsId);
}
else {
$popupsId = json_encode(array());
}
echo '<script type="text/javascript">
SG_POPUPS_QUEUE = '.$popupsId.'</script>';
}
//If popup is set for all pages
if($popupId != 0) {
showPopupInPage($popupId);
}
if(!empty($popupsIdByClass)) {
foreach ($popupsIdByClass as $popupId) {
sgRenderPopupScript($popupId);
}
}
return false;
}
のですか? – Teapetetose