admin_url(‘admin-ajax.php’),
‘nonce’ => wp_create_nonce(‘sd_converter_nonce’)
));
}
public function shortcode_handler($atts) {
$atts = shortcode_atts(array(
‘type’ => ‘all’,
‘theme’ => ‘default’
), $atts);
ob_start();
include SD_UNIT_CONVERTER_PLUGIN_PATH . ‘templates/converter-template.php’;
return ob_get_clean();
}
public function activate() {
// Plugin activation tasks
flush_rewrite_rules();
}
public function deactivate() {
// Plugin deactivation tasks
flush_rewrite_rules();
}
}
// Initialize the plugin
new SD_Unit_Converter();
?>