Skip to content

Commit

Permalink
[static] [oop] [admin-dashboard] [debug] Turned _clean_admin_content_…
Browse files Browse the repository at this point in the history
…section() and _hide_admin_notices() into static (for usage in the static debug page).
  • Loading branch information
vovafeldman committed Jan 15, 2016
1 parent df01ef2 commit 780e7cd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions includes/class-freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -4151,7 +4151,7 @@ function _activate_account() {
return;
}

$this->_clean_admin_content_section();
self::_clean_admin_content_section();

if ( fs_request_is_action( 'activate' ) && fs_request_is_post() ) {
// check_admin_referer( 'activate_' . $this->_plugin->public_key );
Expand Down Expand Up @@ -4718,7 +4718,7 @@ private function override_plugin_menu_with_activation() {

if ( $this->_menu->is_activation_page() ) {
// Clean admin page from distracting content.
$this->_clean_admin_content_section();
self::_clean_admin_content_section();
}

if ( false !== $hook ) {
Expand Down Expand Up @@ -4776,7 +4776,7 @@ private function add_submenu_items() {
$this->get_plugin_name() . ' – ' . __fs( 'contact-us', $this->_slug ),
'manage_options',
'contact',
array( &$this, '_clean_admin_content_section' ),
'Freemius::_clean_admin_content_section',
WP_FS__DEFAULT_PRIORITY,
$this->_menu->is_submenu_item_visible( 'contact' )
);
Expand Down Expand Up @@ -4806,7 +4806,7 @@ private function add_submenu_items() {
$this->get_plugin_name() . ' – ' . __fs( 'pricing', $this->_slug ),
'manage_options',
'pricing',
array( &$this, '_clean_admin_content_section' ),
'Freemius::_clean_admin_content_section',
WP_FS__LOWEST_PRIORITY,
$show_pricing
);
Expand Down Expand Up @@ -7116,15 +7116,15 @@ function _contact_page_render() {
*
* @uses remove_all_actions()
*/
function _hide_admin_notices() {
private static function _hide_admin_notices() {
remove_all_actions( 'admin_notices' );
remove_all_actions( 'network_admin_notices' );
remove_all_actions( 'all_admin_notices' );
remove_all_actions( 'user_admin_notices' );
}

function _clean_admin_content_section_hook() {
$this->_hide_admin_notices();
static function _clean_admin_content_section_hook() {
self::_hide_admin_notices();

// Hide footer.
echo '<style>#wpfooter { display: none !important; }</style>';
Expand All @@ -7136,8 +7136,8 @@ function _clean_admin_content_section_hook() {
* @author Vova Feldman (@svovaf)
* @since 1.0.3
*/
function _clean_admin_content_section() {
add_action( 'admin_head', array( &$this, '_clean_admin_content_section_hook' ) );
static function _clean_admin_content_section() {
add_action( 'admin_head', 'Freemius::_clean_admin_content_section_hook' );
}

/* CSS & JavaScript
Expand Down

0 comments on commit 780e7cd

Please sign in to comment.