本文整理汇总了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];
}