本文整理汇总了PHP中bp_register_group_extension函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_register_group_extension函数的具体用法?PHP bp_register_group_extension怎么用?PHP bp_register_group_extension使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_register_group_extension函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* PHP 5 constructor
*
* @package BuddyPress Docs
* @since 1.0-beta
*/
function __construct()
{
bp_register_group_extension('BP_Docs_Group_Extension');
// Filter some properties of the query object
add_filter('bp_docs_get_item_type', array($this, 'get_item_type'));
add_filter('bp_docs_get_current_view', array($this, 'get_current_view'), 10, 2);
add_filter('bp_docs_this_doc_slug', array($this, 'get_doc_slug'));
// Taxonomy helpers
add_filter('bp_docs_taxonomy_get_item_terms', array($this, 'get_group_terms'));
add_action('bp_docs_taxonomy_save_item_terms', array($this, 'save_group_terms'));
// Filter the core user_can_edit function for group-specific functionality
add_filter('bp_docs_user_can', array($this, 'user_can'), 10, 3);
// Add group-specific settings to the doc settings box
add_filter('bp_docs_doc_settings_markup', array($this, 'doc_settings_markup'));
// Filter the activity actions for group docs-related activity
add_filter('bp_docs_activity_action', array($this, 'activity_action'), 10, 5);
add_filter('bp_docs_comment_activity_action', array($this, 'comment_activity_action'), 10, 5);
// Filter the activity hide_sitewide parameter to respect group privacy levels
add_filter('bp_docs_hide_sitewide', array($this, 'hide_sitewide'), 10, 5);
// These functions are used to keep the group Doc count up to date
add_filter('bp_docs_doc_saved', array($this, 'update_doc_count'));
add_filter('bp_docs_doc_deleted', array($this, 'update_doc_count'));
// Sneak into the nav before it's rendered to insert the group Doc count. Hooking
// to bp_actions because of the craptastic nature of the BP_Group_Extension loader
add_action('bp_actions', array($this, 'show_doc_count_in_tab'), 9);
// Prettify the page title
add_filter('bp_page_title', array($this, 'page_title'));
}
示例2: __construct
/**
* Constructor
*
* @package CollabPress
* @subpackage CP BP
* @since 1.2
*/
function __construct()
{
global $bp;
parent::start('collabpress', __('CollabPress', 'collabpress'), COLLABPRESS_PLUGIN_DIR);
// Register ourselves as an active BP component
$bp->active_components['collabpress'] = '1';
add_filter('bp_get_template_stack', array($this, 'add_cp_to_template_stack'));
// Register BP-specific taxonomies
$this->register_taxonomies();
// Set up the CP query
add_action('cp_bp_setup_item', array(&$this, 'do_cp_query'), 5);
// Load the notification framework
require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-notifications.php';
// Load the Groups integration, if active
if (bp_is_active('groups')) {
require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-groups.php';
bp_register_group_extension('CP_BP_Group_Extension');
}
// Add the admin menus
add_action('cp_after_advanced_settings', array(&$this, 'render_settings'));
// Todo: this MUST check to see whether we're in a BP context!!
add_filter('cp_calendar_permalink', array($this, 'filter_cp_calendar_permalink'), 10, 4);
add_filter('post_type_link', array(&$this, 'filter_permalinks'), 10, 4);
add_filter('cp_task_list_link', array(&$this, 'filter_item_link'), 10, 3);
add_filter('cp_task_link', array(&$this, 'filter_item_link'), 10, 3);
add_action('cp_project_added', array(&$this, 'mark_post_in_group'));
add_action('wp_print_styles', array(&$this, 'enqueue_styles'));
}
示例3: buddyforms_pig_init
function buddyforms_pig_init()
{
$buddyforms_pig = get_option('buddyforms_pig_options');
require dirname(__FILE__) . '/includes/functions.php';
if ($buddyforms_pig['permission'] != 'disabled') {
require dirname(__FILE__) . '/includes/buddyforms-post-in-groups.php';
bp_register_group_extension('BuddyForms_Post_in_Groups');
}
}
示例4: init
/**
*
* @since 0.0.1
* @access public
* @static
*/
function init()
{
bp_register_group_extension('RW_Group_Blogs_Extension');
add_action('bp_get_activity_avatar_item_id', array('RW_Group_Blogs_Core', 'activity_avatar_id'));
add_action('bp_get_activity_avatar_object_groups', array('RW_Group_Blogs_Core', 'activity_avatar_type'));
add_action('bp_get_activity_avatar_object_activity', array('RW_Group_Blogs_Core', 'activity_avatar_type'));
add_action('bp_group_activity_filter_options', array('RW_Group_Blogs_Core', 'activity_add_filter'));
add_action('bp_activity_filter_options', array('RW_Group_Blogs_Core', 'activity_add_filter'));
add_action('groups_screen_group_home', array('RW_Group_Blogs_Core', 'refetch'));
add_action('wp_ajax_refetch_groupblogs', array('RW_Group_Blogs_Core', 'ajax_refresh'));
add_action('rw_group_blogs_cron', array('RW_Group_Blogs_Core', 'cron_refresh'));
}
示例5: wpmudev_chat_buddypress_init
function wpmudev_chat_buddypress_init()
{
if (class_exists('BP_Group_Extension')) {
if (version_compare(bp_get_version(), "1.8") >= 0) {
include_once 'buddypress/wpmudec_chat_buddypress_group_1.8.php';
} else {
include_once 'buddypress/wpmudec_chat_buddypress_group_1.7.2.php';
}
if (class_exists('WPMUDEV_Chat_BuddyPress')) {
bp_register_group_extension('WPMUDEV_Chat_BuddyPress');
}
}
}
示例6: __construct
/**
* Constructor
*
* @since 1.0-beta
*/
function __construct()
{
if (class_exists('BP_Group_Extension')) {
$group_extension_class = apply_filters('bp_docs_group_extension_class_name', 'BP_Docs_Group_Extension');
bp_register_group_extension($group_extension_class);
}
// Filter some properties of the query object
add_filter('bp_docs_get_item_type', array($this, 'get_item_type'));
add_filter('bp_docs_get_current_view', array($this, 'get_current_view'), 10, 2);
add_filter('bp_docs_this_doc_slug', array($this, 'get_doc_slug'));
add_filter('bp_docs_pre_query_args', array($this, 'pre_query_args'), 10, 2);
// Taxonomy helpers
add_filter('bp_docs_taxonomy_get_item_terms', array($this, 'get_group_terms'));
// Filter the core user_can_edit function for group-specific functionality
add_filter('bp_docs_user_can', array($this, 'user_can'), 10, 4);
// Add group-specific options to the access options dropdowns
add_filter('bp_docs_get_access_options', array($this, 'get_access_options'), 10, 4);
// Filter the activity actions for group docs-related activity
add_filter('bp_docs_activity_action', array($this, 'activity_action'), 10, 5);
add_filter('bp_docs_activity_args', array($this, 'activity_args'), 10, 2);
add_filter('bp_docs_comment_activity_action', array($this, 'comment_activity_action'), 10, 5);
// Filter the activity hide_sitewide parameter to respect group privacy levels
add_filter('bp_docs_hide_sitewide', array($this, 'hide_sitewide'), 10, 5);
// These functions are used to keep the group Doc count up to date
add_filter('bp_docs_doc_saved', array($this, 'update_doc_count'));
add_filter('bp_docs_doc_deleted', array($this, 'update_doc_count'));
// On non-group Doc directories, add a Groups column
add_filter('bp_docs_loop_additional_th', array($this, 'groups_th'), 5);
add_filter('bp_docs_loop_additional_td', array($this, 'groups_td'), 5);
// On group Doc directories, add the "Unlink from Group" action link
add_filter('bp_docs_doc_action_links', array($this, 'add_doc_action_unlink_from_group_link'), 10, 2);
// On group Doc directories, modify the pagination base so that pagination works within the directory.
add_filter('bp_docs_page_links_base_url', array($this, 'filter_bp_docs_page_links_base_url'), 10, 2);
// Update group last active metadata when a doc is created, updated, or saved
add_filter('bp_docs_after_save', array($this, 'update_group_last_active'));
add_filter('bp_docs_before_doc_delete', array($this, 'update_group_last_active'));
add_filter('wp_insert_comment', array($this, 'update_group_last_active_comment'), 10, 2);
// Sneak into the nav before it's rendered to insert the group Doc count. Hooking
// to bp_actions because of the craptastic nature of the BP_Group_Extension loader
// @todo Temporarily disabled
//add_action( 'bp_actions', array( $this, 'show_doc_count_in_tab' ), 9 );
// Prettify the page title
add_filter('bp_page_title', array($this, 'page_title'));
// Make sure the Create Doc link points to the right place
add_filter('bp_docs_get_create_link', array($this, 'get_create_link'));
// When object terms are set, delete the transient
add_action('set_object_terms', array(&$this, 'delete_transient'), 10, 4);
// Set the "last directory viewed" cookie when viewing a group docs directory.
add_action('bp_actions', array($this, 'set_directory_cookie'));
}
示例7: __construct
function __construct()
{
global $rtmedia;
$options = $rtmedia->options;
if (isset($options['buddypress_enableOnGroup']) && $options['buddypress_enableOnGroup'] == "1") {
// return;
$extension = true;
if (isset($options['general_enableAlbums']) && $options['general_enableAlbums'] == 0) {
$extension = false;
}
$extension = apply_filters('rtmedia_group_media_extension', $extension);
if (!$extension) {
return;
}
} else {
return;
}
if (function_exists("bp_is_active") && bp_is_active("groups")) {
bp_register_group_extension("RTMediaGroupExtension");
}
}
示例8: __construct
function __construct()
{
global $rtmedia;
$options = $rtmedia->options;
if (isset($options['buddypress_enableOnGroup']) && 1 === intval($options['buddypress_enableOnGroup'])) {
// return;
$extension = true;
if (isset($options['general_enableAlbums']) && 0 === intval($options['general_enableAlbums'])) {
$extension = false;
}
$extension = apply_filters('rtmedia_group_media_extension', $extension);
if (!$extension) {
return;
}
} else {
return;
}
if (function_exists('bp_is_active') && bp_is_active('groups') && class_exists('BP_Group_Extension')) {
bp_register_group_extension('RTMediaGroupExtension');
}
}
示例9: wp_update_term
$term_array = wp_update_term($existing_term_id, 'ccgn_related_groups', $term_args);
} else {
$term_args['slug'] = ccgn_create_taxonomy_slug($group_id);
$term_array = wp_insert_term($group_name, 'ccgn_related_groups', $term_args);
}
}
// End "is_enabled" check
// $towrite = PHP_EOL . 'submitted: ' . print_r($_POST['tax_input']['ccgn_related_groups'], TRUE);
// $towrite .= PHP_EOL . 'this group term: ' . print_r($term_array['term_id'], TRUE);
// $fp = fopen('narrative-taxonomy.txt', 'a');
// fwrite($fp, $towrite);
// fclose($fp);
// Next, handle relating the group to the right taxonomy terms
// Make sure that this group is always included - otherwise once the narrative is created it might disappear from the front end
// TODO: If only site admins can add terms, we may not want to change this unless the submitter is a site admin.
$group_relations = ccgn_add_this_group_term($_POST['tax_input']['ccgn_related_groups'], $term_array['term_id']);
// $towrite = PHP_EOL . 'ready to save: ' . print_r($group_relations, TRUE);
// $fp = fopen('narrative-taxonomy.txt', 'a');
// fwrite($fp, $towrite);
// fclose($fp);
if (!ccgn_update_categories($group_id, $group_relations) || !ccgn_update_groupmeta($group_id)) {
// @TODO: This might be returning a false positive error - meta and cat updates are weird.
bp_core_add_message(__('There was an error updating the Group Narratives settings, please try again.', 'ccgn'), 'error');
} else {
bp_core_add_message(__('Group Narratives settings were successfully updated.', 'ccgn'));
}
// Redirect to the (possibly) new admin slug
}
}
bp_register_group_extension('CC_Group_Narratives_Extension');
}
示例10: do_action
</div><!-- .activity.single-group -->
<?php
do_action('bp_after_group_places_content');
?>
<?php
}
?>
<?php
}
function widget_display()
{
return false;
}
function enable_nav_item()
{
global $bp;
if (empty($bp->groups->current_group->id)) {
return false;
}
if (groups_get_groupmeta($bp->groups->current_group->id, 'checkins_ok')) {
return true;
} else {
return false;
}
}
}
bp_register_group_extension('Bp_Checkins_Group');
示例11: extract
extract($r, EXTR_SKIP);
if (empty($score)) {
return false;
}
// First record the activity meta for this particular rating
bp_activity_update_meta($activity_id, 'bpgr_rating', $score);
// Then add this item to the list of reviews for this group
if (!($ratings = groups_get_groupmeta($group_id, 'bpgr_ratings'))) {
$ratings = array();
}
$ratings[$activity_id] = $score;
// Pull the composite scores and recalculate
if (!($rating = groups_get_groupmeta($group_id, 'bpgr_rating'))) {
$avg_score = 0;
}
if (!($how_many = (int) groups_get_groupmeta($group_id, 'bpgr_how_many_ratings'))) {
$how_many = 0;
}
$how_many++;
groups_update_groupmeta($group_id, 'bpgr_how_many_ratings', $how_many);
$raw_score = 0;
foreach ($ratings as $score) {
$raw_score += (int) $score;
}
$rating = $raw_score / $how_many;
groups_update_groupmeta($group_id, 'bpgr_rating', $rating);
groups_update_groupmeta($group_id, 'bpgr_ratings', $ratings);
}
}
bp_register_group_extension('BP_Group_Reviews_Extension');
示例12: setup_components
/**
* Instantiate classes for BuddyPress integration
*
* @since bbPress (r3395)
*/
public function setup_components()
{
// Always load the members component
bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members();
// Create new activity class
if (bp_is_active('activity')) {
bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity();
}
// Register the group extension only if groups are active
if (bbp_is_group_forums_active() && bp_is_active('groups')) {
bp_register_group_extension('BBP_Forums_Group_Extension');
}
}
示例13: dirname
{
return false;
}
}
// Determine the BP version. It's been historically difficult in this plugin, so provide
// a fallback when not found
if (defined('BP_VERSION')) {
$bpges_bp_version = (double) BP_VERSION;
} else {
// Let's guess
if (function_exists('bp_is_action_variable')) {
$bpges_bp_version = (double) '1.5';
} else {
$bpges_bp_version = (double) '1.2.10';
}
}
if ($bpges_bp_version < 1.5) {
// Pre-1.5 versions of BuddyPress
// Load the abstraction files, which define the necessary 1.5 functions
require_once dirname(__FILE__) . '/1.5-abstraction.php';
// Load the group extension in the legacy fashion
add_action('init', 'ass_activate_extension');
} else {
// Load the group extension in the proper fashion
bp_register_group_extension('Group_Activity_Subscription');
}
function ass_activate_extension()
{
$extension = new Group_Activity_Subscription();
add_action("wp", array(&$extension, "_register"), 2);
}
示例14: _e
_e('No group papers found.', 'social-paper');
?>
</p>
<?php
}
?>
</div>
<?php
}
}
// class ends
// register our class
bp_register_group_extension('CACSP_Group_Extension');
/**
* Register group connection taxonomy.
*
* Fires at init:15 to ensure we have a chance to register the 'cacsp_paper' post type first.
*/
function cacsp_register_group_connection_taxonomy()
{
register_taxonomy('cacsp_paper_group', 'cacsp_paper', array('public' => false));
}
add_action('init', 'cacsp_register_group_connection_taxonomy', 15);
/**
* Modify `WP_Query` requests for the 'bp_group' param.
*
* @param WP_Query Query object, passed by reference.
*/
示例15: _e
} else {
?>
<p><?php
_e('No member groups were found.', 'bp-group-hierarchy');
?>
</p>
<?php
}
?>
</div>
<?php
// reset the $groups_template global and continue with the page
$groups_template = $parent_template;
}
}
bp_register_group_extension('BP_Groups_Hierarchy_Extension');
/**
*
* Group creation permission / restriction functions
*
*/
/**
* Store the ID of the group the user selected as the parent for group creation
*/
function bp_group_hierarchy_set_parent_id_cookie()
{
global $bp;
if (bp_is_groups_component() && $bp->current_action == 'create' && isset($_REQUEST['parent_id']) && $_REQUEST['parent_id'] != 0) {
if (bp_group_hierarchy_can_create_subgroups($bp->loggedin_user->id, (int) $_REQUEST['parent_id'])) {
setcookie('bp_new_group_parent_id', (int) $_REQUEST['parent_id'], time() + 1000, COOKIEPATH);
} else {