Skip to content
Snippets Groups Projects
Commit 1b5f06a1 authored by shammash's avatar shammash Committed by lechuck
Browse files

updated wpmu-new-blog-defaults to 2.2

parent 0b393ace
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,11 @@ Plugin Name: cets_blog_defaults
Plugin URI:
Description: WordPressMU plugin for site admin to set defaults for new blogs.
Description: WordPress Multisite plugin for network admin to set defaults for new blogs.
Version: 2.1
Version: 2.2
Author: Deanna Schneider
Author: Deanna Schneider, Jason Lemahieu
Copyright:
......@@ -41,6 +41,13 @@ class cets_blog_defaults
global $wpdb, $wp_version;
//if this is less than wp 3.0, just get out of here.
if ( version_compare( $wp_version, '3.0', '<' ) ) {
return;
}
// Set up the array of potential defaults
$cets_blogdefaults = array(
'default_pingback_flag'=>1,
......@@ -518,8 +525,16 @@ class cets_blog_defaults
//Add the site-wide administrator menu
function add_siteadmin_page(){
// don't restrict this to site admins, because it throws an error if non site admins go to the URL. Instead, control it wtih the site admin test at the next level
add_submenu_page('wpmu-admin.php', 'New Blog Defaults', 'New Blog Defaults', 'unfiltered_html', 'cets_blog_defaults_management_page', array(&$this, 'cets_blog_defaults_management_page'));
if (function_exists('is_network_admin')) {
//3.1+
add_submenu_page('settings.php', 'New Blog Defaults', 'New Blog Defaults', 'manage_sites', 'cets_blog_defaults_management_page', array(&$this, 'cets_blog_defaults_management_page'));
} else {
//-3.1
add_submenu_page('ms-admin.php', 'New Blog Defaults', 'New Blog Defaults', 'manage_sites', 'cets_blog_defaults_management_page', array(&$this, 'cets_blog_defaults_management_page'));
}
}
......@@ -1446,17 +1461,37 @@ function cets_nbd_from_name($from_name)
// When a new blog is created, set the options
// When a new blog is created, set the options (if it's over 3.0)
if ( version_compare( $wp_version, '3.0', '>=' ) ) {
add_action('wpmu_new_blog', array(&$cets_wpmubd, 'set_blog_defaults'), 100, 2);
// Add the site admin config page
if (function_exists('is_network_admin')) {
//3.1+
add_action('network_admin_menu', array(&$cets_wpmubd, 'add_siteadmin_page'));
} else {
//-3.1
add_action('admin_menu', array(&$cets_wpmubd, 'add_siteadmin_page'));
}
// Filters and such needed for the bonus options
add_filter( 'wp_mail_from', 'cets_nbd_from_email' );
add_filter( 'wp_mail_from_name', 'cets_nbd_from_name' );
}
?>
=== New Blog Defaults ===
Contributors: DeannaS, kgraeme
Contributors: DeannaS, kgraeme, MadtownLems
Tags: WPMU, Wordpress Mu, Wordpress Multiuser, Blog Defaults, Set Defaults
Requires at least: 2.9.1.1
Tested up to: 3.0
Requires at least: 3.0
Tested up to: 3.1
Stable tag: trunk
......@@ -16,8 +16,9 @@ Included files:
This plugin does the following:
1. Adds a new submenu to the site admin screen called "New Blog Defaults."
1. Allows the site administrator to visual set defaults for each of the major blog sections:
1. In 3.0, adds a new submenu to the site admin screen called "New Blog Defaults."
2. In 3.1, adds a new submenu called "New Blog Defaults" to the Settings section on the Network Admin page.
1. Allows the site/network administrator to visual set defaults for each of the major blog sections:
1. General Settings
1. Writing Settings
......@@ -33,7 +34,7 @@ This plugin does the following:
== Installation ==
1. Place the cets\_blog\_defaults.php file in the wp-content/mu-plugins folder.
1. Go to site admin -> new blog defaults and configure new blog defaults. Blogs created after settings are saved will use new blog defaults.
1. Go to the appropriate menu and configure new blog defaults. Blogs created after settings are saved will use new blog defaults.
......@@ -42,7 +43,13 @@ This plugin does the following:
No, it's not designed to affect current blogs. Settings will only affect new blogs.
2. Will this work on version prior to 3.0?
You will have to pull a tagged version from the repository. Version 2.1 of this plugin works on older versions of WordPress.
== Changelog ==
2.2 - Moved admin page to Network->Settings for 3.1. Increased required WP Version to 3.0. (stopped support for lower version)
2.1 - Fixed deprecated parameter on add_sub_menu page
2.0 - Updates for WP3.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment