本文整理汇总了PHP中wpex_get_mod函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_get_mod函数的具体用法?PHP wpex_get_mod怎么用?PHP wpex_get_mod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpex_get_mod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpex_remove_cpt_slug
function wpex_remove_cpt_slug($post_link, $post, $leavename)
{
// Theme post types
$post_types = array('portfolio', 'staff', 'testimonials');
// If not part of the theme post types return default post link
if (!in_array($post->post_type, $post_types) || 'publish' != $post->post_status) {
return $post_link;
}
// Loop through post types and remove the current slug
foreach ($post_types as $post_type) {
if ('portfolio' == $post_type) {
$slug = wpex_get_mod('portfolio_slug', 'portfolio-item');
}
if ('staff' == $post_type) {
$slug = wpex_get_mod('staff_slug', 'staff-member');
}
if ('testimonials' == $post_type) {
$slug = wpex_get_mod('testimonials_slug', 'testimonial');
}
// Remove current slug
$post_link = str_replace('/' . $slug . '/', '/', $post_link);
}
// Return new post link without slug
return $post_link;
}
示例2: localize
/**
* Localize scripts
*
* @since 2.1.0
*/
public function localize($array)
{
// Add lightbox settings to array
$array['iLightbox'] = array('auto' => wpex_get_mod('lightbox_auto', false), 'skin' => wpex_global_obj('lightbox_skin'), 'path' => 'horizontal', 'controls' => array('arrows' => wpex_get_mod('lightbox_arrows', true), 'thumbnail' => wpex_get_mod('lightbox_thumbnails', true), 'fullscreen' => wpex_get_mod('lightbox_fullscreen', true), 'mousewheel' => wpex_get_mod('lightbox_mousewheel', false)), 'effects' => array('loadedFadeSpeed' => 50, 'fadeSpeed' => 500), 'show' => array('title' => wpex_get_mod('lightbox_titles', true), 'speed' => 200), 'hide' => array('speed' => 200), 'overlay' => array('blur' => true, 'opacity' => 0.9), 'social' => array('start' => true, 'show' => 'mouseenter', 'hide' => 'mouseleave', 'buttons' => false));
// Return array
return $array;
}
示例3: remove_slugs
/**
* Remove slugs from the post types
*
* @since 2.0.0
*/
public function remove_slugs($post_link, $post, $leavename)
{
// If not part of the theme post types return default post link
if (!in_array($post->post_type, $this->post_types) || 'publish' != $post->post_status) {
return $post_link;
}
// Get the post type slug
if ('portfolio' == $post->post_type) {
$slug = wpex_get_mod('portfolio_slug', 'portfolio-item');
$slug = $slug ? $slug : 'portfolio-item';
} elseif ('staff' == $post->post_type) {
$slug = wpex_get_mod('staff_slug');
$slug = $slug ? $slug : 'staff-member';
} elseif ('testimonials' == $post->post_type) {
$slug = wpex_get_mod('testimonials_slug', 'testimonial');
$slug = $slug ? $slug : 'testimonial';
} else {
$slug = '';
}
// Remove current slug
if ($slug) {
$post_link = str_replace('/' . $slug . '/', '/', $post_link);
}
// Return new post link without slug
return $post_link;
}
示例4: display_sidebar
/**
* Alter main sidebar to display bbpress_sidebar sidebar
*
* @access public
* @since 2.1.0
*/
public function display_sidebar($sidebar)
{
if (is_bbpress() && wpex_get_mod('bbpress_custom_sidebar', true)) {
$sidebar = 'bbpress_sidebar';
}
return $sidebar;
}
示例5: generate
/**
* Generates the CSS output
*
* @since 2.0.0
*/
public static function generate($output)
{
// Define main variables
$css = '';
// Fix for Fonts In the Visual Composer
if (wpex_global_obj('vc_is_inline')) {
$css .= '.wpb_row .fa:before { box-sizing:content-box!important; -moz-box-sizing:content-box!important; -webkit-box-sizing:content-box!important; }';
}
// Fixes for full-width layout when custom background is added
if ('full-width' == wpex_global_obj('main_layout') && (wpex_get_mod('background_color') || wpex_get_mod('background_image'))) {
$css .= '.wpex-sticky-header-holder{background:none;}';
}
// Remove header border if custom color is set
if (wpex_get_mod('header_background')) {
$css .= '.is-sticky #site-header{border-color:transparent;}';
}
// Overlay Header font size
if (wpex_global_obj('has_overlay_header') && ($font_size = get_post_meta(wpex_global_obj('post_id'), 'wpex_overlay_header_font_size', true))) {
$css .= '#site-navigation, #site-navigation .dropdown-menu a{font-size:' . intval($font_size) . 'px;}';
}
/*-----------------------------------------------------------------------------------*/
/* - Return CSS
/*-----------------------------------------------------------------------------------*/
if (!empty($css)) {
$output .= '/*ADVANCED STYLING CSS*/' . $css;
}
// Return output css
return $output;
}
示例6: wpseo_breadcrumb_links
/**
* Filter the ancestors of the yoast seo breadcrumbs
* Adds the portfolio, staff, testimonials and blog links
*
* @version 3.3.0
*/
static function wpseo_breadcrumb_links($links)
{
global $post;
$new_breadcrumb = '';
// Loop through items
$types = array('portfolio', 'staff', 'testimonials', 'post');
foreach ($types as $type) {
if (is_singular($type)) {
if ('post' == $type) {
$type = 'blog';
}
$page_id = wpex_parse_obj_id(wpex_get_mod($type . '_page'), 'page');
if ($page_id) {
$page_title = get_the_title($page_id);
$page_permalink = get_permalink($page_id);
if ($page_permalink && $page_title) {
$new_breadcrumb[] = array('url' => $page_permalink, 'text' => $page_title);
}
}
}
}
// End foreach loop
// Combine new crumb
if ($new_breadcrumb) {
array_splice($links, 1, -2, $new_breadcrumb);
}
// Return links
return $links;
}
示例7: generate
/**
* Generates the CSS output
*
* @since 2.0.0
*/
public static function generate($output)
{
// Define main variables
$css = '';
/*-----------------------------------------------------------------------------------*/
/* - Logo Max Widths
/*-----------------------------------------------------------------------------------*/
// Desktop
if ($width = wpex_get_mod('logo_max_width')) {
$css .= '@media only screen and (min-width: 960px) {
#site-logo img {
max-width: ' . wpex_sanitize_data($width, 'px_pct') . ';
}
}';
}
// Tablet Portrait
if ($width = wpex_get_mod('logo_max_width_tablet_portrait')) {
$css .= '@media only screen and (min-width: 768px) and (max-width: 959px) {
#site-logo img {
max-width: ' . wpex_sanitize_data($width, 'px_pct') . ';
}
}';
}
// Phone
if ($width = wpex_get_mod('logo_max_width_phone')) {
$css .= '@media only screen and (max-width: 767px) {
#site-logo img {
max-width: ' . wpex_sanitize_data($width, 'px_pct') . ';
}
}';
}
/*-----------------------------------------------------------------------------------*/
/* - Other
/*-----------------------------------------------------------------------------------*/
// Fixes for full-width layout when custom background is added
if ('full-width' == wpex_global_obj('main_layout') && (wpex_get_mod('background_color') || wpex_get_mod('background_image'))) {
$css .= '.wpex-sticky-header-holder{background:none;}';
}
// Fix for Fonts In the Visual Composer
if (wpex_global_obj('vc_is_inline')) {
$css .= '.wpb_row .fa:before { box-sizing:content-box!important; -moz-box-sizing:content-box!important; -webkit-box-sizing:content-box!important; }';
}
// Remove header border if custom color is set
if (wpex_get_mod('header_background')) {
$css .= '.is-sticky #site-header{border-color:transparent;}';
}
// Overlay Header font size
if (wpex_global_obj('has_overlay_header') && ($font_size = get_post_meta(wpex_global_obj('post_id'), 'wpex_overlay_header_font_size', true))) {
$css .= '#site-navigation, #site-navigation .dropdown-menu a{font-size:' . intval($font_size) . 'px;}';
}
/*-----------------------------------------------------------------------------------*/
/* - Return CSS
/*-----------------------------------------------------------------------------------*/
if (!empty($css)) {
$output .= '/*ADVANCED STYLING CSS*/' . $css;
}
// Return output css
return $output;
}
示例8: wpex_post_layout
/**
* Sets the correct layout for posts
*
* @since Total 1.0.0
*/
function wpex_post_layout($post_id = '')
{
// Get ID if not defined
$post_id = $post_id ? $post_id : wpex_get_the_id();
// Define variables
$class = 'right-sidebar';
$meta = get_post_meta($post_id, 'wpex_post_layout', true);
// Check meta first to override and return (prevents filters from overriding meta)
if ($meta) {
return $meta;
}
// Singular Page
if (is_page()) {
// Blog template
if (is_page_template('templates/blog.php')) {
$class = wpex_get_mod('blog_archives_layout', 'right-sidebar');
}
// Landing Page
if (is_page_template('templates/landing-page.php')) {
$class = 'full-width';
} elseif (is_attachment()) {
$class = 'full-width';
} else {
$class = wpex_get_mod('page_single_layout', 'right-sidebar');
}
} elseif (is_singular('post')) {
$class = wpex_get_mod('blog_single_layout', 'right-sidebar');
} elseif (is_singular('attachment')) {
$class = 'full-width';
} elseif (is_home()) {
$class = wpex_get_mod('blog_archives_layout', 'right-sidebar');
} elseif (is_search()) {
$class = wpex_get_mod('search_layout', 'right-sidebar');
} elseif (is_category()) {
$class = wpex_get_mod('blog_archives_layout', 'right-sidebar');
$term = get_query_var('cat');
$term_data = get_option("category_{$term}");
if ($term_data) {
if (!empty($term_data['wpex_term_layout'])) {
$class = $term_data['wpex_term_layout'];
}
}
} elseif (wpex_is_blog_query()) {
$class = wpex_get_mod('blog_archives_layout', 'right-sidebar');
} elseif (is_404()) {
$class = 'full-width';
} else {
$class = 'right-sidebar';
}
// Class should never be empty
if (empty($class)) {
$class = 'right-sidebar';
}
// Apply filters for child theme editing
$class = apply_filters('wpex_post_layout_class', $class);
// Return correct classname
return $class;
}
示例9: wpex_overlay_style
function wpex_overlay_style($style = '')
{
$style = $style ? $style : get_post_type();
if ('portfolio' == $style) {
$style = wpex_get_mod('portfolio_entry_overlay_style');
} elseif ('staff' == $style) {
$style = wpex_get_mod('staff_entry_overlay_style');
}
return apply_filters('wpex_overlay_style', $style);
}
示例10: register
/**
* Registers the custom taxonomy
*
* @since 2.0.0
*/
public static function register()
{
$name = wpex_get_mod('post_series_labels');
$name = $name ? $name : esc_html__('Post Series', 'total');
$slug = wpex_get_mod('post_series_slug');
$slug = $slug ? $slug : 'post-series';
// Apply filters
$args = apply_filters('wpex_taxonomy_post_series_args', array('labels' => array('name' => $name, 'singular_name' => $name, 'menu_name' => $name, 'search_items' => esc_html__('Search', 'total'), 'popular_items' => esc_html__('Popular', 'total'), 'all_items' => esc_html__('All', 'total'), 'parent_item' => esc_html__('Parent', 'total'), 'parent_item_colon' => esc_html__('Parent', 'total'), 'edit_item' => esc_html__('Edit', 'total'), 'update_item' => esc_html__('Update', 'total'), 'add_new_item' => esc_html__('Add New', 'total'), 'new_item_name' => esc_html__('New', 'total'), 'separate_items_with_commas' => esc_html__('Separate with commas', 'total'), 'add_or_remove_items' => esc_html__('Add or remove', 'total'), 'choose_from_most_used' => esc_html__('Choose from the most used', 'total')), 'public' => true, 'show_in_nav_menus' => true, 'show_ui' => true, 'show_tagcloud' => true, 'hierarchical' => true, 'rewrite' => array('slug' => $slug), 'query_var' => true));
// Register the taxonomy
register_taxonomy('post_series', array('post'), $args);
}
示例11: get_current_skin
/**
* Returns the current skin
*
* @since 1.6.3
*/
public function get_current_skin()
{
// Check URL
if (!empty($_GET['theme_skin'])) {
return $_GET['theme_skin'];
}
// Apply filters
$skin = apply_filters('wpex_active_skin', wpex_get_mod('theme_skin', 'base'));
// Sanitize and return
return $skin ? $skin : 'base';
}
示例12: post_meta
/**
* The function responsible for creating the actual meta box.
*
* @since 1.0.0
*/
public function post_meta($post)
{
// Disable on footer builder
$footer_builder_page = wpex_get_mod('footer_builder_page_id');
if ('page' == get_post_type($post->ID) && $footer_builder_page == $post->ID) {
return;
}
// Add metabox
$obj = get_post_type_object($post->post_type);
add_meta_box('wpex-metabox', $obj->labels->singular_name . ' ' . esc_html__('Settings', 'total'), array($this, 'display_meta_box'), $post->post_type, 'normal', 'high');
}
示例13: active_skin
/**
* Returns active lightbox skin
*
* @since 2.1.0
*/
public static function active_skin()
{
// Get skin from Customizer setting
$skin = wpex_get_mod('lightbox_skin', 'minimal');
// Sanitize
$skin = $skin ? $skin : 'minimal';
// Apply filters
$skin = apply_filters('wpex_lightbox_skin', $skin);
// Return
return $skin;
}
示例14: __construct
/**
* Start things up
*
* @since 1.6.0
*/
public function __construct()
{
// Get options
$this->options = wpex_get_mod('login_page_design', array('enabled' => true, 'logo' => '', 'logo_height' => '', 'background_color' => '', 'background_img' => '', 'background_style' => '', 'form_background_color' => '', 'form_background_opacity' => '', 'form_text_color' => '', 'form_top' => '', 'form_border_radius' => ''));
// Add actions
add_action('admin_menu', array($this, 'add_page'));
add_action('admin_init', array($this, 'register_settings'));
add_action('admin_enqueue_scripts', array($this, 'scripts'));
add_action('admin_print_styles-' . WPEX_ADMIN_PANEL_HOOK_PREFIX . '-admin-login', array($this, 'admin_styles'), 40);
add_action('login_head', array($this, 'output_css'));
add_action('login_headerurl', array($this, 'logo_link'));
}
示例15: wpex_wcmenucart_menu_item
function wpex_wcmenucart_menu_item()
{
// Vars
global $woocommerce;
$icon_style = wpex_get_mod('woo_menu_icon_style', 'drop-down');
$custom_link = wpex_get_mod('woo_menu_icon_custom_link');
$header_style = wpex_global_obj('header_style');
// URL
if ('custom-link' == $icon_style && $custom_link) {
$url = esc_url($custom_link);
} else {
$cart_id = woocommerce_get_page_id('cart');
if (function_exists('icl_object_id')) {
$cart_id = icl_object_id($cart_id, 'page');
}
$url = get_permalink($cart_id);
}
// Cart total
$display = wpex_get_mod('woo_menu_icon_display', 'icon_count');
if ('icon_total' == $display) {
$cart_extra = WC()->cart->get_cart_total();
$cart_extra = str_replace('amount', 'wcmenucart-details', $cart_extra);
} elseif ('icon_count' == $display) {
$cart_extra = '<span class="wcmenucart-details count">' . WC()->cart->cart_contents_count . '</span>';
} else {
$cart_extra = '';
}
// Cart Icon
$cart_icon = '<span class="fa fa-shopping-cart"></span><span class="wcmenucart-text">' . _x('Shop', 'Navbar Cart Text For Vertical Nav', 'wpex') . '</span>';
$cart_icon = apply_filters('wpex_menu_cart_icon_html', $cart_icon);
ob_start();
?>
<a href="<?php
echo $url;
?>
" class="wcmenucart" title="<?php
_e('Your Cart', 'wpex');
?>
">
<span class="link-inner">
<span class="wcmenucart-count"><?php
echo $cart_icon;
echo $cart_extra;
?>
</span>
</span>
</a>
<?php
return ob_get_clean();
}