本文整理汇总了PHP中bp_is_messages_component函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_messages_component函数的具体用法?PHP bp_is_messages_component怎么用?PHP bp_is_messages_component使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_messages_component函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lsx_buddypress_page_columns
/**
* Forces the BP Profile Pages to be 1 Column
*
* @package lsx
* @subpackage jetpack
* @category infinite scroll
*/
function lsx_buddypress_page_columns($layout)
{
if (bp_is_profile_component() || bp_is_settings_component() || bp_is_activity_component() || bp_is_group() || bp_is_messages_component() || bp_is_members_directory() || bp_is_groups_directory() || bp_is_groups_component() || bp_is_members_component()) {
$layout = '1c';
}
return $layout;
}
示例2: messages_add_autocomplete_css
/**
* Enqueue the CSS for messages autocomplete.
*
* @todo Why do we call wp_print_styles()?
*/
function messages_add_autocomplete_css()
{
if (bp_is_messages_component() && bp_is_current_action('compose')) {
wp_enqueue_style('bp-messages-autocomplete');
wp_print_styles();
}
}
示例3: messages_add_autocomplete_css
function messages_add_autocomplete_css()
{
if (bp_is_messages_component() && bp_is_current_action('compose')) {
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style('bp-messages-autocomplete', buddypress()->plugin_url . "bp-messages/css/autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version());
wp_print_styles();
}
}
示例4: messages_add_autocomplete_css
function messages_add_autocomplete_css()
{
if (bp_is_messages_component() && bp_is_current_action('compose')) {
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
wp_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), bp_get_version());
} else {
wp_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), bp_get_version());
}
wp_print_styles();
}
}
示例5: messages_add_autocomplete_css
function messages_add_autocomplete_css()
{
global $bp;
if (bp_is_messages_component() && bp_is_current_action('compose')) {
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
nxt_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), '20110723');
} else {
nxt_enqueue_style('bp-messages-autocomplete', BP_PLUGIN_URL . '/bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), '20110723');
}
nxt_print_styles();
}
}
示例6: messages_add_autocomplete_css
/**
* Enqueue the CSS for messages autocomplete.
*
* @todo Why do we call wp_print_styles()?
*/
function messages_add_autocomplete_css()
{
if (bp_is_messages_component() && bp_is_current_action('compose')) {
$min = bp_core_get_minified_asset_suffix();
$url = buddypress()->plugin_url . 'bp-messages/css/';
wp_enqueue_style('bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version());
wp_style_add_data('bp-messages-autocomplete', 'rtl', true);
if ($min) {
wp_style_add_data('bp-messages-autocomplete', 'suffix', $min);
}
wp_print_styles();
}
}
示例7: messages_screen_conversation
function messages_screen_conversation()
{
// Bail if not viewing a single message
if (!bp_is_messages_component() || !bp_is_current_action('view')) {
return false;
}
$thread_id = (int) bp_action_variable(0);
if (empty($thread_id) || !messages_is_valid_thread($thread_id) || !messages_check_thread_access($thread_id) && !bp_current_user_can('bp_moderate')) {
bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug()));
}
// Load up BuddyPress one time
$bp = buddypress();
// Decrease the unread count in the nav before it's rendered
$bp->bp_nav[$bp->messages->slug]['name'] = sprintf(__('Messages <span>%s</span>', 'buddypress'), bp_get_total_unread_messages_count());
do_action('messages_screen_conversation');
bp_core_load_template(apply_filters('messages_template_view_message', 'members/single/home'));
}
示例8: messages_action_bulk_delete
function messages_action_bulk_delete()
{
if (!bp_is_messages_component() || !bp_is_action_variable('bulk-delete', 0)) {
return false;
}
$thread_ids = $_POST['thread_ids'];
if (!$thread_ids || !messages_check_thread_access($thread_ids)) {
bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
} else {
if (!check_admin_referer('messages_delete_thread')) {
return false;
}
if (!messages_delete_thread($thread_ids)) {
bp_core_add_message(__('There was an error deleting messages.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('Messages deleted.', 'buddypress'));
}
bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
}
}
示例9: messages_screen_conversation
/**
* Load an individual conversation screen.
*
* @since 1.0.0
*
* @return bool|null False on failure.
*/
function messages_screen_conversation()
{
// Bail if not viewing a single message.
if (!bp_is_messages_component() || !bp_is_current_action('view')) {
return false;
}
$thread_id = (int) bp_action_variable(0);
if (empty($thread_id) || !messages_is_valid_thread($thread_id) || !messages_check_thread_access($thread_id) && !bp_current_user_can('bp_moderate')) {
bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug()));
}
// Load up BuddyPress one time.
$bp = buddypress();
// Decrease the unread count in the nav before it's rendered.
$count = bp_get_total_unread_messages_count();
$class = 0 === $count ? 'no-count' : 'count';
$nav_name = sprintf(__('Messages <span class="%s">%s</span>', 'buddypress'), esc_attr($class), bp_core_number_format($count));
$bp->bp_nav[$bp->messages->slug]['name'] = $nav_name;
/**
* Fires right before the loading of the Messages view screen template file.
*
* @since 1.7.0
*/
do_action('messages_screen_conversation');
/**
* Filters the template to load for the Messages view screen.
*
* @since 1.0.0
*
* @param string $template Path to the messages template to load.
*/
bp_core_load_template(apply_filters('messages_template_view_message', 'members/single/home'));
}
示例10: bp_thread_has_messages
function bp_thread_has_messages($args = '')
{
global $thread_template;
$defaults = array('thread_id' => false, 'order' => 'ASC');
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
if (empty($thread_id) && bp_is_messages_component() && bp_is_current_action('view')) {
$thread_id = (int) bp_action_variable(0);
}
$thread_template = new BP_Messages_Thread_Template($thread_id, $order);
return $thread_template->has_messages();
}
示例11: miss_is_bp
/**
*
*/
function miss_is_bp()
{
if (function_exists('bp_is_group') && (bp_is_blog_page() || bp_is_my_profile() || bp_is_my_profile() || is_front_page() || bp_is_component_front_page('activity') || bp_is_directory() || bp_is_profile_component() || bp_is_activity_component() || bp_is_blogs_component() || bp_is_messages_component() || bp_is_friends_component() || bp_is_groups_component() || bp_is_settings_component() || bp_is_user_activity() || bp_is_user_friends_activity() || bp_is_activity_permalink() || bp_is_user_profile() || bp_is_profile_edit() || bp_is_change_avatar() || bp_is_user_groups() || bp_is_group() || bp_is_group_home() || bp_is_group_create() || bp_is_group_admin_page() || bp_is_group_forum() || bp_is_group_activity() || bp_is_group_forum_topic() || bp_is_group_forum_topic_edit() || bp_is_group_members() || bp_is_group_invites() || bp_is_group_membership_request() || bp_is_group_leave() || bp_is_group_single() || bp_is_user_blogs() || bp_is_user_recent_posts() || bp_is_user_recent_commments() || bp_is_create_blog() || bp_is_user_friends() || bp_is_friend_requests() || bp_is_user_messages() || bp_is_messages_inbox() || bp_is_messages_sentbox() || bp_is_notices() || bp_is_messages_compose_screen() || bp_is_activation_page() || bp_is_register_page())) {
return true;
}
return false;
}
示例12: bp_thread_has_messages
/**
* Initialize the messages template loop for a specific thread.
*
* @param array $args {
* Array of arguments. All are optional.
* @type int $thread_id ID of the thread whose messages you are displaying.
* Default: if viewing a thread, the thread ID will be parsed from
* the URL (bp_action_variable( 0 )).
* @type string $order 'ASC' or 'DESC'. Default: 'ASC'.
* }
* @return bool True if there are messages to display, otherwise false.
*/
function bp_thread_has_messages($args = '')
{
global $thread_template;
$r = bp_parse_args($args, array('thread_id' => false, 'order' => 'ASC'), 'thread_has_messages');
if (empty($r['thread_id']) && bp_is_messages_component() && bp_is_current_action('view')) {
$r['thread_id'] = (int) bp_action_variable(0);
}
$thread_template = new BP_Messages_Thread_Template($r['thread_id'], $r['order']);
return $thread_template->has_messages();
}
示例13: sidebar_right
/**
* footer: add the sidebar and their default widgets to the right sidebar
*
* located: footer.php do_action( 'sidebar_left' )
*
* @package Custom Community
* @since 1.8.3
*/
function sidebar_right()
{
global $cap, $post, $bp;
$tmp = !empty($post) ? get_post_meta($post->ID, '_wp_page_template', true) : '';
if (defined('BP_VERSION') && bp_is_user() && ($cap->bp_profile_sidebars == __('none', 'cc') || $cap->bp_profile_sidebars == __('left', 'cc'))) {
return;
}
if (defined('BP_VERSION') && bp_is_group() && ($cap->bp_groups_sidebars == __('none', 'cc') || $cap->bp_groups_sidebars == __('left', 'cc'))) {
return;
}
if (function_exists('is_bbpress') && (is_bbpress() && defined('BP_VERSION') && !bp_is_user() && !bp_is_group()) && ($cap->sidebar_position == __('left', 'cc') || $cap->sidebar_position == __('full-width', 'cc'))) {
return;
} else {
if (function_exists('is_bbpress') && (is_bbpress() && defined('BP_VERSION') && !bp_is_user() && !bp_is_group()) && ($cap->sidebar_position == __('right', 'cc') || $cap->sidebar_position == __('left and right', 'cc'))) {
locate_template(array('sidebar.php'), true);
return;
}
}
if ($tmp == 'full-width.php' || $tmp == 'tpl-search-full-width.php' || $tmp == 'left-sidebar.php' || $tmp == '_pro/tpl-left-sidebar.php') {
return;
}
if ($tmp == 'left-and-right-sidebar.php' || $tmp == 'right-sidebar.php' || $tmp == '_pro/tpl-left-and-right-sidebar.php' || $tmp == '_pro/tpl-search-right-and-left-sidebar.php' || $tmp == '_pro/tpl-right-sidebar.php' || $tmp == '_pro/tpl-search-right-sidebar.php') {
locate_template(array('sidebar.php'), true);
return;
}
$component = explode('-', $this->detect->tk_get_page_type());
if (!empty($component[2])) {
if ($component[2] == 'groups' && !empty($component[3]) && $bp->unfiltered_uri[0] != 'members') {
if ($cap->bp_groups_sidebars == 'right' || $cap->bp_groups_sidebars == __('right', 'cc') || $cap->bp_groups_sidebars == 'left and right' || $cap->bp_groups_sidebars == __('left and right', 'cc')) {
locate_template(array('groups/single/group-sidebar-right.php'), true);
} elseif (($cap->bp_groups_sidebars == "default" || $cap->bp_groups_sidebars == __("default", 'cc')) && ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc')) || ($cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) && ($cap->bp_groups_sidebars == "default" || $cap->bp_groups_sidebars == __("default", 'cc'))) {
locate_template(array('sidebar.php'), true);
}
return;
} elseif ($bp->unfiltered_uri[0] == 'members' || bp_is_activity_component() || bp_is_profile_component() || bp_is_messages_component() || bp_is_friends_component() || bp_is_settings_component()) {
if ($cap->bp_profile_sidebars == 'right' || $cap->bp_profile_sidebars == __('right', 'cc') || $cap->bp_profile_sidebars == 'left and right' || $cap->bp_profile_sidebars == __('left and right', 'cc')) {
locate_template(array('members/single/member-sidebar-right.php'), true);
} elseif (($cap->bp_profile_sidebars == "default" || $cap->bp_profile_sidebars == __("default", 'cc')) && ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc')) || ($cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) && ($cap->bp_profile_sidebars == "default" || $cap->bp_profile_sidebars == __("default", 'cc'))) {
locate_template(array('sidebar.php'), true);
}
return;
} else {
if ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc') || $cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) {
locate_template(array('sidebar.php'), true);
return;
}
}
} elseif (empty($component[2]) && !is_archive() && !is_page()) {
if ($cap->sidebar_position == "right" || $cap->sidebar_position == __("right", 'cc') || $cap->sidebar_position == "left and right" || $cap->sidebar_position == __("left and right", 'cc')) {
locate_template(array('sidebar.php'), true);
return;
}
}
$cap->archive_template = $cap->archive_template == 'full-width' && defined('is_pro') ? $cap->archive_template : $cap->sidebar_position;
if (is_archive() && ($cap->archive_template == "right" || $cap->archive_template == "left and right" || $cap->archive_template == __("right", 'cc') || $cap->archive_template == __("left and right", 'cc'))) {
locate_template(array('sidebar.php'), true);
return;
} else {
if (!is_page() && ($cap->archive_template == "left" || $cap->archive_template == __("left", 'cc') || $cap->archive_template == 'full-width' || $cap->archive_template == __('full-width', 'cc'))) {
return;
}
}
if ($cap->sidebar_position == __('left and right', 'cc') || $cap->sidebar_position == __('right', 'cc')) {
locate_template(array('sidebar.php'), true);
return;
}
}
示例14: bp_get_the_body_class
/**
* Customize the body class, according to the currently displayed BP content.
*
* Uses the above is_() functions to output a body class for each scenario.
*
* @since 1.1.0
*
* @param array $wp_classes The body classes coming from WP.
* @param array|bool $custom_classes Classes that were passed to get_body_class().
* @return array $classes The BP-adjusted body classes.
*/
function bp_get_the_body_class($wp_classes = array(), $custom_classes = false)
{
$bp_classes = array();
/* Pages *************************************************************/
if (is_front_page()) {
$bp_classes[] = 'home-page';
}
if (bp_is_directory()) {
$bp_classes[] = 'directory';
}
if (bp_is_single_item()) {
$bp_classes[] = 'single-item';
}
/* Components ********************************************************/
if (!bp_is_blog_page()) {
if (bp_is_user_profile()) {
$bp_classes[] = 'xprofile';
}
if (bp_is_activity_component()) {
$bp_classes[] = 'activity';
}
if (bp_is_blogs_component()) {
$bp_classes[] = 'blogs';
}
if (bp_is_messages_component()) {
$bp_classes[] = 'messages';
}
if (bp_is_friends_component()) {
$bp_classes[] = 'friends';
}
if (bp_is_groups_component()) {
$bp_classes[] = 'groups';
}
if (bp_is_settings_component()) {
$bp_classes[] = 'settings';
}
}
/* User **************************************************************/
if (bp_is_user()) {
$bp_classes[] = 'bp-user';
// Add current user member types.
if ($member_types = bp_get_member_type(bp_displayed_user_id(), false)) {
foreach ($member_types as $member_type) {
$bp_classes[] = sprintf('member-type-%s', esc_attr($member_type));
}
}
}
if (!bp_is_directory()) {
if (bp_is_user_blogs()) {
$bp_classes[] = 'my-blogs';
}
if (bp_is_user_groups()) {
$bp_classes[] = 'my-groups';
}
if (bp_is_user_activity()) {
$bp_classes[] = 'my-activity';
}
} else {
if (bp_get_current_member_type()) {
$bp_classes[] = 'type';
}
}
if (bp_is_my_profile()) {
$bp_classes[] = 'my-account';
}
if (bp_is_user_profile()) {
$bp_classes[] = 'my-profile';
}
if (bp_is_user_friends()) {
$bp_classes[] = 'my-friends';
}
if (bp_is_user_messages()) {
$bp_classes[] = 'my-messages';
}
if (bp_is_user_recent_commments()) {
$bp_classes[] = 'recent-comments';
}
if (bp_is_user_recent_posts()) {
$bp_classes[] = 'recent-posts';
}
if (bp_is_user_change_avatar()) {
$bp_classes[] = 'change-avatar';
}
if (bp_is_user_profile_edit()) {
$bp_classes[] = 'profile-edit';
}
if (bp_is_user_friends_activity()) {
$bp_classes[] = 'friends-activity';
}
//.........这里部分代码省略.........
示例15: assets
/**
* Load css/js files
*
* @since 1.0.0
* @return void
*/
public function assets()
{
wp_enqueue_style('jquery-ui', $this->assets_url . '/css/jquery-ui.min.css', '1.11.2');
// wp_enqueue_style( 'buddypress-global-search', $this->assets_url . '/css/buddypress-global-search.css', '1.1.1' );
wp_enqueue_style('buddypress-global-search', $this->assets_url . '/css/buddypress-global-search.min.css', '1.1.1');
wp_enqueue_script('jquery-ui-autocomplete');
//wp_enqueue_script( 'buddypress-global-search', $this->assets_url . '/js/buddypress-global-search.js', array( 'jquery', 'jquery-ui-autocomplete' ), '1.0.4', true );
wp_enqueue_script('buddypress-global-search', $this->assets_url . '/js/buddypress-global-search.min.js', array('jquery', 'jquery-ui-autocomplete'), '1.0.4', true);
if (function_exists("bp_is_messages_component")) {
// Include the autocomplete JS for composing a message.
if (bp_is_messages_component() && bp_is_current_action('compose')) {
add_action('wp_head', array($this, 'messages_autocomplete_init_jsblock'));
}
}
$data = array('nonce' => wp_create_nonce('bboss_global_search_ajax'), 'action' => 'bboss_global_search_ajax', 'debug' => true, 'search_url' => home_url('/'), 'loading_msg' => __("Loading Suggestions", "buddypress-global-search"), 'enable_ajax_search' => $this->option('enable-ajax-search'));
if (isset($_GET["s"])) {
$data["search_term"] = $_GET["s"];
}
wp_localize_script('buddypress-global-search', 'BBOSS_GLOBAL_SEARCH', $data);
}