Skip to content

Instantly share code, notes, and snippets.

@rali14
Created May 10, 2019 20:40
Show Gist options
  • Save rali14/3407a1b3efe149cfa3f17caff8743eda to your computer and use it in GitHub Desktop.
Save rali14/3407a1b3efe149cfa3f17caff8743eda to your computer and use it in GitHub Desktop.
Hide the license key within LearnDash
/*
* Temporary function to hide the license key entered for LearnDash LMS
* Add the below to your child theme's functions.php file or as a code snippet using a third party plugin such as: https://en-ca.wordpress.org/plugins/code-snippets/
*/
function ld_hide_license_key() {
echo '"<script type="text/javascript">jQuery( "#nss_plugin_license_sfwd_lms" ).val( "**********" );</script>"';
}
add_action('admin_footer', 'ld_hide_license_key');
Please remember to take a complete backup of your site before making any changes.
@lelandf
Copy link

lelandf commented Jan 6, 2021

Just piggybacking off this snippet to include the "Bootcamp" license key input as well.

function ld_hide_license_key() { echo '<script type="text/javascript">jQuery( "input[name=\'nss_plugin_license_sfwd_lms\']" ).val( "**********" );</script>'; } add_action('admin_footer', 'ld_hide_license_key');

Basically just changing the selector to match any input with the name "nss_plugin_license_sfwd_lms" which covers both, and potentially other input fields controlling the same setting value.

@lelandf
Copy link

lelandf commented Jan 6, 2021

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