Files
bedrock/includes/roots-admin.php
2011-03-27 13:46:21 -06:00

44 lines
1.7 KiB
PHP

<?php
// admin CSS and JS
add_action('admin_init', 'roots_admin_init');
function roots_admin_init() {
$site_url = site_url();
//wp_register_script('roots_codemirror', "$site_url/wp-content/themes/roots/includes/js/codemirror/codemirror.js");
//wp_enqueue_script('roots_codemirror');
wp_enqueue_script('jquery-ui-tabs');
wp_register_style('roots_admin', "$site_url/wp-content/themes/roots/includes/css/admin.css");
wp_register_script('roots_admin', "$site_url/wp-content/themes/roots/includes/js/scripts.js");
wp_enqueue_style('roots_admin');
wp_enqueue_script('roots_admin');
}
// check to see if the tagline is set to default
// show an admin notice to update if it hasn't been changed
// you want to change this or remove it because it's used as the description in the RSS feed
if (get_option('blogdescription') === 'Just another WordPress site') {
add_action('admin_notices', create_function('', "echo '<div class=\"error\"><p>" . sprintf(__('Please update your <a href="%s">site tagline</a>', 'roots'), admin_url('options-general.php')) . "</p></div>';"));
};
// set the post revisions to 5 unless the constant
// was set in wp-config.php to avoid DB bloat
if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 5);
// allow more tags in TinyMCE including iframes
function roots_change_mce_options($options) {
$ext = 'pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]';
if (isset($initArray['extended_valid_elements'])) {
$options['extended_valid_elements'] .= ',' . $ext;
} else {
$options['extended_valid_elements'] = $ext;
}
return $options;
}
add_filter('tiny_mce_before_init', 'roots_change_mce_options');
?>