本文整理汇总了PHP中PodsForm::comment方法的典型用法代码示例。如果您正苦于以下问题:PHP PodsForm::comment方法的具体用法?PHP PodsForm::comment怎么用?PHP PodsForm::comment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PodsForm
的用法示例。
在下文中一共展示了PodsForm::comment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
}
?>
<tr class="form-field pods-field <?php
echo 'pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . PodsForm::clean($field['name'], true);
?>
">
<th scope="row" valign="top"><?php
echo PodsForm::label('pods_field_' . $field['name'], $field['label'], $field['help'], $field);
?>
</th>
<td>
<?php
echo PodsForm::field('pods_field_' . $field['name'], $pod->field(array('name' => $field['name'], 'in_form' => true)), $field['type'], $field, $pod, $pod->id());
?>
<?php
echo PodsForm::comment('pods_field_' . $field['name'], $field['description'], $field);
?>
</td>
</tr>
<?php
}
?>
</table>
</div>
<!-- /.inside -->
</div>
<!-- /#pods-meta-box -->
</div>
<!-- /#normal-sortables -->
<?php
示例2: meta_comment
/**
* @param $comment
* @param $metabox
*/
public function meta_comment($comment, $metabox)
{
wp_enqueue_style('pods-form');
$hidden_fields = array();
?>
<table class="form-table editcomment pods-metabox">
<?php
$id = null;
if (is_object($comment)) {
$id = $comment->comment_ID;
}
$pod = pods($metabox['args']['group']['pod']['name'], $id, true);
foreach ($metabox['args']['group']['fields'] as $field) {
if (false === PodsForm::permission($field['type'], $field['name'], $field, $metabox['args']['group']['fields'], $pod, $id)) {
if (pods_var('hidden', $field['options'], false, null, true)) {
$field['type'] = 'hidden';
} else {
continue;
}
} elseif (!pods_has_permissions($field['options']) && pods_var('hidden', $field['options'], false, null, true)) {
$field['type'] = 'hidden';
}
$value = '';
if (!empty($pod)) {
$value = $pod->field(array('name' => $field['name'], 'in_form' => true));
}
if ('hidden' == $field['type']) {
$hidden_fields[] = array('field' => $field, 'value' => $value);
} else {
?>
<tr class="form-field pods-field <?php
echo 'pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . Podsform::clean($field['name'], true);
?>
">
<th scope="row" valign="top"><?php
echo PodsForm::label('pods_meta_' . $field['name'], $field['label'], $field['help'], $field);
?>
</th>
<td>
<?php
echo PodsForm::field('pods_meta_' . $field['name'], $value, $field['type'], $field, $pod, $id);
?>
<?php
echo PodsForm::comment('pods_meta_' . $field['name'], $field['description'], $field);
?>
</td>
</tr>
<?php
}
}
?>
</table>
<?php
foreach ($hidden_fields as $hidden_field) {
$field = $hidden_field['field'];
echo PodsForm::field('pods_meta_' . $field['name'], $hidden_field['value'], 'hidden');
}
}
示例3:
echo 'pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . PodsForm::clean($field['name'], true);
?>
">
<div class="pods-field-label">
<?php
echo PodsForm::label($field_prefix . $field['name'], $field['label'], $field['help'], $field);
?>
</div>
<div class="pods-field-input">
<?php
echo PodsForm::field($field_prefix . $field['name'], $pod->field(array('name' => $field['name'], 'in_form' => true)), $field['type'], $field, $pod, $pod->id());
?>
<?php
echo PodsForm::comment($field_prefix . $field['name'], null, $field);
?>
</div>
</li>
<?php
/**
* Runs after a field is outputted.
*
* @params array $field The current field.
* @params array $fields All fields of the form.
* @params object $pod The current Pod object.
* @params array $params The form's parameters.
*
* @since 2.3.19
*/
do_action('pods_form_after_field', $field, $fields, $pod, $params);
示例4:
<?php
echo PodsForm::label($name, $options);
?>
<?php
echo PodsForm::field($name, $value, $type, $options, $pod, $id);
?>
<?php
echo PodsForm::comment($name, null, $options);