bbp_admin_setting_callback_show_on_root()

Include root slug setting field


Description Description


Source Source

File: includes/admin/settings.php

function bbp_admin_setting_callback_show_on_root() {

	// Current setting
	$show_on_root = bbp_show_on_root();

	// Options for forum root output
	$root_options = array(
		'forums' => array(
			'name' => esc_attr__( 'Forum Index', 'bbpress' )
		),
		'topics' => array(
			'name' => esc_attr__( 'Topics by Last Post', 'bbpress' )
		)
	); ?>

	<select name="_bbp_show_on_root" id="_bbp_show_on_root" <?php bbp_maybe_admin_setting_disabled( '_bbp_show_on_root' ); ?>>

		<?php foreach ( $root_options as $option_id => $details ) : ?>

			<option <?php selected( $show_on_root, $option_id ); ?> value="<?php echo esc_attr( $option_id ); ?>"><?php echo esc_html( $details['name'] ); ?></option>

		<?php endforeach; ?>

	</select>

	<?php

	// Look for theme support
	$forum_archive = basename( bbp_get_forum_archive_template() );

	// This setting doesn't work if the theme has an archive-forum.php template.
	if ( ! empty( $forum_archive ) ) : ?>

		<p class="description"><?php printf( esc_html__( 'This setting will be ignored because %s was found in your theme.', 'bbpress' ), '<code>' . $forum_archive . '</code>' ); ?></p>

	<?php endif;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.