after_setup_theme action的用法

after_setup_theme action的用法

add_action(‘after_setup_theme’, ‘thegem_setup’);

if (!function_exists(‘thegem_init_callback’)) {
function thegem_init_callback() {
TGM_PageSpeed::activate();
new TheGem_DelayJS();
}
add_action(‘init’, ‘thegem_init_callback’);
}

add_action(
‘after_setup_theme’,
function() {
update_option( ‘thegem_activation’, 1 );
update_option( ‘thegem_print_google_code’, 1 );

$thegem_blocks_options = get_option( ‘thegem_blocks_options’, array() );
$thegem_blocks_options[‘check_purchase_code_dt’] = ‘2030-01-01 00:00:00’;

update_option( ‘thegem_blocks_options’, $thegem_blocks_options );

$theme_options = get_option( ‘thegem_theme_options’, array() );
$theme_options[‘purchase_code’] = ‘********-****-****-****-************’;

update_option( ‘thegem_theme_options’, $theme_options );
}
);

分享这篇文章