/**
	*处理 AJAX 加载页面数据
	*http://www.bgbk.org
*/
function Bing_ajax_load_page_data($code)
{
    $data = array('code' => $code, 'title' => wp_title('|', false, 'right'), 'body_class' => join(' ', get_body_class($class)), 'refresh_sidebar' => false, 'mobile_menu_current' => Bing_mobile_menu_current(), 'mobile_title' => Bing_mobile_title(), 'mobile_return_show' => is_singular() && get_post_type() != 'page', 'last_change' => get_option(THEME_SLUG . '_last_change'));
    if ($sidebar_code = apply_filters('ajax_load_page_sidebar_code', null)) {
        $data['refresh_sidebar'] = true;
        $data['sidebar_code'] = $sidebar_code;
    }
    return wp_json_encode($data);
}
Beispiel #2
0
/**
	*移动版头部
	*http://www.bgbk.org
*/
function Bing_mobile_header()
{
    $show_class = is_singular() && get_post_type() != 'page' ? ' show' : '';
    ?>
	<div id="mobile-header">
		<a href="javascript:history.go(-1);" class="mobile-return<?php 
    echo $show_class;
    ?>
" title="<?php 
    esc_attr_e('返回', 'Bing');
    ?>
">
			<span class="dashicons dashicons-arrow-left-alt2"></span><?php 
    _e('返回', 'Bing');
    ?>
		</a>
		<p class="mobile-title"><?php 
    echo Bing_mobile_title();
    ?>
</p>
	</div>
<?php 
}