• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP groups_edit_base_group_details函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中groups_edit_base_group_details函数的典型用法代码示例。如果您正苦于以下问题:PHP groups_edit_base_group_details函数的具体用法?PHP groups_edit_base_group_details怎么用?PHP groups_edit_base_group_details使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了groups_edit_base_group_details函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: bp_groups_admin_load

/**
 * Set up the Groups admin page.
 *
 * Loaded before the page is rendered, this function does all initial setup,
 * including: processing form requests, registering contextual help, and
 * setting up screen options.
 *
 * @since 1.7.0
 *
 * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table.
 */
function bp_groups_admin_load()
{
    global $bp_groups_list_table;
    // Build redirection URL
    $redirect_to = remove_query_arg(array('action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified'), $_SERVER['REQUEST_URI']);
    // Decide whether to load the dev version of the CSS and JavaScript
    $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : 'min.';
    $doaction = bp_admin_list_table_current_bulk_action();
    /**
     * Fires at top of groups admin page.
     *
     * @since 1.7.0
     *
     * @param string $doaction Current $_GET action being performed in admin screen.
     */
    do_action('bp_groups_admin_load', $doaction);
    // Edit screen
    if ('do_delete' == $doaction && !empty($_GET['gid'])) {
        check_admin_referer('bp-groups-delete');
        $group_ids = wp_parse_id_list($_GET['gid']);
        $count = 0;
        foreach ($group_ids as $group_id) {
            if (groups_delete_group($group_id)) {
                $count++;
            }
        }
        $redirect_to = add_query_arg('deleted', $count, $redirect_to);
        bp_core_redirect($redirect_to);
    } elseif ('edit' == $doaction && !empty($_GET['gid'])) {
        // columns screen option
        add_screen_option('layout_columns', array('default' => 2, 'max' => 2));
        get_current_screen()->add_help_tab(array('id' => 'bp-group-edit-overview', 'title' => __('Overview', 'buddypress'), 'content' => '<p>' . __('This page is a convenient way to edit the details associated with one of your groups.', 'buddypress') . '</p>' . '<p>' . __('The Name and Description box is fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to hide or unhide, or to choose a 1- or 2-column layout for this screen.', 'buddypress') . '</p>'));
        // Help panel - sidebar links
        get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:', 'buddypress') . '</strong></p>' . '<p><a href="https://buddypress.org/support">' . __('Support Forums', 'buddypress') . '</a></p>');
        // Register metaboxes for the edit screen.
        add_meta_box('submitdiv', _x('Save', 'group admin edit screen', 'buddypress'), 'bp_groups_admin_edit_metabox_status', get_current_screen()->id, 'side', 'high');
        add_meta_box('bp_group_settings', _x('Settings', 'group admin edit screen', 'buddypress'), 'bp_groups_admin_edit_metabox_settings', get_current_screen()->id, 'side', 'core');
        add_meta_box('bp_group_add_members', _x('Add New Members', 'group admin edit screen', 'buddypress'), 'bp_groups_admin_edit_metabox_add_new_members', get_current_screen()->id, 'normal', 'core');
        add_meta_box('bp_group_members', _x('Manage Members', 'group admin edit screen', 'buddypress'), 'bp_groups_admin_edit_metabox_members', get_current_screen()->id, 'normal', 'core');
        /**
         * Fires after the registration of all of the default group meta boxes.
         *
         * @since 1.7.0
         */
        do_action('bp_groups_admin_meta_boxes');
        // Enqueue JavaScript files
        wp_enqueue_script('postbox');
        wp_enqueue_script('dashboard');
        // Index screen
    } else {
        // Create the Groups screen list table
        $bp_groups_list_table = new BP_Groups_List_Table();
        // per_page screen option
        add_screen_option('per_page', array('label' => _x('Groups', 'Groups per page (screen options)', 'buddypress')));
        // Help panel - overview text
        get_current_screen()->add_help_tab(array('id' => 'bp-groups-overview', 'title' => __('Overview', 'buddypress'), 'content' => '<p>' . __('You can manage groups much like you can manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on groups by using the on-hover action links or the Bulk Actions.', 'buddypress') . '</p>'));
        get_current_screen()->add_help_tab(array('id' => 'bp-groups-overview-actions', 'title' => __('Group Actions', 'buddypress'), 'content' => '<p>' . __('Clicking "Visit" will take you to the group&#8217;s public page. Use this link to see what the group looks like on the front end of your site.', 'buddypress') . '</p>' . '<p>' . __('Clicking "Edit" will take you to a Dashboard panel where you can manage various details about the group, such as its name and description, its members, and other settings.', 'buddypress') . '</p>' . '<p>' . __('If you click "Delete" under a specific group, or select a number of groups and then choose Delete from the Bulk Actions menu, you will be led to a page where you&#8217;ll be asked to confirm the permanent deletion of the group(s).', 'buddypress') . '</p>'));
        // Help panel - sidebar links
        get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:', 'buddypress') . '</strong></p>' . '<p>' . __('<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress') . '</p>');
    }
    $bp = buddypress();
    // Enqueue CSS and JavaScript
    wp_enqueue_script('bp_groups_admin_js', $bp->plugin_url . "bp-groups/admin/js/admin.{$min}js", array('jquery', 'wp-ajax-response', 'jquery-ui-autocomplete'), bp_get_version(), true);
    wp_localize_script('bp_groups_admin_js', 'BP_Group_Admin', array('add_member_placeholder' => __('Start typing a username to add a new member.', 'buddypress'), 'warn_on_leave' => __('If you leave this page, you will lose any unsaved changes you have made to the group.', 'buddypress')));
    wp_enqueue_style('bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version());
    wp_style_add_data('bp_groups_admin_css', 'rtl', true);
    if ($min) {
        wp_style_add_data('bp_groups_admin_css', 'suffix', $min);
    }
    if ($doaction && 'save' == $doaction) {
        // Get group ID
        $group_id = isset($_REQUEST['gid']) ? (int) $_REQUEST['gid'] : '';
        $redirect_to = add_query_arg(array('gid' => (int) $group_id, 'action' => 'edit'), $redirect_to);
        // Check this is a valid form submission
        check_admin_referer('edit-group_' . $group_id);
        // Get the group from the database
        $group = groups_get_group('group_id=' . $group_id);
        // If the group doesn't exist, just redirect back to the index
        if (empty($group->slug)) {
            wp_redirect($redirect_to);
            exit;
        }
        // Check the form for the updated properties
        // Store errors
        $error = 0;
        $success_new = $error_new = $success_modified = $error_modified = array();
        // Group name and description are handled with
        // groups_edit_base_group_details()
        if (!groups_edit_base_group_details($group_id, $_POST['bp-groups-name'], $_POST['bp-groups-description'], 0)) {
//.........这里部分代码省略.........
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:101,代码来源:bp-groups-admin.php


示例2: groups_screen_group_admin_edit_details

/**
 * Handle the display of a group's admin/edit-details page.
 */
function groups_screen_group_admin_edit_details()
{
    if ('edit-details' != bp_get_group_current_admin_tab()) {
        return false;
    }
    if (bp_is_item_admin()) {
        $bp = buddypress();
        // If the edit form has been submitted, save the edited details.
        if (isset($_POST['save'])) {
            // Check the nonce.
            if (!check_admin_referer('groups_edit_group_details')) {
                return false;
            }
            $group_notify_members = isset($_POST['group-notify-members']) ? (int) $_POST['group-notify-members'] : 0;
            if (!groups_edit_base_group_details($_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $group_notify_members)) {
                bp_core_add_message(__('There was an error updating group details. Please try again.', 'buddypress'), 'error');
            } else {
                bp_core_add_message(__('Group details were successfully updated.', 'buddypress'));
            }
            /**
             * Fires before the redirect if a group details has been edited and saved.
             *
             * @since 1.0.0
             *
             * @param int $id ID of the group that was edited.
             */
            do_action('groups_group_details_edited', $bp->groups->current_group->id);
            bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . 'admin/edit-details/');
        }
        /**
         * Fires before the loading of the group admin/edit-details page template.
         *
         * @since 1.0.0
         *
         * @param int $id ID of the group that is being displayed.
         */
        do_action('groups_screen_group_admin_edit_details', $bp->groups->current_group->id);
        /**
         * Filters the template to load for a group's admin/edit-details page.
         *
         * @since 1.0.0
         *
         * @param string $value Path to a group's admin/edit-details template.
         */
        bp_core_load_template(apply_filters('groups_template_group_admin', 'groups/single/home'));
    }
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:50,代码来源:bp-groups-screens.php


示例3: groups_screen_group_admin_edit_details

/**
 * Handle the display of a group's admin/edit-details page.
 */
function groups_screen_group_admin_edit_details()
{
    if ('edit-details' != bp_get_group_current_admin_tab()) {
        return false;
    }
    if (bp_is_item_admin()) {
        $bp = buddypress();
        // If the edit form has been submitted, save the edited details
        if (isset($_POST['save'])) {
            // Check the nonce
            if (!check_admin_referer('groups_edit_group_details')) {
                return false;
            }
            $group_notify_members = isset($_POST['group-notify-members']) ? (int) $_POST['group-notify-members'] : 0;
            if (!groups_edit_base_group_details($_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $group_notify_members)) {
                bp_core_add_message(__('There was an error updating group details. Please try again.', 'buddypress'), 'error');
            } else {
                bp_core_add_message(__('Group details were successfully updated.', 'buddypress'));
            }
            do_action('groups_group_details_edited', $bp->groups->current_group->id);
            bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . 'admin/edit-details/');
        }
        do_action('groups_screen_group_admin_edit_details', $bp->groups->current_group->id);
        bp_core_load_template(apply_filters('groups_template_group_admin', 'groups/single/home'));
    }
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:29,代码来源:bp-groups-screens.php


示例4: test_bp_groups_format_activity_action_group_details_updated_with_updated_name_and_description

 /**
  * @group activity_action
  * @group bp_groups_format_activity_action_group_details_updated
  */
 public function test_bp_groups_format_activity_action_group_details_updated_with_updated_name_and_description()
 {
     $old_user = get_current_user_id();
     $u = $this->factory->user->create();
     $this->set_current_user($u);
     $group = $this->factory->group->create_and_get();
     groups_edit_base_group_details($group->id, 'Foo', 'Bar', true);
     $a = bp_activity_get(array('component' => buddypress()->groups->id, 'action' => 'group_details_updated', 'item_id' => $group->id));
     $this->assertNotEmpty($a['activities']);
     $expected = sprintf(__('%s changed the name and description of the group %s', 'buddypress'), bp_core_get_userlink($u), '<a href="' . bp_get_group_permalink($group) . '">Foo</a>');
     $this->assertSame($expected, $a['activities'][0]->action);
     $this->set_current_user($old_user);
 }
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:17,代码来源:activity.php


示例5: groups_screen_group_admin_edit_details

function groups_screen_group_admin_edit_details() {
	global $bp;

	if ( $bp->current_component == $bp->groups->slug && 'edit-details' == $bp->action_variables[0] ) {

		if ( $bp->is_item_admin || $bp->is_item_mod  ) {

			// If the edit form has been submitted, save the edited details
			if ( isset( $_POST['save'] ) ) {
				/* Check the nonce first. */
				if ( !check_admin_referer( 'groups_edit_group_details' ) )
					return false;

				if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int)$_POST['group-notify-members'] ) ) {
					bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' );
				} else {
					bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) );
				}

				do_action( 'groups_group_details_edited', $bp->groups->current_group->id );

				bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/edit-details/' );
			}

			do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id );

			bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) );
		}
	}
}
开发者ID:n-sane,项目名称:zaroka,代码行数:30,代码来源:bp-groups.php


