Running add_action after validating license plugin
-
Hello
Thanks for an awesome plugin.i try to create a plugin using your sample plugin. My plan is all my wp_customize setting will not display before license key validate.
i had try use this code to check license key validate
/*** Verify license key is active and expire date has not passed ***/ $api_params = array( 'slm_action' => 'slm_check', 'secret_key' => MYPLUGIN_CUSTOMIZER_PLUGIN_SECRET_KEY, 'license_key' => get_option('my_license_key'), //replace with your license key field name. ); // Send query to the license manager server $response = wp_remote_get(add_query_arg($api_params, MYPLUGIN_CUSTOMIZER_PLUGIN_SERVER_URL), array('timeout' => 20, 'sslverify' => false)); $license_data = json_decode(wp_remote_retrieve_body($response)); global $active, $message; if($license_data->result == 'success' && $license_data->status == 'active'){ ?> <script>alert('Activated');</script> <?php }else{ ?> <script>alert('Deactivated');</script> <?php } ?>
Result is working and i get an alert Activated, but when i change the script alert to do action, code below :
if($license_data->result == 'success' && $license_data->status == 'active'){ add_action( 'plugins_loaded', array( $this, 'custom_customizer_running' ) ); }
nothing happen when check appereance->customize, my custom customize is still not appear.
Thanks for help
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Running add_action after validating license plugin’ is closed to new replies.