本文整理汇总了PHP中presscore_config函数的典型用法代码示例。如果您正苦于以下问题:PHP presscore_config函数的具体用法?PHP presscore_config怎么用?PHP presscore_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了presscore_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: presscore_congif_populate_team_vars
function presscore_congif_populate_team_vars()
{
$config = presscore_config();
$post_id = $config->get('post_id');
$prefix = '_dt_team_options_';
// for categorizer compatibility
if (!$config->get('order')) {
$config->set('order', get_post_meta($post_id, "{$prefix}order", true));
}
if (!$config->get('orderby')) {
$config->set('orderby', get_post_meta($post_id, "{$prefix}orderby", true));
}
$config->set('display', get_post_meta($post_id, "_dt_team_display", true));
////////////////////
// Image sizing //
////////////////////
$config->set('image_layout', get_post_meta($post_id, "{$prefix}image_layout", true));
$config->set('thumb_proportions', get_post_meta($post_id, "{$prefix}thumb_proportions", true));
$config->set('show_excerpts', get_post_meta($post_id, "{$prefix}show_exerpts", true));
//////////////
// Layout //
//////////////
$config->set('layout', get_post_meta($post_id, "{$prefix}masonry_layout", true));
$config->set('full_width', get_post_meta($post_id, "{$prefix}full_width", true));
$config->set('posts_per_page', get_post_meta($post_id, "{$prefix}ppp", true));
$config->set('post.preview.description.style', 'under_image');
///////////////////
// Items style //
///////////////////
$config->set('item_padding', get_post_meta($post_id, "{$prefix}item_padding", true), 20);
$config->set('post.preview.width.min', get_post_meta($post_id, "{$prefix}target_width", true), 370);
$config->set('template.columns.number', get_post_meta($post_id, "{$prefix}columns_number", true), 3);
$config->set('post.preview.background.enabled', get_post_meta($post_id, "{$prefix}bg_under_posts", true));
}
示例2: dt_woocommerce_configure_template
/**
* Init theme config for shop.
*
* @param string $name
*/
function dt_woocommerce_configure_template($name = '')
{
dt_woocommerce_configure_mini_cart();
// Add template configuration actions.
$config = presscore_config();
$mod_wc_config = dt_woocommerce_template_config($config);
add_action('dt_wc_loop_start', array($mod_wc_config, 'setup'));
add_action('dt_wc_loop_end', array($mod_wc_config, 'cleanup'));
// Stop if not on woocommerce page.
if ('shop' !== $name) {
return;
}
// From what page get settings?
$post_id = null;
if (is_shop()) {
$post_id = woocommerce_get_page_id('shop');
} else {
if (is_cart()) {
$post_id = woocommerce_get_page_id('cart');
} else {
if (is_checkout()) {
$post_id = woocommerce_get_page_id('checkout');
}
}
}
if ($post_id) {
$config->set('post_id', $post_id);
}
if (!is_product()) {
add_filter('presscore_get_page_title', 'dt_woocommerce_get_page_title', 20);
}
// Replace theme breadcrumbs.
add_filter('presscore_get_breadcrumbs-html', 'dt_woocommerce_replace_theme_breadcrumbs', 20, 2);
}
示例3: get_response
public function get_response($input)
{
$this->input = $input;
$this->config = presscore_config();
$this->response = $this->get_default_response();
$this->do_response();
return $this->response;
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:8,代码来源:abstract-presscore-ajax-content-builder.php
示例4: presscore_get_post_back_link
function presscore_get_post_back_link()
{
$page_id = apply_filters('presscore_post_back_link_id', presscore_config()->get('post.navigation.back_button.target_page_id'));
if ($page_id) {
return '<a class="back-to-list" href="' . esc_url(get_permalink($page_id)) . '"></a>';
}
return '';
}
示例5: presscore_archive_post_content
function presscore_archive_post_content()
{
$post_type = get_post_type();
$html = apply_filters("presscore_archive_post_content-{$post_type}", '');
if ($html) {
echo $html;
} else {
if ('post' == $post_type) {
presscore_config()->set('show_details', false);
presscore_populate_post_config();
presscore_get_template_part('theme', 'blog/masonry/blog-masonry-post');
} else {
presscore_get_template_part('theme', 'content-archive');
}
}
}
示例6: presscore_congif_populate_testimonials_vars
function presscore_congif_populate_testimonials_vars()
{
$config = presscore_config();
$post_id = $config->get('post_id');
$prefix = '_dt_testimonials_options_';
$config->set('layout', get_post_meta($post_id, "{$prefix}masonry_layout", true), 'masonry');
$config->set('posts_per_page', get_post_meta($post_id, "{$prefix}ppp", true));
$config->set('display', get_post_meta($post_id, "_dt_testimonials_display", true));
$config->set('full_width', get_post_meta($post_id, "{$prefix}full_width", true), false);
$config->set('item_padding', get_post_meta($post_id, "{$prefix}item_padding", true), 20);
$config->set('post.preview.width.min', get_post_meta($post_id, "{$prefix}target_width", true), 370);
$config->set('template.columns.number', get_post_meta($post_id, "{$prefix}columns_number", true), 3);
$config->set('load_style', get_post_meta($post_id, "{$prefix}load_style", true), 'default');
$config->set('post.preview.load.effect', get_post_meta($post_id, "{$prefix}load_effect", true), 'fade_in');
$config->set('post.preview.description.style', 'on_hoover_centered');
$config->set('post.preview.description.alignment', 'left');
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:17,代码来源:mod-testimonials-template-config-helpers.php
示例7: presscore_footer_html_class
function presscore_footer_html_class($class = array())
{
if ($class) {
$output = is_array($class) ? $class : explode(' ', $class);
} else {
$output = array();
}
switch (presscore_config()->get('template.footer.style')) {
case 'full_width_line':
$output[] = 'full-width-line';
break;
case 'solid_background':
$output[] = 'solid-bg';
if ('outline' === presscore_config()->get('template.footer.decoration')) {
$output[] = 'footer-outline-decoration';
}
break;
// default - content_width_line
}
$output = apply_filters('presscore_footer_html_class', $output);
return $output ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($output))) : '';
}
示例8: presscore_get_filtered_posts
function presscore_get_filtered_posts($args)
{
$config = presscore_config();
// sanitize
$request = $config->get('request_display');
if ($request) {
$request = wp_parse_args($request, array('terms_ids' => null));
}
$display = $config->get('display');
if (!is_array($display)) {
$display = array();
}
$display = wp_parse_args($display, array('terms_ids' => null, 'posts_ids' => null, 'type' => 'category', 'select' => 'all'));
$is_posts_query = 'albums' == $display['type'];
$terms = $request ? $request['terms_ids'] : ($is_posts_query ? null : $display['terms_ids']);
$defaults = array('post_type' => 'post', 'taxonomy' => 'category', 'select' => $request ? 'only' : $display['select'], 'order' => $config->get('order'), 'orderby' => $config->get('orderby'), 'posts_per_page' => $config->get('posts_per_page'), 'terms' => $terms, 'post__in' => $is_posts_query && 'only' == $display['select'] ? $display['posts_ids'] : null, 'post__not_in' => $is_posts_query && 'except' == $display['select'] ? $display['posts_ids'] : null, 'query' => presscore_query());
$args = wp_parse_args($args, $defaults);
$query = $args['query'];
unset($args['query']);
$posts_query = $query->get_posts_by_terms($args);
do_action('presscore_get_filtered_posts-' . $args['post_type'], $posts_query);
do_action('presscore_get_filtered_posts', $posts_query);
return $posts_query;
}
示例9: presscore_congif_populate_albums_vars
function presscore_congif_populate_albums_vars()
{
$config = presscore_config();
$config->set_post_id($config->get('post_id'));
$post_id = $config->get_post_id();
$prefix = '_dt_albums_options_';
$config->set_meta_prefix($prefix);
// for categorizer compatibility
if (!$config->get('order')) {
$config->set_meta('order', 'order');
}
if (!$config->get('orderby')) {
$config->set_meta('orderby', 'orderby');
}
if (!$config->get('display')) {
$display = get_post_meta($post_id, '_dt_albums_display', true);
if (!isset($display['terms_ids'])) {
$display['terms_ids'] = null;
}
$config->set('display', $display);
}
$config->map(array('template.posts_filter.terms.enabled' => array('meta', 'show_filter', true), 'template.posts_filter.orderby.enabled' => array('meta', 'show_orderby', true), 'template.posts_filter.order.enabled' => array('meta', 'show_order', true), 'posts_per_page' => array('meta', 'ppp', ''), 'full_width' => array('meta', 'full_width', false), 'item_padding' => array('meta', 'item_padding', 20), 'thumb_proportions' => array('meta', 'thumb_proportions', array('width' => 1, 'height' => 1)), 'image_layout' => array('meta', 'image_layout', 'original'), 'all_the_same_width' => array('meta', 'posts_same_width', false), 'load_style' => array('meta', 'load_style', 'default'), 'post.preview.mini_images.enabled' => array('meta', 'show_round_miniatures', true), 'show_titles' => array('meta', 'show_titles', true), 'show_excerpts' => array('meta', 'show_exerpts', true), 'post.meta.fields.date' => array('meta', 'show_date_in_post_meta', true), 'post.meta.fields.categories' => array('meta', 'show_categories_in_post_meta', true), 'post.meta.fields.comments' => array('meta', 'show_comments_in_post_meta', true), 'post.meta.fields.author' => array('meta', 'show_author_in_post_meta', true), 'post.meta.fields.media_number' => array('meta', 'show_numbers_in_post_meta', true), 'post.preview.load.effect' => array('meta', 'load_effect', 'fade_in'), 'show_all_pages' => array('meta', 'show_all_pages', false)));
// layout
if ('template-albums-jgrid.php' != dt_get_template_name($post_id, true)) {
$config->map(array('layout' => array('meta', 'layout'), 'post.preview.description.style' => array('meta', 'description', 'under_image'), 'post.preview.description.alignment' => array('meta', 'post_content_alignment', 'left'), 'post.preview.hover.animation' => array('meta', 'hover_animation', 'fade'), 'post.preview.hover.color' => array('meta', 'hover_bg_color', 'accent'), 'post.preview.hover.content.visibility' => array('meta', 'hover_content_visibility', 'on_hoover'), 'post.preview.hover.lines.animation' => array('meta', 'lines_animation_effect', '1'), 'post.preview.hover.title.visibility' => array('meta', 'title_visibility', 'on_hoover'), 'post.preview.width.min' => array('meta', 'target_width', 370), 'template.columns.number' => array('meta', 'columns_number', 3), 'post.preview.background.enabled' => array('value', false), 'post.preview.background.style' => array('value', false)));
$description_style = $config->get('post.preview.description.style');
// content alignment
if ('on_hoover_centered' == $description_style) {
$config->set_meta('post.preview.description.alignment', 'bg_post_content_alignment');
} else {
if ('bg_with_lines' == $description_style) {
$config->set('post.preview.description.alignment', false);
} else {
$config->set_meta('post.preview.description.alignment', 'post_content_alignment');
}
}
// preview background
if ('under_image' == $description_style) {
$background_under_posts = get_post_meta($post_id, "{$prefix}bg_under_masonry_posts", true);
$config->set('post.preview.background.enabled', !in_array($background_under_posts, array('disabled', '')));
$config->set('post.preview.background.style', $background_under_posts, false);
}
// justified grid
} else {
$config->map(array('layout' => array('value', 'grid'), 'post.preview.description.style' => array('meta', 'jgrid_description', 'on_hoover_centered'), 'post.preview.hover.animation' => array('meta', 'jgrid_hover_animation', 'fade'), 'post.preview.hover.color' => array('meta', 'jgrid_hover_bg_color', 'accent'), 'post.preview.hover.content.visibility' => array('meta', 'jgrid_hover_content_visibility', 'on_hoover'), 'post.preview.hover.lines.animation' => array('meta', 'jgrid_lines_animation_effect', '1'), 'post.preview.hover.title.visibility' => array('meta', 'jgrid_title_visibility', 'on_hoover'), 'target_height' => array('meta', 'target_height', 250), 'justified_grid' => array('value', true), 'all_the_same_width' => array('value', true), 'hide_last_row' => array('meta', 'hide_last_row', false)));
$description_style = $config->get('post.preview.description.style');
// content alignment
if ('on_hoover_centered' == $description_style) {
$config->set_meta('post.preview.description.alignment', 'jgrid_bg_post_content_alignment');
} else {
if ('bg_with_lines' == $description_style) {
$config->set('post.preview.description.alignment', false);
} else {
$config->set_meta('post.preview.description.alignment', 'jgrid_post_content_alignment');
}
}
if ('default' != $config->get('load_style')) {
$config->set('hide_last_row', false);
}
}
}
示例10: switch
// File Security Check
if (!defined('ABSPATH')) {
exit;
}
$image = $rollover_content = $rollover_class = '';
// media
switch (presscore_config()->get('post.preview.media.style')) {
case 'featured_image':
$image_id = has_post_thumbnail() ? get_post_thumbnail_id() : 0;
$link_class = 'alignnone';
$link_class .= presscore_get_image_video_url($image_id) ? ' rollover-video' : ' rollover';
$image = presscore_project_get_thumbnail_img($image_id, $link_class);
// rollover icons
$rollover_content = presscore_project_get_preview_buttons($image_id);
if (1 == presscore_project_preview_buttons_count()) {
$rollover_class .= ' rollover-active';
}
break;
case 'slideshow':
$slider_classes = array('alignnone', 'slider-simple');
if ('grid' != presscore_config()->get('layout')) {
$slider_classes[] = 'slider-masonry';
}
$image = presscore_get_project_media_slider($slider_classes);
break;
}
// content
$content = presscore_project_get_preview_content();
$template_args = array('image' => $image, 'content' => $content, 'rollover_content' => $rollover_content, 'figure_class' => $rollover_class);
// description under image template
presscore_get_template_part('theme', 'post-layouts/description-under-image-odd', null, $template_args);
示例11: presscore_config
<?php
/**
* Portfolio list content.
*
* @package presscore
* @since presscore 0.1
*/
// File Security Check
if (!defined('ABSPATH')) {
exit;
}
$config = presscore_config();
$article_content_layout = presscore_get_template_image_layout($config->get('layout'), $config->get('post.query.var.current_post'));
?>
<?php
do_action('presscore_before_post');
?>
<article <?php
post_class(array('post', 'project-' . $article_content_layout));
?>
>
<?php
$image = $rollover_content = $rollover_class = '';
if (!post_password_required()) {
switch ($config->get('post.preview.media.style')) {
case 'featured_image':
$image_id = get_post_thumbnail_id();
示例12: dt_woocommerce_filter_masonry_container_class
/**
* Filers masonry container class array.
*
* @param array $class
* @return array
*/
function dt_woocommerce_filter_masonry_container_class($class = array())
{
if ('under_image' === presscore_config()->get('post.preview.description.style')) {
if ('below_image' === presscore_config()->get('product.preview.add_to_cart.position')) {
$class[] = 'cart-btn-below-img';
} else {
$class[] = 'cart-btn-on-img';
}
}
return $class;
}
示例13: vc_map_get_attributes
* @var $show_bg
* @var $sidebar_id
* Shortcode class
* @var $this WPBakeryShortCode_VC_Widget_sidebar
*/
$title = $el_class = $sidebar_id = $show_bg = '';
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
if ('' === $sidebar_id) {
return null;
}
$el_class = $this->getExtraClass($el_class);
if ('true' === $show_bg) {
$el_class .= ' solid-bg';
}
switch (presscore_config()->get('sidebar.style.background.decoration')) {
case 'shadow':
$el_class .= ' sidebar-shadow-decoration';
break;
case 'outline':
$el_class .= ' sidebar-outline-decoration';
break;
}
ob_start();
dynamic_sidebar($sidebar_id);
$sidebar_value = ob_get_contents();
ob_end_clean();
$sidebar_value = trim($sidebar_value);
$sidebar_value = '<li' === substr($sidebar_value, 0, 3) ? '<ul>' . $sidebar_value . '</ul>' : $sidebar_value;
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_widgetised_column wpb_content_element sidebar-content' . $el_class, $this->settings['base'], $atts);
$output = '
示例14: presscore_config
<?php
/**
* Mirosite template.
*
* @package the7
* @since 3.0.0
*/
/* Template Name: Microsite */
if (!defined('ABSPATH')) {
exit;
}
presscore_config()->set('template', 'microsite');
get_header();
?>
<?php
if (presscore_is_content_visible()) {
?>
<div id="content" class="content" role="main">
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<?php
do_action('presscore_before_loop');
示例15:
* @package vogue
* @since 1.0.0
*/
// File Security Check
if (!defined('ABSPATH')) {
exit;
}
if (presscore_is_content_visible()) {
?>
</div><!-- .wf-container -->
</div><!-- .wf-wrap -->
</div><!-- #main -->
<?php
if (presscore_config()->get('template.footer.background.slideout_mode')) {
echo '</div>';
}
do_action('presscore_after_main_container');
?>
<?php
}
// presscore_is_content_visible
?>
<a href="#" class="scroll-top"></a>
</div><!-- #page -->
<?php
wp_footer();