Skip to content

Instantly share code, notes, and snippets.

@keks55
Created April 10, 2018 07:01
Show Gist options
  • Save keks55/0bbcae9e088367cc3f31c1a7f2547f7a to your computer and use it in GitHub Desktop.
Save keks55/0bbcae9e088367cc3f31c1a7f2547f7a to your computer and use it in GitHub Desktop.
If checked - write to file
function dpr_checkbox() {
global $dpr_option_name, $dpr_options;
if(is_array($dpr_options) && $dpr_options['disable'] == '1'){
echo "ON";
$file = site_url()."/"."license.txt";
$f = fopen('new.php', 'a+') or die('error open file');
for ($i=0; $i < 3; $i++){
fputs($f,"\n$i");
}
fclose($f);
}
}
add_action( 'dpr_checkbox', 'dpr_checkbox' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment