Skip to content

Instantly share code, notes, and snippets.

@MakarandMane
Last active September 26, 2023 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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' ) );
}
}
?>
@mrmax70
Copy link

mrmax70 commented Jul 4, 2021

is interesting .. but I need to put this file inside wp-content/theme .. right? then?

@MakarandMane
Copy link
Author

MakarandMane commented Jul 5, 2021

Yes @mrmax70

Option 1: You can copy n paste this code in your theme's function.php file

Option 2: Download this gist as separate file and include it in theme's function.php file

@mrmax70
Copy link

mrmax70 commented Jul 5, 2021

hi @MakarandMane ... thanks .. I tried but no work ...
😩

@MakarandMane
Copy link
Author

MakarandMane commented Jul 5, 2021

hi @MakarandMane ... thanks .. I tried but no work ...

@mrmax70 Where you put this code?
Are you using child theme? Dont put this code inside Betheme

@mrmax70
Copy link

mrmax70 commented Jul 5, 2021

in function.php in theme folder ..

yes I'm using chid theme...

@MakarandMane
Copy link
Author

in function.php in theme folder ..

yes I'm using chid theme...

Which version of Betheme you are using?

@MakarandMane
Copy link
Author

@mrmax70 try to add this to functions.php

define( 'ENVATO_HOSTED_KEY', true );

@Fornix25
Copy link

@mrmax70 try to add this to functions.php

define( 'ENVATO_HOSTED_KEY', true );

Thank you man, that's really helped!

@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