Activate Theme and Set Purchase Code Snippet

Kurt_786

New member
XNullUser
Joined
Jun 11, 2024
Messages
3
Reaction score
0
Points
1
Location
Karachi
NullCash
5
Hey everyone,

I've got a handy snippet here that can be used to activate a theme and set a purchase code in WordPress. This can be particularly useful if you're dealing with themes that require activation via a purchase code. Here's the code

$mytheme = get_template();
update_option( 'trx_addons_theme_' . $mytheme . '_activated', true );
update_option( 'purchase_code_' . $mytheme, 'L12345678' );
update_option( 'purchase_code_src_' . $mytheme, 'L12345678' );

Instructions:

  1. Copy the Code: Copy the PHP snippet above.
  2. Add to Theme Functions: Paste the code into the functions.php file of your WordPress theme.
  3. Modify if Needed: Replace 'L12345678' with your own purchase code if you have a different one.
What This Code Does:

  • Activate Theme: The code sets an option in the WordPress database to mark the theme as activated.
  • Set Purchase Code: It also stores the purchase code in the WordPress options table, which can help in bypassing purchase code checks for certain themes.
Use this responsibly and only on themes you have the right to modify. Enjoy!
 
Top