Skip to content

Instantly share code, notes, and snippets.

@MakarandMane
Last active September 26, 2023 10:58
Show Gist options
  • Save MakarandMane/448d63f9da4cdfae5cda63f33c74002d to your computer and use it in GitHub Desktop.
Save MakarandMane/448d63f9da4cdfae5cda63f33c74002d to your computer and use it in GitHub Desktop.
This is my private to hide betheme license purchase error notice on admin panel.
<?php
//This is variable is also used in parent theme i.e. BeTheme
//Set it false to show other betheme options.
define( 'WHITE_LABEL', true );
add_action( 'admin_menu','while_label_theme', 13 );
function while_label_theme(){
if( WHITE_LABEL ){
define( 'ENVATO_HOSTED_KEY', true );
global $mfn_dashboard;
remove_action( 'admin_notices', array( $mfn_dashboard, 'admin_notices' ), 1 );
// Move theme options page under
global $MFN_Options;
remove_action( 'admin_print_styles-'.$MFN_Options->page, array( &$MFN_Options, '_enqueue' ) );
remove_submenu_page( 'betheme', $MFN_Options->args['page_slug'] );
remove_menu_page( 'betheme' );
$MFN_Options->page = add_submenu_page(
'themes.php',
$MFN_Options->args['page_title'],
$MFN_Options->args['page_title'],
$MFN_Options->args['page_cap'],
$MFN_Options->args['page_slug'],
array( &$MFN_Options, '_options_page_html' )
);
add_action( 'admin_print_styles-'.$MFN_Options->page, array( &$MFN_Options, '_enqueue' ) );
}
}
?>
@E3yuji
Copy link

E3yuji commented Sep 23, 2023

is it still working?

Your PHP code changes were not applied due to an error on line 3745 of file wp-content/themes/betheme/functions/theme-functions.php. Please fix and try saving again.

syntax error, unexpected token "<", expecting end of file

i get this error

@MakarandMane
Copy link
Author

is it still working?

Your PHP code changes were not applied due to an error on line 3745 of file wp-content/themes/betheme/functions/theme-functions.php. Please fix and try saving again.

syntax error, unexpected token "<", expecting end of file

i get this error

You have received syntax error.
If you are not developer, then you might have code from <?php inside php.
So Just copy between <?php and ?>.

If still not works, try to copy it inside child theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment