mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user