bp_profile_search_register_post_type()

Register BuddyBoss Profile Search post type.

Description

Source

File: bp-core/profile-search/bps-start.php

function bp_profile_search_register_post_type (){
	$args = array (
		'labels' => array (
			'name' => __('Profile Search Forms', 'buddyboss'),
			'singular_name' => __('Profile Search Form', 'buddyboss'),
			'all_items' => __('Profile Search', 'buddyboss'),
			'add_new' => __('Add New', 'buddyboss'),
			'add_new_item' => __('Add New Form', 'buddyboss'),
			'edit_item' => __('Profile Search', 'buddyboss'),
			'not_found' => __('No forms found', 'buddyboss'),
			'not_found_in_trash' => __('No forms found in trash', 'buddyboss'),
		),
		'show_ui' => true,
		'show_in_menu' => '',
		'supports' => array ( 'title' ),
		'rewrite' => false,
		'map_meta_cap' => true,
		'capability_type' => 'bp_ps_form',
		'query_var' => false,
	);

	register_post_type ( 'bp_ps_form', $args );

	$form_caps = array (
		'administrator' => array (
            'edit_bp_ps_forms',
			'edit_others_bp_ps_forms',
			'edit_published_bp_ps_forms',
		)
	);

	$form_caps = apply_filters ( 'bp_ps_form_caps', $form_caps );
	foreach ( $form_caps as $key => $caps ) {
		$role = get_role ($key);
		foreach ( $caps as $cap ) {
			if (! $role->has_cap ( $cap ) ) {
                $role->add_cap ($cap);
            }
        }
	}
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.