本文整理汇总了PHP中CFS函数的典型用法代码示例。如果您正苦于以下问题:PHP CFS函数的具体用法?PHP CFS怎么用?PHP CFS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CFS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: duplicate_post
/**
* Duplicate Post support
* @param int $new_post_id
* @param object $post
* @since 2.0.0
*/
function duplicate_post($new_post_id, $post)
{
$field_data = CFS()->get(false, $post->ID, array('format' => 'raw'));
if (is_array($field_data)) {
foreach ($field_data as $key => $value) {
delete_post_meta($new_post_id, $key, $value);
}
}
$post_data = array('ID' => $new_post_id);
CFS()->save($field_data, $post_data);
}
示例2: options_html
function options_html($key, $field)
{
?>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Default Value', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'textarea', 'input_name' => "cfs[fields][{$key}][options][default_value]", 'value' => $this->get_option($field, 'default_value')));
?>
</td>
</tr>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Formatting', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'select', 'input_name' => "cfs[fields][{$key}][options][formatting]", 'options' => array('choices' => array('none' => __('None', 'cfs'), 'auto_br' => __('Convert newlines to <br />', 'cfs')), 'force_single' => true), 'value' => $this->get_option($field, 'formatting', 'auto_br')));
?>
</td>
</tr>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Validation', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'true_false', 'input_name' => "cfs[fields][{$key}][options][required]", 'input_class' => 'true_false', 'value' => $this->get_option($field, 'required'), 'options' => array('message' => __('This is a required field', 'cfs'))));
?>
</td>
</tr>
<?php
}
示例3: cpt_column
/**
* @todo Filter value for each column
* @global type $post
* @param type $column
* @param type $post_id
*/
function cpt_column($column)
{
global $post;
switch ($column) {
case 'cat_id':
echo CFS()->get("category_id", $post->ID);
break;
case 'source':
$source = CFS()->get("source", $post->ID);
echo $source[0];
break;
case 'post_status':
echo $post->post_status;
break;
default:
break;
}
}
示例4: options_html
function options_html($key, $field)
{
?>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Message', 'cfs');
?>
</label>
<p class="description"><?php
_e('The text beside the checkbox', 'cfs');
?>
</p>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'text', 'input_name' => "cfs[fields][{$key}][options][message]", 'value' => $this->get_option($field, 'message')));
?>
</td>
</tr>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Validation', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'true_false', 'input_name' => "cfs[fields][{$key}][options][required]", 'input_class' => 'true_false', 'value' => $this->get_option($field, 'required'), 'options' => array('message' => __('This is a required field', 'cfs'))));
?>
</td>
</tr>
<?php
}
示例5: options_html
function options_html($key, $field = null)
{
?>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Output format', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'select', 'input_name' => "cfs[fields][{$key}][options][format]", 'options' => array('choices' => array('html' => __('HTML', 'cfs'), 'php' => __('PHP Array', 'cfs')), 'force_single' => true), 'value' => $this->get_option($field, 'format', 'html')));
?>
</td>
</tr>
<?php
}
示例6: options_html
function options_html($key, $field)
{
?>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Default Value', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'text', 'input_name' => "cfs[fields][{$key}][options][default_value]", 'value' => $this->get_option($field, 'default_value')));
?>
</td>
</tr>
<?php
}
示例7: options_html
function options_html($key, $field)
{
?>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Return Value', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'select', 'input_name' => "cfs[fields][{$key}][options][return_value]", 'options' => array('choices' => array('url' => __('File URL', 'cfs'), 'id' => __('Attachment ID', 'cfs')), 'force_single' => true), 'value' => $this->get_option($field, 'return_value', 'url')));
?>
</td>
</tr>
<tr class="field_option field_option_<?php
echo $this->name;
?>
">
<td class="label">
<label><?php
_e('Validation', 'cfs');
?>
</label>
</td>
<td>
<?php
CFS()->create_field(array('type' => 'true_false', 'input_name' => "cfs[fields][{$key}][options][required]", 'input_class' => 'true_false', 'value' => $this->get_option($field, 'required'), 'options' => array('message' => __('This is a required field', 'cfs'))));
?>
</td>
</tr>
<?php
}
示例8: CFS
?>
<a href="<?php
echo CFS()->get('catalogue_link');
?>
"><?php
the_post_thumbnail();
?>
</a>
<?php
}
?>
<p><a href="<?php
echo CFS()->get('catalogue_link');
?>
"><?php
the_title();
?>
</a></p>
</div> <!-- end .vbox-box -->
</div>
<?php
}
?>
</div> <!-- end .g-row -->
示例9: CFS
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<h2>
<?php
echo CFS()->get('modal_formulario_title');
?>
</h2>
<p>
<?php
echo CFS()->get('modal_formulario_text');
?>
</p>
<?php
echo do_shortcode('[contact-form-7 id="94" title="Formulario Afiliado"]');
?>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- this div is close in the [contact-form-7] -->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--/* END */-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
</div>
示例10: CFS
?>
</section>
<div class="clear"></div>
</div>
</main>
<?php
$values = CFS()->get('relaterte_saker');
if ($values != '') {
?>
<div class="related">
<div class="head-container"><h3 class="head">Relaterte saker</h3></div>
<main>
<div class="thirds-container">
<?php
$used_post_id = array();
$values = CFS()->get('relaterte_saker');
if ($values != '') {
foreach ($values as $post_id) {
echo '<div class="thirds">';
echo '<a href="' . get_permalink($post_id) . '">';
$relatertbilde = $cfs->get('artikkelbilde', $post_id);
//echo '<div class="bilde">' . wp_get_attachment_image( $relatertbilde, 'medium' ) . '</div>';
$image = wp_get_attachment_url(get_post_thumbnail_id($post_id));
echo '<img class="thirds" src="' . $image . '" />';
echo '<h4>' . get_the_title($post_id) . '</h4';
echo '</a></div>';
array_push($used_post_id, $post_id);
}
}
?>
</main>
示例11: wp_restore_post_revision
/**
* Restore revision custom fields
* @see wp-includes/revision.php -> wp_restore_post_revision()
*/
function wp_restore_post_revision($post_id, $revision_id)
{
$field_data = CFS()->get(false, $revision_id, array('format' => 'raw'));
CFS()->save($field_data, array('ID' => $post_id));
}
示例12: CFS
</div>
<div class="header-news">
<a href="index.html" class="header-news_logo-link">
<img src="static/img/content/logo_108x1001.png" alt="" class="header-news_logo">
</a>
</div>
<div class="about">
<h2 class="main_title"><?php
echo $post->post_title;
?>
</h2>
<div class="about_desc">
<?php
echo CFS()->get('desc');
?>
</div>
<div class="about_tasks">
<div class="about_tasks-row">
<div class="about_task">
<a href="mission.html" class="about_task-link">
<img src="static/img/content/Mission.jpg" alt="" class="about_task-img">
</a>
<a href="mission.html" class="about_task-link">Наша миссия</a>
</div>
<div class="about_task">
<a href="team.html" class="about_task-link">
<img src="static/img/content/Team.jpg" alt="" class="about_task-img">
示例13: CFS
?>
</p>
</div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--/* EVENTOS */-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div class="eventos spacing no-padding-top">
<div class="container text-center">
<h1 class="header black"><?php
echo CFS()->get('eventos_title');
?>
</h1>
<?php
$arrayEventos = CFS()->get('eventos_array');
$arrayLength = count($arrayEventos);
$arrayEnd = end($arrayEventos);
foreach ($arrayEventos as $evento) {
echo '<div class="row no-margin table-row">';
echo '
<div class="col-sm-4">
<h3 class="green2">' . $evento['evento_name'] . '</h3>
<p class="gray">' . $evento['evento_date'] . '</p>
</div>
<div class="col-sm-8 black-bg">
<p class="text white">
' . $evento['evento_text'] . '
</p>
</div>';
echo '</div>';
示例14: while
}
?>
</div>
</div>
<div class="main-container">
<div class="contentfield main">
<div class="parent-content">
<?php
if (have_posts()) {
while (have_posts()) {
?>
<?php
the_post();
echo '<div class="ingressteksten ingresscenter">';
$ingressteksten = CFS()->get('ingress');
if ($ingressteksten != '') {
echo $ingressteksten;
}
echo '</div>';
$thispage = $post->ID;
}
}
?>
</div>
<!-- section -->
<section class="kjerneside-l-2">
<div class="metainfo">
<span class="date">
<p>Elektroniske varer</p>
示例15: CFS
</tbody>
</table>
</div>
</div>
</div>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--/* CONSEJO OPERATIVO/VOLUNTARIOS */-->
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<div class="operativo">
<div class="container">
<h1 class="header green text-center">EQUIPO OPERATIVO</h1>
<table class="text">
<tbody>
<?php
$arrayOperativo = CFS()->get('operativo_array');
foreach ($arrayOperativo as $operativo) {
echo '<tr>';
echo '<td class="text-right">' . $operativo['name'] . '</td>';
echo '<td class="text-left"><span>' . $operativo['job_position'] . '</span></td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
</div>
</div>
<?php
include 'footer.php';