示例6: groups_screen_group_admin_edit_details

function groups_screen_group_admin_edit_details()
{
    global $bp, $group_obj;
    if ($bp->current_component == $bp->groups->slug && 'edit-details' == $bp->action_variables[0]) {
        if ($bp->is_item_admin || $bp->is_item_mod) {
            // If the edit form has been submitted, save the edited details
            if (isset($_POST['save'])) {
                if (!groups_edit_base_group_details($_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $_POST['group-news'], (int) $_POST['group-notify-members'])) {
                    bp_core_add_message(__('There was an error updating group details, please try again.', 'buddypress'), 'error');
                } else {
                    bp_core_add_message(__('Group details were successfully updated.', 'buddypress'));
                }
                do_action('groups_group_details_edited', $group_obj->id);
                bp_core_redirect(site_url() . '/' . $bp->current_component . '/' . $bp->current_item . '/admin/edit-details');
            }
            do_action('groups_screen_group_admin_edit_details', $group_obj->id);
            bp_core_load_template(apply_filters('groups_template_group_admin_edit_details', 'groups/admin/edit-details'));
        }
    }
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:20,代码来源:bp-groups.php



注:本文中的groups_edit_base_group_details函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP groups_edit_group_settings函数代码示例发布时间:2022-05-15
下一篇:
PHP groups_demote_member函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap