本文整理匯總了PHP中PodsForm::field_group方法的典型用法代碼示例。如果您正苦於以下問題:PHP PodsForm::field_group方法的具體用法?PHP PodsForm::field_group怎麽用?PHP PodsForm::field_group使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PodsForm
的用法示例。
在下文中一共展示了PodsForm::field_group方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: field_loader
/**
* Autoload a Field Type's class
*
* @param string $field_type Field Type indentifier
* @param string $file The Field Type class file location
*
* @return string
* @access public
* @static
* @since 2.0
*/
public static function field_loader($field_type, $file = '')
{
if (isset(self::$loaded[$field_type])) {
$class_vars = get_class_vars(get_class(self::$loaded[$field_type]));
// PHP 5.2.x workaround
self::$field_group = isset($class_vars['group']) ? $class_vars['group'] : '';
self::$field_type = $class_vars['type'];
if ('Unknown' != $class_vars['label']) {
return self::$loaded[$field_type];
}
}
include_once PODS_DIR . 'classes/PodsField.php';
$field_type = self::clean($field_type, true, true);
$class_name = ucfirst($field_type);
$class_name = "PodsField_{$class_name}";
$content_dir = realpath(WP_CONTENT_DIR);
$plugins_dir = realpath(WP_PLUGIN_DIR);
$muplugins_dir = realpath(WPMU_PLUGIN_DIR);
$abspath_dir = realpath(ABSPATH);
if (!class_exists($class_name)) {
if (isset(self::$field_types[$field_type]) && !empty(self::$field_types[$field_type]['file'])) {
$file = realpath(self::$field_types[$field_type]['file']);
}
if (!empty($file) && 0 === strpos($file, $abspath_dir) && file_exists($file)) {
include_once $file;
} else {
$file = str_replace('../', '', apply_filters('pods_form_field_include', PODS_DIR . 'classes/fields/' . basename($field_type) . '.php', $field_type));
$file = realpath($file);
if (file_exists($file) && (0 === strpos($file, $content_dir) || 0 === strpos($file, $plugins_dir) || 0 === strpos($file, $muplugins_dir) || 0 === strpos($file, $abspath_dir))) {
include_once $file;
}
}
}
if (class_exists($class_name)) {
$class = new $class_name();
} else {
$class = new PodsField();
$class_name = 'PodsField';
}
$class_vars = get_class_vars($class_name);
// PHP 5.2.x workaround
self::$field_group = isset($class_vars['group']) ? $class_vars['group'] : '';
self::$field_type = $class_vars['type'];
self::$loaded[$field_type] =& $class;
return self::$loaded[$field_type];
}