Allow CodePress to be disabled from Screen Options, see #10027

git-svn-id: https://develop.svn.wordpress.org/trunk@11530 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-06-07 01:52:44 +00:00
parent efeffe1d53
commit ed7d206ac1
6 changed files with 41 additions and 10 deletions

View File

@@ -341,11 +341,35 @@ jQuery('#template').submit(function(){
if (jQuery('#newcontent_cp').length)
jQuery('#newcontent_cp').val(newcontent.getCode()).removeAttr('disabled');
});
jQuery('#codepress-on').hide();
jQuery('#codepress-off').show();
/* ]]> */
</script>
<?php
}
/**
* Determine whether to use CodePress or not.
*
* @since 2.8
**/
function use_codepress() {
if ( isset($_GET['codepress']) ) {
$on = 'on' == $_GET['codepress'] ? 'on' : 'off';
set_user_setting( 'codepress', $on );
} else {
$on = get_user_setting('codepress', 'on');
}
if ( 'on' == $on ) {
add_action( 'admin_print_footer_scripts', 'codepress_footer_js' );
return true;
}
return false;
}
/**
* Saves option for number of rows when listing posts, pages, comments, etc.
*