本文整理汇总了PHP中PBHelper::getPOSTOption方法的典型用法代码示例。如果您正苦于以下问题:PHP PBHelper::getPOSTOption方法的具体用法?PHP PBHelper::getPOSTOption怎么用?PHP PBHelper::getPOSTOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PBHelper
的用法示例。
在下文中一共展示了PBHelper::getPOSTOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminSaveMetaBox
function adminSaveMetaBox($postId)
{
if ($_POST) {
if (PBHelper::checkSavePost($postId, PLUGIN_PAGE_BUILDER_CONTEXT . '_team_noncename', 'adminSaveMetaBox') === false) {
return false;
}
$option = PBHelper::getPOSTOption('team');
$Validation = new PBValidation();
/***/
PBHelper::removeUIndex($option, 'team_skill_name', 'team_skill_level', 'team_skill_order');
$skill = array('team_skill_name' => $option['team_skill_name'], 'team_skill_level' => $option['team_skill_level'], 'team_skill_order' => $option['team_skill_order']);
unset($option['team_skill_name'], $option['team_skill_level'], $option['team_skill_order']);
foreach ($skill['team_skill_name'] as $index => $value) {
if ($Validation->isEmpty($value)) {
continue;
}
if (!array_key_exists($index, $skill['team_skill_level'])) {
continue;
}
if (!$Validation->isNumber($skill['team_skill_level'][$index], 1, 100)) {
continue;
}
$option['team_skill'][] = array('team_skill_name' => $value, 'team_skill_level' => $skill['team_skill_level'][$index], 'team_skill_order' => array_key_exists($index, $skill['team_skill_order']) ? $skill['team_skill_order'][$index] : 0);
}
/***/
PBHelper::removeUIndex($option, 'team_social_name', 'team_social_url', 'team_social_order');
$social = array('team_social_name' => $option['team_social_name'], 'team_social_url' => $option['team_social_url'], 'team_social_order' => $option['team_social_order']);
unset($option['team_social_name'], $option['team_social_url'], $option['team_social_order']);
foreach ($social['team_social_name'] as $index => $value) {
if (!array_key_exists($value, $this->social)) {
continue;
}
if (!array_key_exists($index, $social['team_social_url'])) {
continue;
}
if (!$Validation->isURL($social['team_social_url'][$index])) {
continue;
}
$option['team_social'][] = array('team_social_name' => $value, 'team_social_url' => $social['team_social_url'][$index], 'team_social_order' => array_key_exists($index, $social['team_social_order']) ? $social['team_social_order'][$index] : 0);
}
PBMeta::update($postId, $option);
}
}