コード例 #1
0
 /**
  * Setup the default bbPress theme compatibility location.
  *
  * @since bbPress (r3778)
  */
 public function setup_theme()
 {
     // Bail if something already has this under control
     if (!empty($this->theme_compat->theme)) {
         return;
     }
     // Setup the theme package to use for compatibility
     bbp_setup_theme_compat(bbp_get_theme_package_id());
 }
コード例 #2
0
ファイル: settings.php プロジェクト: joeyblake/bbpress
/**
 * Use the WordPress editor setting field
 *
 * @since 2.1.0 bbPress (r3586)
 *
 * @uses checked() To display the checked attribute
 */
function bbp_admin_setting_callback_subtheme_id()
{
    // Declare locale variable
    $theme_options = '';
    $current_package = bbp_get_theme_package_id('default');
    // Note: This should never be empty. /templates/ is the
    // canonical backup if no other packages exist. If there's an error here,
    // something else is wrong.
    //
    // @see bbPress::register_theme_packages()
    foreach ((array) bbpress()->theme_compat->packages as $id => $theme) {
        $theme_options .= '<option value="' . esc_attr($id) . '"' . selected($theme->id, $current_package, false) . '>' . sprintf(esc_html__('%1$s - %2$s', 'bbpress'), esc_html($theme->name), esc_html(str_replace(WP_CONTENT_DIR, '', $theme->dir))) . '</option>';
    }
    if (!empty($theme_options)) {
        ?>

		<select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php 
        bbp_maybe_admin_setting_disabled('_bbp_theme_package_id');
        ?>
><?php 
        echo $theme_options;
        ?>
</select>
		<label for="_bbp_theme_package_id"><?php 
        esc_html_e('will serve all bbPress templates', 'bbpress');
        ?>
</label>

	<?php 
    } else {
        ?>

		<p><?php 
        esc_html_e('No template packages available.', 'bbpress');
        ?>
</p>

	<?php 
    }
}