本文整理汇总了PHP中wpex_global_obj函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_global_obj函数的具体用法?PHP wpex_global_obj怎么用?PHP wpex_global_obj使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpex_global_obj函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: localize
/**
* Localize scripts
*
* @since 2.1.0
*/
public function localize($array)
{
// Add lightbox settings to array
$array['iLightbox'] = array('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;
}
示例2: 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;
}
示例3: display_element
function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
{
// Define vars
$id_field = $this->db_fields['id'];
$header_style = wpex_global_obj('header_style');
// Down Arrows
if (!empty($children_elements[$element->{$id_field}]) && $depth == 0) {
$element->classes[] = 'dropdown';
if (wpex_get_mod('menu_arrow_down')) {
$arrow_class = 'six' == $header_style ? 'fa-chevron-right' : 'fa-angle-down';
$element->title .= ' <span class="nav-arrow top-level fa ' . $arrow_class . '"></span>';
}
}
// Right/Left Arrows
if (!empty($children_elements[$element->{$id_field}]) && $depth > 0) {
$element->classes[] = 'dropdown';
if (wpex_get_mod('menu_arrow_side', true)) {
if (is_rtl()) {
$element->title .= '<span class="nav-arrow second-level fa fa-angle-left"></span>';
} else {
$element->title .= '<span class="nav-arrow second-level fa fa-angle-right"></span>';
}
}
}
// Remove current menu item when using local-scroll class
if (in_array('local-scroll', $element->classes) && in_array('current-menu-item', $element->classes)) {
$key = array_search('current-menu-item', $element->classes);
unset($element->classes[$key]);
}
// Define walker
Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
}
示例4: 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;
}
示例5: parse_center_row
/**
* Convert center row into bool
*
* @since 2.0.2
*/
private function parse_center_row($value)
{
if (!empty($this->atts['full_width'])) {
$this->atts['center_row'] = false;
} elseif ('yes' == $value && 'full-screen' == wpex_global_obj('post_layout')) {
$this->atts['center_row'] = true;
} else {
$this->atts['center_row'] = false;
}
}
示例6: wpex_get_post_layout
/**
* Returns defined post layout for curent post
*
* @since 2.0.0
*/
function wpex_get_post_layout()
{
// Get global object
$obj = wpex_global_obj();
// Return post layout if defined
if (!empty($obj->post_layout)) {
return $obj->post_layout;
} else {
return wpex_post_layout();
}
}
示例7: 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();
}
示例8: gaps_menu_two_three
/**
* Custom function for displaying menu styles 2 and 3 required for this skin
*
* @since 2.0.2
*/
public function gaps_menu_two_three()
{
// Get current filter
$filter = current_filter();
// Set bool variable
$get = false;
// Check current filter against header style
if (in_array(wpex_global_obj('header_style'), array('two', 'three')) && 'wpex_hook_main_before' == $filter) {
$get = true;
}
// Get menu template part
if ($get) {
get_template_part('partials/header/header-menu');
}
}
示例9: wpex_has_menu_search
/**
* Check if search icon should be in the nav
*
* @since 1.0.0
*/
function wpex_has_menu_search()
{
// Return false by default
$return = false;
// Get header style
$header_style = wpex_global_obj('header_style');
// Always return true for the header style 2, we can hide via CSS
if ('two' == $header_style) {
$return = true;
} elseif (wpex_get_mod('main_search', true)) {
$return = true;
}
// Apply filters
$return = apply_filters('wpex_has_menu_search', $return);
// Return
return $return;
}
示例10: wpex_add_search_to_menu
/**
* Adds the search icon to the menu items
*
* @since 1.0.0
*/
function wpex_add_search_to_menu($items, $args)
{
// Only used on main menu
if ('main_menu' != $args->theme_location) {
return $items;
}
// Get search style
$search_style = wpex_global_obj('menu_search_style');
// Return if disabled
if (!$search_style || 'disabled' == $search_style) {
return $items;
}
// Get header style
$header_style = wpex_global_obj('header_style');
// Get correct search icon class
if ('overlay' == $search_style) {
$class = ' search-overlay-toggle';
} elseif ('drop_down' == $search_style) {
$class = ' search-dropdown-toggle';
} elseif ('header_replace' == $search_style) {
$class = ' search-header-replace-toggle';
} else {
$class = '';
}
// Add search item to menu
$items .= '<li class="search-toggle-li wpex-menu-extra">';
$items .= '<a href="#" class="site-search-toggle' . $class . '">';
$items .= '<span class="link-inner">';
$items .= '<span class="fa fa-search"></span>';
if ('six' == $header_style) {
$items .= '<span class="wpex-menu-search-text">' . _x('Search', 'Navbar Search Text For Vertical Nav', 'wpex') . '</span>';
}
$items .= '</span>';
$items .= '</a>';
$items .= '</li>';
// Return nav $items
return $items;
}
示例11: get_css
/**
* Retrieves cached CSS or generates the responsive CSS
*
* @since 1.6.3
*/
public static function get_css($output)
{
// Define vars
$css = $add_css = '';
$main_layout = wpex_global_obj('main_layout');
$active_skin = wpex_global_obj('skin');
/*-----------------------------------------------------------------------------------*/
/* - Max Width
/*-----------------------------------------------------------------------------------*/
// Max Width
if ($max_width = wpex_get_mod('container_max_width', false)) {
$css .= 'body.wpex-responsive .container,
body.wpex-responsive .vc_row-fluid.container {
max-width:' . $max_width . ';
}';
}
/*-----------------------------------------------------------------------------------*/
/* - Desktop Width
/*-----------------------------------------------------------------------------------*/
// Main Container With
if ($width = wpex_get_mod('main_container_width', false)) {
if ('boxed' == $main_layout || 'gaps' == $active_skin) {
$add_css .= '.boxed-main-layout #wrap { width:' . $width . '; }';
} else {
$add_css .= '.container,
.vc_row-fluid.container {
width: ' . $width . ' !important;
max-width:none;
}';
}
}
// Left container width
if ($width = wpex_get_mod('left_container_width', false)) {
$add_css .= '.content-area{
width:' . $width . ';
max-width:none;
}';
}
// Sidebar width
if ($width = wpex_get_mod('sidebar_width', false)) {
$add_css .= '#sidebar{
width: ' . $width . ';
max-width:none;
}';
}
// Add to $css var
if ($add_css) {
$css .= $add_css;
$add_css = '';
}
/*-----------------------------------------------------------------------------------*/
/* - Tablet Landscape & Small Screen Widths
/*-----------------------------------------------------------------------------------*/
// Main Container With
if ($width = wpex_get_mod('tablet_landscape_main_container_width', false)) {
if ('boxed' == $main_layout || 'gaps' == $active_skin) {
$add_css .= '.boxed-main-layout #wrap{
width:' . $width . ';
max-width:none;
}';
} else {
$add_css .= '.container,
.vc_row-fluid.container {
width: ' . $width . ' !important;
max-width:none;
}';
}
}
// Left container width
if ($width = wpex_get_mod('tablet_landscape_left_container_width', false)) {
$add_css .= '.content-area{
width:' . $width . ';
max-width:none;
}';
}
// Sidebar width
if ($width = wpex_get_mod('tablet_landscape_sidebar_width', false)) {
$add_css .= '#sidebar{
width: ' . $width . ';
max-width:none;
}';
}
// Add to $css var
if ($add_css) {
$css .= '@media only screen and (min-width: 960px) and (max-width: 1280px) {
' . $add_css . '
}';
$add_css = '';
}
/*-----------------------------------------------------------------------------------*/
/* - Tablet Widths
/*-----------------------------------------------------------------------------------*/
// Main Container With
if ($width = wpex_get_mod('tablet_main_container_width', false)) {
if ('boxed' == $main_layout || 'gaps' == $active_skin) {
//.........这里部分代码省略.........
示例12: apply_filters
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Menu Location
$menu_location = apply_filters('wpex_main_menu_location', 'main_menu');
// Multisite global menu
$ms_global_menu = apply_filters('wpex_ms_global_menu', false);
// Display if menu is defined
if (has_nav_menu($menu_location) || $ms_global_menu) {
?>
<?php
// Closing toggle for the sidr mobile menu style
if ('sidr' == wpex_global_obj('mobile_menu_style')) {
?>
<div id="sidr-close"><a href="#sidr-close" class="toggle-sidr-close"></a></div>
<?php
}
?>
<div id="wpex-mobile-menu-fixed-top" class="clr wpex-hidden">
<div class="container clr">
<a href="#mobile-menu" class="mobile-menu-toggle"><?php
echo apply_filters('wpex_mobile_menu_open_button_text', '<span class="fa fa-navicon"></span>');
echo wpex_get_mod('mobile_menu_toggle_text', _x('Menu', 'Mobile Menu Toggle Button Text', 'wpex'));
?>
</a>
示例13: wpex_header_logo_url
<?php
/**
* Header Logo
*
* @package Total WordPress Theme
* @subpackage Partials
* @version 3.0.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Define variables
$logo_url = wpex_header_logo_url();
$logo_img = wpex_global_obj('header_logo');
$overlay_logo = wpex_header_overlay_logo();
$logo_icon = wpex_header_logo_icon();
$logo_title = wpex_header_logo_title();
?>
<div id="site-logo" class="<?php
echo wpex_header_logo_classes();
?>
">
<div id="site-logo-inner" class="clr">
<?php
if ($logo_img || $overlay_logo) {
?>
示例14: vc_css_ids
/**
* Load VC CSS
*
* @since 2.0.0
*/
public static function vc_css_ids($css)
{
$ids = wpex_global_obj('vc_css_ids');
if (!$ids) {
return $css;
}
foreach ($ids as $id) {
if ($id != wpex_global_obj('post_id') && ($vc_css = get_post_meta($id, '_wpb_shortcodes_custom_css', true))) {
$css .= '/*VC META CSS*/' . $vc_css;
}
}
return $css;
}
示例15: wpex_retina_logo
/**
* Adds js for the retina logo
*
* @since 1.1.0
*/
function wpex_retina_logo()
{
// Get theme options
$logo_url = wpex_get_mod('retina_logo');
$logo_height = wpex_get_mod('retina_logo_height');
// Translate theme mods
$logo_url = wpex_translate_theme_mod('retina_logo', $logo_url);
$logo_height = wpex_translate_theme_mod('retina_logo_height', $logo_height);
// Header overlay Retina logo
if (wpex_header_overlay_logo() && wpex_global_obj('has_overlay_header')) {
$post_id = wpex_global_obj('post_id');
$overlay_retina_logo = get_post_meta($post_id, 'wpex_overlay_header_logo_retina', true);
$overlay_retina_logo_height = get_post_meta($post_id, 'wpex_overlay_header_logo_retina_height', true);
if ($overlay_retina_logo && $overlay_retina_logo_height) {
if (is_numeric($overlay_retina_logo)) {
$overlay_retina_logo = wp_get_attachment_image_src($overlay_retina_logo, 'full');
$overlay_retina_logo = $overlay_retina_logo[0];
} else {
$overlay_retina_logo = esc_url($overlay_retina_logo);
}
if ($overlay_retina_logo) {
$logo_url = $overlay_retina_logo;
$logo_height = $overlay_retina_logo_height;
}
}
}
// Apply filters
$logo_url = apply_filters('wpex_retina_logo_url', $logo_url);
$logo_height = apply_filters('wpex_retina_logo_height', $logo_height);
// Output JS for retina logo
if ($logo_url && $logo_height) {
$output = '<!-- Retina Logo -->
<script type="text/javascript">
var $wpexRetinaLogo = "' . $logo_url . '",
$wpexRetinaLogoHeight = "' . intval($logo_height) . '";
jQuery(function($){
if ( window.devicePixelRatio >= 2 ) {
$("#site-logo img").attr("src", "' . $logo_url . '");
$("#site-logo img").css("max-height", "' . intval($logo_height) . 'px");
}
});
</script>';
echo $output;
}
}