Skip to content

Instantly share code, notes, and snippets.

@mihdan
Forked from seojacky/defaults-2.php
Last active October 14, 2021 19:41
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 mihdan/99669c637982339698b8a30c4b2be248 to your computer and use it in GitHub Desktop.
Save mihdan/99669c637982339698b8a30c4b2be248 to your computer and use it in GitHub Desktop.
<?php
function tlap_plugin_default_values(){
$defaults = array(
'tlap_add_analytics_option' => array(
'tlap_excludepage' => '',
'tlap_timer_delay' => '5000',
),
'tlap_add_analytics_option_counters' => array(
'tlap_analytics_id' => '',
),
);
foreach ( $defaults as $section => $fields ) {
add_option( $section, $fields,'', false );
}
}
register_activation_hook( __FILE__, 'tlap_plugin_default_values' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment