本文整理汇总了PHP中cfct_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP cfct_get_option函数的具体用法?PHP cfct_get_option怎么用?PHP cfct_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cfct_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cfct_init
function cfct_init()
{
cfct_admin_request_handler();
if (cfct_get_option('cfct_ajax_load') == 'yes') {
cfct_ajax_load();
}
}
示例2: annowf_get_option
/**
*
* @param string $key option name to get
* @param mixed $default What to return if the given option is not set
* @return mixed
*/
function annowf_get_option($key, $default = false)
{
$option = cfct_get_option('workflow_settings');
if (is_null($option[$key])) {
return $default;
} else {
return $option[$key];
}
}
示例3: cfct_head
function cfct_head()
{
cfct_get_option('cfct_ajax_load') == 'no' ? $ajax_load = 'false' : ($ajax_load = 'true');
echo '
<script type="text/javascript">
var CFCT_URL = "' . get_bloginfo('url') . '";
var CFCT_AJAX_LOAD = ' . $ajax_load . ';
</script>
';
}
示例4: cfct_get_custom_colors
function cfct_get_custom_colors($type = 'option')
{
global $cfct_color_options;
$colors = array();
foreach ($cfct_color_options as $option => $value) {
switch ($type) {
case 'preview':
!empty($_GET[$option]) ? $colors[$option] = strip_tags(stripslashes($_GET[$option])) : ($colors[$option] = '');
break;
case 'option':
default:
$colors[$option] = cfct_get_option($option);
break;
}
}
return $colors;
}
示例5: anno_ga_js
/**
* Output Google Analytics Code if a GA ID is present
*/
function anno_ga_js()
{
$ga_id = cfct_get_option('ga_id');
if (!empty($ga_id)) {
?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php
echo esc_js($ga_id);
?>
']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<?php
}
}
示例6: cfct_banner
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
die;
}
if (CFCT_DEBUG) {
cfct_banner(__FILE__);
}
$blog_desc = get_bloginfo('description');
is_home() && !empty($blog_desc) ? $title_description = ' - ' . $blog_desc : ($title_description = '');
cfct_get_option('cfct_css_background_images') == 'no' ? $css_ext = '?type=noimg' : ($css_ext = '');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php
language_attributes();
?>
>
<head profile="http://gmpg.org/xfn/11">
<title><?php
wp_title('-', true, 'right');
echo wp_specialchars(get_bloginfo('name'), 1) . $title_description;
?>
</title>
<meta http-equiv="content-type" content="<?php
bloginfo('html_type');
?>
示例7: cfct_banner
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// **********************************************************************
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
die;
}
if (CFCT_DEBUG) {
cfct_banner(__FILE__);
}
$blog_desc = get_bloginfo('description');
is_home() && !empty($blog_desc) ? $title_description = ' - ' . $blog_desc : ($title_description = '');
$use_background_img = cfct_get_option('cfct_css_background_images');
$use_background_img == 'no' ? $css_ext = '?type=noimg' : ($css_ext = '');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php
language_attributes();
?>
>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="content-type" content="<?php
bloginfo('html_type');
?>
; charset=<?php
bloginfo('charset');
?>
" />
示例8: cfct_blog_settings_form
function cfct_blog_settings_form()
{
global $cfct_color_options;
$options = array('yes' => __('Yes', 'carrington-blog'), 'no' => __('No', 'carrington-blog'));
$ajax_load_options = '';
$color_options = '';
foreach ($options as $k => $v) {
if ($k == cfct_get_option('cfct_ajax_load')) {
$ajax_load_selected = 'selected="selected"';
} else {
$ajax_load_selected = '';
}
$ajax_load_options .= "\n\t<option value='{$k}' {$ajax_load_selected}>{$v}</option>";
if ($k == cfct_get_option('cfct_custom_colors')) {
$color_options_selected = 'selected="selected"';
} else {
$color_options_selected = '';
}
$color_options .= "\n\t<option value='{$k}' {$color_options_selected}>{$v}</option>";
}
$cfct_posts_per_archive_page = get_option('cfct_posts_per_archive_page');
if (intval($cfct_posts_per_archive_page) == 0) {
$cfct_posts_per_archive_page = 25;
}
cfct_get_option('cfct_custom_colors') == 'no' ? $colors_class = 'hidden' : ($colors_class = '');
$html = '
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">' . sprintf(__('Design', 'carrington-blog'), $key) . '</td>
<td>
<fieldset>
<p>
<label for="cfct_custom_colors">' . __('Customize Colors:', 'carrington-blog') . '</label>
<select name="cfct_custom_colors" id="cfct_custom_colors">' . $color_options . '</select>
</p>
<fieldset class="' . $colors_class . '" id="cfct_color_options_panel">
<legend>Custom Colors</legend>
';
foreach ($cfct_color_options as $option => $default) {
$value = get_option($option);
$value == '' ? $value = $default : ($value = attribute_escape($value));
$label = ucwords(str_replace(array('cfct_', '_'), array('', ' '), $option));
$html .= '
<p>
<label for="' . $option . '">' . __($label . ':', 'carrington-blog') . '</label>
#<input type="text" name="' . $option . '" id="' . $option . '" value="' . $value . '" size="6" maxlength="6" class="cfct_colorpicker" />
</p>
';
}
$html .= '
<p class="submit">
<input type="hidden" name="cfct_header_image_type" id="cfct_header_image_type" value="dark" />
<input id="reset_colors" type="reset" name="reset_button" value="' . __('Reset to Default Colors', 'carrington-blog') . '" />
</p>
</fieldset>
<p>TODO: Header Image</p>
</fieldset>
</td>
</tr>
</tbody>
</table>
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">' . sprintf(__('Behavior', 'carrington-blog'), $key) . '</td>
<td>
<fieldset>
<p>
<label for="cfct_ajax_load">' . __('Load archives and comments with AJAX:', 'carrington-blog') . '</label>
<select name="cfct_ajax_load" id="cfct_ajax_load">' . $ajax_load_options . '</select>
</p>
<p>
<label for="cfct_posts_per_archive_page">' . __('Posts shown on archives pages:', 'carrington-blog') . '</label>
<input type="text" name="cfct_posts_per_archive_page" id="cfct_posts_per_archive_page" value="' . $cfct_posts_per_archive_page . '" size="3" />
</p>
</fieldset>
</td>
</tr>
</tbody>
</table>
';
echo $html;
}
示例9: anno_doi_lookup_enabled
/**
* Determines whether or not a DOI lookup is feasible with the credentials given
*
* @return bool
*/
function anno_doi_lookup_enabled()
{
// A login (optional password) is required for DOI lookup.
$crossref_login = cfct_get_option('crossref_login');
return !empty($crossref_login);
}
示例10: cfct_posts_per_archive_page_setting
/**
* Returns the number of posts to display on an archive page
*
* @return int The number of posts to display on an archive page
**/
function cfct_posts_per_archive_page_setting()
{
$count = cfct_get_option('posts_per_archive_page');
intval($count) > 0 ? $count = $count : ($count = 25);
return $count;
}
示例11: cfct_banner
if (CFCT_DEBUG) {
cfct_banner(__FILE__);
}
?>
</div><!-- .container -->
</section><!-- #content -->
<footer id="footer">
<div class="container clearfix">
<p class="credit"><?php
_e('Powered by <a href="http://wordpress.org/">WordPress</a> · <a href="http://github.com/alexkingorg/wp-personal/">Get Personal</a>', 'favepersonal');
?>
</p>
<?php
$colophon = cfct_get_option('cfcp_copyright', false);
$sep = $colophon ? ' · ' : '';
$loginout = cfct_get_loginout('', $sep);
if ($colophon || $loginout) {
echo '<p>' . $colophon . $loginout . '</p>';
}
?>
</div><!--.container-->
</footer><!-- #footer -->
<?php
wp_footer();
?>
</body>
</html>
示例12: cfct_banner
if (CFCT_DEBUG) {
cfct_banner(__FILE__);
}
?>
<div class="clear"></div>
</div><!-- .wrapper -->
</div><!-- #main -->
<hr class="lofi" />
<div id="footer" class="section">
<div class="wrapper">
<p id="generator-link"><?php
_e('Proudly powered by <a href="http://wordpress.org/" rel="generator">WordPress</a> and <a href="http://carringtontheme.com" title="Carrington theme for WordPress">Carrington</a>.', 'carrington-blog');
?>
</p>
<?php
if (cfct_get_option('cfct_credit') == 'yes') {
?>
<p id="developer-link"><?php
printf(__('<a href="http://crowdfavorite.com" title="Custom WordPress development, design and backup services." rel="developer designer">%s</a>', 'carrington-blog'), 'Carrington Theme by Crowd Favorite');
?>
</p>
<?php
}
?>
</div><!--.wrapper-->
</div><!--#footer -->
</div><!--#page-->
<?php
wp_footer();
?>
</body>
示例13: xml_front
/**
* Generate the Front portion of an article XML
*
* @param postObject $article Article to generate the XML for.
* @return string XML generated
*/
private function xml_front($article)
{
// Journal Title
$journal_title = cfct_get_option('journal_name');
if (!empty($journal_title)) {
$journal_title_xml = '<journal-title-group>
<journal-title>' . esc_html($journal_title) . '</journal-title>
</journal-title-group>';
} else {
$journal_title_xml = '';
}
// Journal ID
$journal_id = cfct_get_option('journal_id');
if (!empty($journal_id)) {
$journal_id_type = cfct_get_option('journal_id_type');
if (!empty($journal_id_type)) {
$journal_id_type_xml = ' journal-id-type="' . esc_attr($journal_id_type) . '"';
} else {
$journal_id_type_xml = '';
}
$journal_id_xml = '<journal-id' . $journal_id_type_xml . '>' . esc_html($journal_id) . '</journal-id>';
} else {
$journal_id_xml = '';
}
// Publisher ISSN
$pub_issn = cfct_get_option('publisher_issn');
if (!empty($pub_issn)) {
$pub_issn_xml = '<issn pub-type="epub">' . esc_html($pub_issn) . '</issn>';
} else {
$pub_issn_xml = '';
}
// Abstract
$abstract = $article->post_excerpt;
if (!empty($abstract)) {
$abstract_xml = '
<abstract>' . $abstract . '</abstract>';
} else {
$abstract_xml = '';
}
// Funding Statement
$funding = get_post_meta($article->ID, '_anno_funding', true);
if (!empty($funding)) {
$funding_xml = '<funding-group>
<funding-statement>' . esc_html($funding) . '</funding-statement>
</funding-group>';
} else {
$funding_xml = '';
}
// DOI
$doi = get_post_meta($article->ID, '_anno_doi', true);
if (!empty($doi)) {
$doi_xml = '<article-id pub-id-type="doi">' . esc_html($doi) . '</article-id>';
} else {
$doi_xml = '';
}
// Article category. Theoretically, there can only be one!
$cats = wp_get_object_terms($article->ID, 'article_category');
if (!empty($cats) && is_array($cats)) {
$category = get_category($cats[0]);
if (!empty($category)) {
$category_xml = '<article-categories>
<subj-group>
<subject>' . esc_html($category->name) . '</subject>
</subj-group>
</article-categories>';
} else {
$category_xml = '';
}
} else {
$category_xml = '';
}
// Article Tags
$tags = wp_get_object_terms($article->ID, 'article_tag');
if (!empty($tags) && is_array($tags)) {
$tag_xml = '<kwd-group kwd-group-type="simple">';
foreach ($tags as $tag) {
$tag = get_term($tag, 'article_tag');
$tag_xml .= '<kwd>' . esc_html($tag->name) . '</kwd>';
}
$tag_xml .= '
</kwd-group>';
} else {
$tag_xml = '';
}
// Article title/subtitle
$subtitle = get_post_meta($article->ID, '_anno_subtitle', true);
$title_xml = '<title-group>';
if (!empty($article->post_title) || !empty($subtitle)) {
$title_xml = '<title-group>';
if (!empty($article->post_title)) {
$title_xml .= '
<article-title>' . esc_html($article->post_title) . '</article-title>';
} else {
$title_xml .= '
//.........这里部分代码省略.........
示例14: cfct_header_image_form
/**
* Display a form for image header customization
*
* @return string Markup displaying the form
*
**/
function cfct_header_image_form()
{
global $wpdb;
$images = $wpdb->get_results("\n\t\tSELECT * FROM {$wpdb->posts}\n\t\tWHERE post_type = 'attachment'\n\t\tAND post_mime_type LIKE 'image%'\n\t\tAND post_parent = 0\n\t\tORDER BY post_date_gmt DESC\n\t\tLIMIT 50\n\t");
$upload_url = admin_url('media-new.php');
$header_image = cfct_get_option('header_image');
if (empty($header_image)) {
$header_image = 0;
}
$output = '
<ul style="width: ' . (count($images) + 1) * 152 . 'px">
<li style="background: #666;">
<label for="cfct_header_image_0">
<input type="radio" name="' . esc_attr(cfct_option_name('header_image')) . '" value="0" id="' . esc_attr(cfct_option_name('header_image_0')) . '" ' . checked($header_image, 0, false) . '/>' . __('No Image', 'carrington-core') . '
</label>
</li>
';
if (count($images)) {
foreach ($images as $image) {
$id = cfct_option_name('header_image_' . $image->ID);
$thumbnail = wp_get_attachment_image_src($image->ID);
$output .= '
<li style="background-image: url(' . $thumbnail[0] . ')">
<label for="' . $id . '">
<input type="radio" name="' . esc_attr(cfct_option_name('header_image')) . '" value="' . $image->ID . '" id="' . $id . '"' . checked($header_image, $image->ID, false) . ' />' . esc_html($image->post_title) . '
</label>
</li>';
}
}
$output .= '</ul>';
return '<p>' . sprintf(__('Header Image — <a href="%s">Upload Images</a>', 'carrington-core'), $upload_url) . '</p><div class="cfct_header_image_carousel">' . $output . '</div>';
}
示例15: xml_front
/**
* Generate the Front portion of an article XML
*
* @param postObject $article Article to generate the XML for.
* @return string XML generated
*/
private function xml_front($article)
{
// Journal Title
$journal_title = cfct_get_option('journal_name');
if (!empty($journal_title)) {
$journal_title_xml = '<journal-title-group>
<journal-title>' . esc_html($journal_title) . '</journal-title>
</journal-title-group>';
} else {
$journal_title_xml = '';
}
// Journal ID
$journal_id = cfct_get_option('journal_id');
if (!empty($journal_id)) {
$journal_id_type = cfct_get_option('journal_id_type');
if (!empty($journal_id_type)) {
$journal_id_type_xml = ' journal-id-type="' . esc_attr($journal_id_type) . '"';
} else {
$journal_id_type_xml = '';
}
$journal_id_xml = '<journal-id' . $journal_id_type_xml . '>' . esc_html($journal_id) . '</journal-id>';
} else {
$journal_id_xml = '';
}
// Publisher ISSN
$pub_issn = cfct_get_option('publisher_issn');
if (!empty($pub_issn)) {
$pub_issn_xml = '<issn pub-type="ppub">' . esc_html($pub_issn) . '</issn>';
} else {
$pub_issn_xml = '';
}
// Abstract
$abstract = $article->post_excerpt;
if (!empty($abstract)) {
$abstract_xml = '<abstract>
<title>' . _x('Abstract', 'xml abstract title', 'anno') . '</title>
<p>' . esc_html($abstract) . '</p>
</abstract>';
} else {
$abstract_xml = '';
}
// Funding Statement
$funding = get_post_meta($article->ID, '_anno_funding', true);
if (!empty($funding)) {
$funding_xml = '<funding-group>
<funding-statement><bold>' . esc_html($funding) . '</bold></funding-statement>
</funding-group>';
} else {
$funding_xml = '';
}
// DOI
$doi = get_post_meta($article->ID, '_anno_doi', true);
if (!empty($doi)) {
$doi_xml = '<article-id pub-id-type="doi">' . esc_html($doi) . '</article-id>';
} else {
$doi_xml = '';
}
// Article category. Theoretically, there can only be one!
$cats = wp_get_object_terms($article->ID, 'article_category');
if (!empty($cats) && is_array($cats)) {
$category = get_category($cats[0]);
if (!empty($category)) {
$category_xml = '<article-categories>
<subj-group>
<subject><bold>' . esc_html($category->name) . '</bold></subject>
</subj-group>
</article-categories>';
} else {
$category_xml = '';
}
} else {
$category_xml = '';
}
// Article Tags
$tags = wp_get_object_terms($article->ID, 'article_tag');
if (!empty($tags) && is_array($tags)) {
$tag_xml = '<kwd-group kwd-group-type="simple">';
foreach ($tags as $tag) {
$tag = get_term($tag, 'article_tag');
$tag_xml .= '<kwd><bold>' . esc_html($tag->name) . '</bold></kwd>';
}
$tag_xml .= '
</kwd-group>';
} else {
$tag_xml = '';
}
// Article title/subtitle
$subtitle = get_post_meta($article->ID, '_anno_subtitle', true);
$title_xml = '<title-group>';
if (!empty($article->post_title) || !empty($subtitle)) {
$title_xml = '<title-group>';
if (!empty($article->post_title)) {
$title_xml .= '
<article-title><bold>' . esc_html($article->post_title) . '</bold></article-title>';
//.........这里部分代码省略.........