function bb_get_active_theme_uri()
{
    global $bb;
    // Skip theme loading in "safe" mode
    if (isset($bb->safemode) && $bb->safemode === true) {
        $active_theme_uri = BB_DEFAULT_THEME_URL;
    } elseif (!($active_theme = bb_get_option('bb_active_theme'))) {
        $active_theme_uri = BB_DEFAULT_THEME_URL;
    } else {
        $active_theme_uri = bb_get_theme_uri($active_theme);
    }
    return apply_filters('bb_get_active_theme_uri', $active_theme_uri);
}
示例#2
0
function bb_admin_theme_row($theme, $position)
{
    $theme_directory = bb_get_theme_directory($theme);
    $theme_data = file_exists($theme_directory . 'style.css') ? bb_get_theme_data($theme) : false;
    $screen_shot = file_exists($theme_directory . 'screenshot.png') ? esc_url(bb_get_theme_uri($theme) . 'screenshot.png') : false;
    $activation_url = bb_get_uri('bb-admin/themes.php', array('theme' => urlencode($theme)), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
    $activation_url = esc_url(bb_nonce_url($activation_url, 'switch-theme'));
    if (1 === $position || 0 === $position) {
        echo '<tr>';
    }
    ?>
	<td class="position-<?php 
    echo (int) $position;
    ?>
">
		<div class="screen-shot"><?php 
    if ($screen_shot) {
        ?>
<a href="<?php 
        echo $activation_url;
        ?>
" title="<?php 
        echo esc_attr(sprintf(__('Activate "%s"'), $theme_data['Title']));
        ?>
"><img alt="<?php 
        echo esc_attr($theme_data['Title']);
        ?>
" src="<?php 
        echo $screen_shot;
        ?>
" /></a><?php 
    }
    ?>
</div>
		<div class="description">
			<h3 class="themes">
<?php 
    printf(__('%1$s %2$s by <cite>%3$s</cite>'), $theme_data['Title'], $theme_data['Version'], $theme_data['Author']);
    ?>
			</h3>
			
<?php 
    if ($theme_data['Porter']) {
        ?>
			<p>
<?php 
        printf(__('Ported by <cite>%s</cite>'), $theme_data['Porter']);
        ?>
			</p>
<?php 
    }
    ?>
			
			<?php 
    echo $theme_data['Description'];
    // Description is autop'ed
    if (0 !== $position) {
        ?>
			<div class="actions">
				<a href="<?php 
        echo $activation_url;
        ?>
" title="<?php 
        echo esc_attr(sprintf(__('Activate "%s"'), $theme_data['Title']));
        ?>
"><?php 
        _e('Activate');
        ?>
</a>
			</div>
<?php 
    }
    ?>
			<p class="location"><?php 
    printf(__('All of this theme\'s files are located in the "%s" themes directory.'), $theme_data['Location']);
    ?>
</p>
		</div>
	</td>
<?php 
    if (3 === $position || 0 === $position) {
        echo '</tr>';
    }
}