bp_search_settings_callback_post_type( $args )

Allow Post Type search setting field

Description

Parameters

$args

(Required) array

Source

File: bp-search/bp-search-settings.php

function bp_search_settings_callback_post_type( $args ) {

	$post_type   = $args['post_type'];
	$option_name = 'bp_search_post_type_' . $post_type;

	$post_type_obj = get_post_type_object( $post_type );
	?>
	<input
		name="<?php echo $option_name ?>"
		id="<?php echo $option_name ?>"
		type="checkbox"
		value="1"
		<?php checked( bp_is_search_post_type_enable( $post_type, true ) ) ?>
	/>
	<label for="<?php echo $option_name ?>">
		<?php echo $post_type === 'post' ? esc_html__( 'Blog Posts', 'buddyboss' ) : $post_type_obj->labels->name ?>
	</label>
	<?php
}

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.