| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Adminimize |
| 4 |
* @subpackage Remove the footer area of the back end. |
| 5 |
* @author Frank Bültge |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! function_exists( 'add_action' ) ) { |
| 9 |
echo "Hi there! I'm just a part of plugin, not much I can do when called directly."; |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
add_action( 'init', '_mw_adminimize_remove_footer' ); |
| 14 |
/** |
| 15 |
* Check settings for enqueue scripts. |
| 16 |
*/ |
| 17 |
function _mw_adminimize_remove_footer() { |
| 18 |
|
| 19 |
// Exclude super admin. |
| 20 |
if ( _mw_adminimize_exclude_super_admin() ) { |
| 21 |
return; |
| 22 |
} |
| 23 |
|
| 24 |
// Leave the settings screen from Adminimize to see all areas on settings, also on AJAX requests. |
| 25 |
if ( _mw_adminimize_exclude_settings_page() ) { |
| 26 |
return; |
| 27 |
} |
| 28 |
|
| 29 |
if ( 1 !== (int) _mw_adminimize_get_option_value( '_mw_adminimize_footer' ) ) { |
| 30 |
return; |
| 31 |
} |
| 32 |
|
| 33 |
add_action( 'admin_init', '_mw_adminimize_enqueue_remove_footer' ); |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* Enqueue script to remove admin footer area. |
| 38 |
*/ |
| 39 |
function _mw_adminimize_enqueue_remove_footer() { |
| 40 |
|
| 41 |
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 42 |
|
| 43 |
wp_enqueue_script( |
| 44 |
'_mw_adminimize_remove_footer', |
| 45 |
WP_PLUGIN_URL . '/' . FB_ADMINIMIZE_BASEFOLDER . '/js/remove_footer' . $suffix . '.js', |
| 46 |
array( 'jquery' ) |
| 47 |
); |
| 48 |
} |
| 49 |
|