Skip to content

Instantly share code, notes, and snippets.

@JimmyHowe
Last active December 11, 2019 21:51
Show Gist options
  • Save JimmyHowe/1b593d7e39bc2d2c193e2c67ed70789c to your computer and use it in GitHub Desktop.
Save JimmyHowe/1b593d7e39bc2d2c193e2c67ed70789c to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: WordPress Vue Tool
* Description: Example WordPress Vue Tool Plugin
*/
function wordpress_vue_tool_build_js()
{
wp_register_script('wordpress-vue-tool', plugin_dir_url(__FILE__) . 'app/dist/build.js', [], null, true);
}
add_action('wp_enqueue_scripts', 'wordpress_vue_tool_build_js');
function wordpress_vue_tool_shortcode()
{
wp_enqueue_script('wordpress-vue-tool');
$html = file_get_contents(plugin_dir_url(__FILE__) . 'app/embedded.html');
return $html;
}
add_shortcode('wordpress-vue-tool', 'wordpress_vue_tool_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment