本文整理汇总了PHP中bp_is_blog_page函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_blog_page函数的具体用法?PHP bp_is_blog_page怎么用?PHP bp_is_blog_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_blog_page函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: custom_media_nav_tab
/**
* Load Custom tabs on BuddyPress
*
* @global object $bp global BuddyPress object
*/
function custom_media_nav_tab()
{
global $bp;
if (!function_exists("bp_core_new_nav_item")) {
return;
}
if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
return;
}
global $rtmedia;
if (function_exists("bp_is_group") && !bp_is_group()) {
if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
$profile_counts = $this->actual_counts($bp->displayed_user->id);
}
$tab_position = apply_filters('rtmedia_media_tab_position', 99);
if ($rtmedia->options["buddypress_enableOnProfile"] != 0) {
bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
}
}
if (bp_is_group() && $rtmedia->options["buddypress_enableOnGroup"] != 0) {
global $bp;
$media_enabled = true;
//filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
$media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
// check if current user can view this group
$current_group = groups_get_current_group();
$is_visible_to_current_user = $current_group->is_visible;
if ($media_enabled && $is_visible_to_current_user) {
$group_counts = $this->actual_counts($bp->groups->current_group->id, "group");
$bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . RTMEDIA_MEDIA_SLUG, 'slug' => RTMEDIA_MEDIA_SLUG, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
}
}
}
开发者ID:saisai,项目名称:rtMedia,代码行数:38,代码来源:RTMediaNav.php
示例2: set_bp_context
/**
*
*/
function set_bp_context()
{
if (bp_is_blog_page() && !is_home()) {
$this->set_wp_context();
} else {
$this->set_bp_component_context();
}
}
开发者ID:fs-contributor,项目名称:rtMedia,代码行数:11,代码来源:RTMediaContext.php
示例3: wplms_remove_wpseo_from_buddypress
function wplms_remove_wpseo_from_buddypress()
{
if (function_exists('bp_is_blog_page')) {
if (!bp_is_blog_page()) {
global $wpseo_front;
remove_filter('wp_title', array($wpseo_front, 'title'), 15);
}
}
}
开发者ID:Nguyenkain,项目名称:Elearning,代码行数:9,代码来源:func.php
示例4: kleo_breadcrumb
/**
* Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class,
* which should be used in theme templates.
*
* @since 0.1.0
* @access public
* @param array $args Arguments to pass to Breadcrumb_Trail.
* @return void
*/
function kleo_breadcrumb($args = array())
{
if (function_exists('bp_is_active') && !bp_is_blog_page()) {
$breadcrumb = new buddypress_Breadcrumb_Trail($args);
} elseif (function_exists('is_bbpress') && is_bbpress()) {
$breadcrumb = new bbPress_Breadcrumb_Trail($args);
} else {
$breadcrumb = new Breadcrumb_Trail($args);
}
return $breadcrumb->trail();
}
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:20,代码来源:function-breadcrumb.php
示例5: custom_media_nav_tab
/**
* Load Custom tabs on BuddyPress
*
* @global object $bp global BuddyPress object
*/
function custom_media_nav_tab()
{
$bp = buddypress();
if (!function_exists('bp_core_new_nav_item')) {
return;
}
if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
return;
}
global $rtmedia;
if (function_exists('bp_is_group') && !bp_is_group()) {
if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
$profile_counts = $this->actual_counts($bp->displayed_user->id);
}
$tab_position = apply_filters('rtmedia_media_tab_position', 99);
if (0 !== intval($rtmedia->options['buddypress_enableOnProfile'])) {
bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
}
}
if (bp_is_group() && 0 !== intval($rtmedia->options['buddypress_enableOnGroup'])) {
$media_enabled = true;
//filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
$media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
// check if current user can view this group
$current_group = groups_get_current_group();
/**
* remove `$current_group->is_visible` and add `bp_group_is_visible( $current_group )`
* reason : In Buddypress 2.7 `is_visible` return false so we can't display `media` tab on group
* issue id : http://git.rtcamp.com/rtmedia/rtMedia/issues/119
*/
// $is_visible_to_current_user = $current_group->is_visible;
$is_visible_to_current_user = bp_group_is_visible($current_group);
if ($media_enabled && $is_visible_to_current_user) {
$group_counts = $this->actual_counts($bp->groups->current_group->id, 'group');
$slug = apply_filters('rtmedia_group_media_tab_slug', RTMEDIA_MEDIA_SLUG);
if (isset($bp->version) && $bp->version > '2.5.3') {
/*
* As from BuddyPress 2.6, you can't access $bp->bp_options_nav directly.
* Use `bp_core_new_subnav_item` to add subnav item.
*
* Check https://buddypress.trac.wordpress.org/ticket/6534 and https://buddypress.trac.wordpress.org/changeset/10745
* for more details
*/
bp_core_new_subnav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'parent_slug' => bp_get_current_group_slug(), 'parent_url' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/'), 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all'));
} else {
$bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
}
}
}
}
开发者ID:rtCamp,项目名称:rtMedia,代码行数:55,代码来源:RTMediaNav.php
示例6: load_js
/**
* Include Javascript
*/
public function load_js()
{
$template_uri = get_template_directory_uri();
//yu read it right, bp-default theme js
wp_enqueue_script('dtheme-uniform-js', $template_uri . '/_inc/js/jquery.uniform.min.js', array('jquery'), bp_get_version());
wp_enqueue_script('enhance-js', $template_uri . '/_inc/js/enhance.js', array('jquery', 'dtheme-uniform-js'), bp_get_version());
// Enqueue the global JS - Ajax will not work without it
wp_enqueue_script('dtheme-ajax-js', $template_uri . '/_inc/js/global.js', array('jquery'), bp_get_version());
// Add words that we need to use in JS to the end of the page so they can be translated and still used.
$params = array('my_favs' => __('My Favorites', 'bp-magic'), 'accepted' => __('Accepted', 'bp-magic'), 'rejected' => __('Rejected', 'bp-magic'), 'show_all_comments' => __('Show all comments for this thread', 'bp-magic'), 'show_all' => __('Show all', 'bp-magic'), 'comments' => __('comments', 'bp-magic'), 'close' => __('Close', 'bp-magic'), 'view' => __('View', 'bp-magic'), 'mark_as_fav' => __('Favorite', 'bp-magic'), 'remove_fav' => __('Remove Favorite', 'bp-magic'));
wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params);
// Maybe enqueue comment reply JS
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
开发者ID:buddydev,项目名称:bp-magic,代码行数:19,代码来源:css-js.php
示例7: bp_admin_bar_remove_nxt_menus
/**
* Unhook the NXTClass core menus.
*
* @since BuddyPress (r4151)
*
* @uses remove_action
* @uses is_network_admin()
* @uses is_user_admin()
*/
function bp_admin_bar_remove_nxt_menus()
{
if ('3.2' == bp_get_major_nxt_version()) {
remove_action('admin_bar_menu', 'nxt_admin_bar_my_account_menu', 10);
remove_action('admin_bar_menu', 'nxt_admin_bar_my_sites_menu', 20);
remove_action('admin_bar_menu', 'nxt_admin_bar_dashboard_view_site_menu', 25);
// Don't show the 'Edit Page' menu on BP pages
if (!bp_is_blog_page()) {
remove_action('admin_bar_menu', 'nxt_admin_bar_edit_menu', 30);
}
remove_action('admin_bar_menu', 'nxt_admin_bar_shortlink_menu', 80);
remove_action('admin_bar_menu', 'nxt_admin_bar_updates_menu', 70);
if (!is_network_admin() && !is_user_admin()) {
remove_action('admin_bar_menu', 'nxt_admin_bar_comments_menu', 50);
remove_action('admin_bar_menu', 'nxt_admin_bar_appearance_menu', 60);
}
remove_action('admin_bar_menu', 'nxt_admin_bar_updates_menu', 70);
}
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:28,代码来源:bp-core-adminbar.php
示例8: maybe_redirect
/**
* Check user access and redirect if access denied
*/
public function maybe_redirect()
{
// always allow access to blog, registration and activation pages
if (bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page()) {
return;
}
// grab toggle option from registry
$opt_toggle = $this->get_suboption('toggle');
// is option toggled on?
if ($opt_toggle && true == $opt_toggle->get()) {
// protection is enabled, is user logged in?
if (!is_user_logged_in()) {
// not logged in, redirect to registration page
bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug('register'));
// exit to avoid any accidental output
exit;
}
}
}
开发者ID:shads196770,项目名称:cbox-theme,代码行数:22,代码来源:class.php
示例9: dpa_add_css
/**
* Enqueues CSS files.
*
* @since 2.0
* @global object $bp BuddyPress global settings
*/
function dpa_add_css()
{
global $bp;
if (is_active_widget(false, false, 'achievements-sitewide') || is_active_widget(false, false, 'achievements-available-achievements') || is_active_widget(false, false, 'achievements-member-achievements') || is_active_widget(false, false, 'achievements-featured-achievement') || is_active_widget(false, false, 'achievements-member-achievements-available') || is_active_widget(false, false, 'achievements-member-points')) {
nxt_enqueue_style('achievements-widget', plugins_url('/css/widget.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
if (!bp_is_current_component($bp->achievements->slug)) {
if (bp_is_active('activity') && bp_is_activity_component() && !bp_is_blog_page() || bp_is_component_front_page('activity') && bp_is_front_page()) {
nxt_enqueue_style('achievements-directory', plugins_url('/css/directory.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
nxt_print_styles();
return;
}
if (DPA_SLUG_CREATE == $bp->current_action && dpa_permission_can_user_create() || DPA_SLUG_ACHIEVEMENT_EDIT == $bp->current_action && dpa_permission_can_user_edit() || DPA_SLUG_ACHIEVEMENT_CHANGE_PICTURE == $bp->current_action && dpa_permission_can_user_change_picture() || DPA_SLUG_ACHIEVEMENT_GRANT == $bp->current_action && dpa_permission_can_user_grant()) {
nxt_enqueue_style('achievements-admin', plugins_url('/css/admin.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
if ($bp->is_single_item) {
nxt_enqueue_style('achievements-detail', plugins_url('/css/detail.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
} else {
nxt_enqueue_style('achievements-directory', plugins_url('/css/directory.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
nxt_print_styles();
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:29,代码来源:achievements-cssjs.php
示例10: wp_title
wp_title('|', true, 'right');
bloginfo('name');
?>
</title>
<?php
do_action('bp_head');
?>
<link rel="pingback" href="<?php
bloginfo('pingback_url');
?>
" />
<?php
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_head();
?>
</head>
<body <?php
body_class();
?>
id="bp-default">
<?php
do_action('bp_before_header');
?>
开发者ID:adisonc,项目名称:MaineLearning,代码行数:30,代码来源:header.php
示例11: _bp_maybe_remove_rel_canonical
/**
* Remove WP's rel=canonical HTML tag if we are trying to load BP-specific content.
*
* This function should be considered temporary, and may be removed without
* notice in future versions of BuddyPress.
*
* @since 1.6.0
*/
function _bp_maybe_remove_rel_canonical()
{
if (!bp_is_blog_page() && !is_404()) {
remove_action('wp_head', 'rel_canonical');
add_action('bp_head', 'bp_rel_canonical');
}
}
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:15,代码来源:bp-core-catchuri.php
示例12: bp_dtheme_add_blog_comments_js
/**
* In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
* As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
*
* @deprecated 1.5
* @deprecated Enqueue the comment-reply script in your theme's header.php.
* @since 1.2
*/
function bp_dtheme_add_blog_comments_js()
{
_deprecated_function(__FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php.");
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
nxt_enqueue_script('comment-reply');
}
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:15,代码来源:1.5.php
示例13: bp_maybe_load_mentions_scripts_for_blog_content
/**
* Should BuddyPress load the mentions scripts and related assets, including results to prime the
* mentions suggestions?
*
* @param bool $load_mentions True to load mentions assets, false otherwise.
* @param bool $mentions_enabled True if mentions are enabled.
* @return bool True if mentions scripts should be loaded.
* @since BuddyPress (2.2.0)
*/
function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled ) {
if ( ! $mentions_enabled ) {
return $load_mentions;
}
if ( $load_mentions || ( bp_is_blog_page() && is_singular() && comments_open() ) ) {
return true;
}
return $load_mentions;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:20,代码来源:bp-core-filters.php
示例14: bp_activity_maybe_load_mentions_scripts
/**
* Should BuddyPress load the mentions scripts and related assets, including results to prime the
* mentions suggestions?
*
* @return bool True if mentions scripts should be loaded.
* @since BuddyPress (2.1.0)
*/
function bp_activity_maybe_load_mentions_scripts()
{
$retval = bp_activity_do_mentions() && bp_is_user_active() && (bp_is_activity_component() || bp_is_blog_page() && is_singular() && comments_open() || is_admin());
return (bool) apply_filters('bp_activity_maybe_load_mentions_scripts', $retval);
}
开发者ID:eresyyl,项目名称:mk,代码行数:12,代码来源:bp-activity-functions.php
示例15: bp_core_catch_no_access
/**
* Catches invalid access to BuddyPress pages and redirects them accordingly.
*
* @package BuddyPress Core
* @since 1.5
*/
function bp_core_catch_no_access()
{
global $bp, $bp_no_status_set, $nxt_query;
// If bp_core_redirect() and $bp_no_status_set is true,
// we are redirecting to an accessible page, so skip this check.
if ($bp_no_status_set) {
return false;
}
if (!isset($nxt_query->queried_object) && !bp_is_blog_page()) {
bp_do_404();
}
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:18,代码来源:bp-core-catchuri.php
示例16: yoast_breadcrumb
?>
<div class="container-wrap">
<div class="container main-content">
<div class="row">
<?php
//breadcrumbs
if (function_exists('yoast_breadcrumb') && !is_home() && !is_front_page()) {
yoast_breadcrumb('<p id="breadcrumbs">', '</p>');
}
//buddypress
global $bp;
if ($bp && !bp_is_blog_page()) {
echo '<h1>' . get_the_title() . '</h1>';
}
?>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<?php
the_content();
?>
<?php
开发者ID:The-Keep-Studios,项目名称:tks-website,代码行数:31,代码来源:page.php
示例17: show_footer_button
/**
* Whether to show the blog footer buttons.
*
* @return bool Defaults to true. False when on BP root blog and not on a blog
* page deemed by BuddyPress.
*/
public static function show_footer_button()
{
$retval = true;
// @todo might need to tweak this a bit...
if (bp_is_root_blog() && !bp_is_blog_page()) {
$retval = false;
}
return apply_filters('bp_follow_blogs_show_footer_button', $retval);
}
开发者ID:vikramshaw,项目名称:buddypress-followers,代码行数:15,代码来源:blogs.php
示例18: enqueue_scripts
/**
* Enqueue the required JavaScript files
*
* @since BuddyPress (1.7)
*/
public function enqueue_scripts()
{
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
// Locate the BP JS file
$asset = $this->locate_asset_in_stack("buddypress{$min}.js", 'js');
// Enqueue the global JS, if found - AJAX will not work
// without it
if (isset($asset['location'], $asset['handle'])) {
wp_enqueue_script($asset['handle'], $asset['location'], bp_core_get_js_dependencies(), $this->version);
}
/**
* Filters core JavaScript strings for internationalization before AJAX usage.
*
* @since BuddyPress (2.0.0)
*
* @param array $value Array of key/value pairs for AJAX usage.
*/
$params = apply_filters('bp_core_get_js_strings', array('accepted' => __('Accepted', 'buddypress'), 'close' => __('Close', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'leave_group_confirm' => __('Are you sure you want to leave this group?', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'my_favs' => __('My Favorites', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_x_comments' => __('Show all %d comments', 'buddypress'), 'unsaved_changes' => __('Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress'), 'view' => __('View', 'buddypress')));
wp_localize_script($asset['handle'], 'BP_DTheme', $params);
// Maybe enqueue comment reply JS
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
// Maybe enqueue password verify JS (register page or user settings page)
if (bp_is_register_page() || function_exists('bp_is_user_settings_general') && bp_is_user_settings_general()) {
// Locate the Register Page JS file
$asset = $this->locate_asset_in_stack("password-verify{$min}.js", 'js', 'bp-legacy-password-verify');
$dependencies = array_merge(bp_core_get_js_dependencies(), array('password-strength-meter'));
// Enqueue script
wp_enqueue_script($asset['handle'] . '-password-verify', $asset['location'], $dependencies, $this->version);
}
// Star private messages
if (bp_is_active('messages', 'star') && bp_is_user_messages()) {
wp_localize_script($asset['handle'], 'BP_PM_Star', array('strings' => array('text_unstar' => __('Unstar', 'buddypress'), 'text_star' => __('Star', 'buddypress'), 'title_unstar' => __('Starred', 'buddypress'), 'title_star' => __('Not starred', 'buddypress'), 'title_unstar_thread' => __('Remove all starred messages in this thread', 'buddypress'), 'title_star_thread' => __('Star the first message in this thread', 'buddypress')), 'is_single_thread' => (int) bp_is_messages_conversation(), 'star_counter' => 0, 'unstar_counter' => 0));
}
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:41,代码来源:buddypress-functions.php
示例19: bp_dtheme_enqueue_scripts
/**
* Enqueue theme javascript safely
*
* @see http://codex.wordpress.org/Function_Reference/wp_enqueue_script
* @since BuddyPress (1.5)
*/
function bp_dtheme_enqueue_scripts()
{
// Enqueue various scripts
wp_enqueue_script('bp-jquery-query');
wp_enqueue_script('bp-jquery-cookie');
// Enqueue scrollTo only on activity pages
if (bp_is_activity_component()) {
wp_enqueue_script('bp-jquery-scroll-to');
}
// A similar check is done in BP_Core_Members_Widget, but due to a load order
// issue, we do it again here
if (is_active_widget(false, false, 'bp_core_members_widget') && !is_admin() && !is_network_admin()) {
wp_enqueue_script('bp-widget-members');
}
// Enqueue the global JS - Ajax will not work without it
wp_enqueue_script('dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array('jquery'), bp_get_version());
// Add words that we need to use in JS to the end of the page so they can be translated and still used.
$params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_x_comments' => __('Show all %d comments', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'view' => __('View', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress'), 'unsaved_changes' => __('Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress'));
wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params);
// Maybe enqueue comment reply JS
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:30,代码来源:functions.php
示例20: dttheme_public_title
/** dttheme_public_title()
* Objective:
* Outputs the value for <title></title> in front end.
*
**/
function dttheme_public_title()
{
global $post;
$doctitle = '';
$separator = dttheme_wp_kses(dttheme_option('seo', 'title-delimiter'));
$split = true;
$args = array("blog_title" => preg_replace("~(?:\\[/?)[^/\\]]+/?\\]~s", '', get_option('blogname')), "blog_description" => get_bloginfo('description'), "post_title" => !empty($post) ? $post->post_title : NULL, "post_author_nicename" => !empty($nickname) ? ucwords($nickname) : NULL, "post_author_firstname" => !empty($first_name) ? ucwords($first_name) : NULL, "post_author_lastname" => !empty($last_name) ? ucwords($last_name) : NULL, "post_author_dsiplay" => !empty($display_name) ? ucwords($display_name) : NULL);
$args = array_filter($args);
if (class_exists('BP_Core_user') && !bp_is_blog_page()) {
$doctitle = dt_theme_bbpress_title();
} elseif (function_exists('is_bbpress') && is_bbpress()) {
$doctitle = dt_theme_bbpress_title();
} elseif (is_home() || is_front_page()) {
$doctitle = "";
if (get_option('page_on_front') != 0 && get_option('page_on_front') == $post->ID) {
$doctitle = trim(get_post_meta($post->ID, '_seo_title', true));
}
$doctitle = !empty($doctitle) ? trim($doctitle) : $args["blog_title"];
$doctitle = array_key_exists("blog_description", $args) ? $doctitle . ' ' . $separator . ' ' . $args["blog_description"] : $doctitle;
if (dttheme_option('onepage', 'seo-title')) {
$doctitle = dttheme_option('onepage', 'seo-title');
}
$split = false;
} elseif (is_page()) {
$doctitle = get_post_meta($post->ID, '_seo_title', true);
if (empty($doctitle)) {
$options = is_array(dttheme_option('seo', 'page-title-format')) ? dttheme_option('seo', 'page-title-format') : array();
foreach ($options as $option) {
if (array_key_exists($option, $args)) {
$doctitle .= $args[$option] . ' ' . $separator . ' ';
}
}
}
} elseif (is_single()) {
$doctitle = get_post_meta($post->ID, '_seo_title', true);
if (empty($doctitle)) {
// o add categories in $args
$categories = get_the_category();
$c = '';
foreach ($categories as $category) {
$c .= $category->name . ' ' . $separator . ' ';
}
$c = substr(trim($c), "0", strlen(trim($c)) - 1);
$args["category_title"] = $c;
// nd of adding categories in $args
// o add tags in $args
$posttags = get_the_tags();
$ptags = '';
if ($posttags) {
foreach ($posttags as $posttag) {
$ptags .= $posttag->name . $separator;
}
$ptags = substr(trim($ptags), "0", strlen(trim($ptags)) - 1);
$args["tag_title"] = $ptags;
}
// nd of adding tags in $args
$options = is_array(dttheme_option('seo', 'post-title-format')) ? dttheme_option('seo', 'post-title-format') : array();
foreach ($options as $option) {
if (array_key_exists($option, $args)) {
$doctitle .= $args[$option] . ' ' . $separator . ' ';
}
}
}
} elseif (is_category()) {
$categories = get_the_category();
// o add category description into $args
$args["category_title"] = $categories[0]->name;
$args["category_desc"] = $categories[0]->description;
// nd of adding category description into $args
$options = is_array(dttheme_option('seo', 'category-page-title-format')) ? dttheme_option('seo', 'category-page-title-format') : array();
foreach ($options as $option) {
if (array_key_exists($option, $args)) {
$doctitle .= $args[$option] . ' ' . $separator . ' ';
}
}
} elseif (is_tag()) {
$args["tag"] = single_tag_title('', FALSE);
$options = is_array(dttheme_option('seo', 'tag-page-title-format')) ? dttheme_option('seo', 'tag-page-title-format') : array();
foreach ($options as $option) {
if (array_key_exists($option, $args)) {
$doctitle .= $args[$option] . ' ' . $separator . ' ';
}
}
} elseif (is_archive()) {
$title = wp_title(" ", false);
$find = $args['blog_title'];
$title = preg_replace(strrev("/{$find}/"), strrev(""), strrev($title), 1);
$title = strrev($title);
$args["date"] = $title;
$options = is_array(dttheme_option('seo', 'archive-page-title-format')) ? dttheme_option('seo', 'archive-page-title-format') : array();
foreach ($options as $option) {
if (array_key_exists($option, $args)) {
$doctitle .= $args[$option] . ' ' . $separator . ' ';
}
}
//.........这里部分代码省略.........
开发者ID:enlacee,项目名称:anb.platicom.com.pe,代码行数:101,代码来源:utils.php
注:本文中的bp_is_blog_page函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论