當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CFS函數代碼示例

本文整理匯總了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);
 }
開發者ID:OutThisLife,項目名稱:HTW,代碼行數:17,代碼來源:third_party.php

示例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 
    }
開發者ID:zengskie,項目名稱:Heroku-WordPress-PostgreSQL,代碼行數:53,代碼來源:textarea.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;
     }
 }
開發者ID:annguyenit,項目名稱:fivy,代碼行數:24,代碼來源:posttype-deal.php

示例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 
    }
開發者ID:OutThisLife,項目名稱:HTW,代碼行數:41,代碼來源:true_false.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 
    }
開發者ID:heranbuildinggroup,項目名稱:coastbroadwater,代碼行數:21,代碼來源:hyperlink.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 
    }
開發者ID:vanpattenmedia,項目名稱:custom-field-suite,代碼行數:21,代碼來源:color.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 
    }
開發者ID:Desertsnowman,項目名稱:custom-field-suite,代碼行數:37,代碼來源:file.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 -->
開發者ID:suffolklibraries,項目名稱:code-selfish,代碼行數:31,代碼來源:custom-home.php

示例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">&times;</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>
開發者ID:jonpalma,項目名稱:centro-de-competitividad,代碼行數:31,代碼來源:page-afiliados.php

示例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>
開發者ID:aniste,項目名稱:testfr,代碼行數:31,代碼來源:single-test.php

示例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));
 }
開發者ID:OutThisLife,項目名稱:HTW,代碼行數:9,代碼來源:revision.php

示例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">
開發者ID:pusyak,項目名稱:KidSaveRussia,代碼行數:31,代碼來源:media.php

示例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>';
開發者ID:jonpalma,項目名稱:promesa-educativa,代碼行數:31,代碼來源:page-sewa.php

示例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>
開發者ID:aniste,項目名稱:testfr,代碼行數:31,代碼來源:core-page-level2-andre-tema.php

示例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';
開發者ID:jonpalma,項目名稱:promesa-educativa,代碼行數:31,代碼來源:page-quienes-somos.php


注:本文中的CFS函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。