Better file loading
-
Sometimes I need to load the plugin from the mu-plugins directory. This is the way to allow for both locations:
function sc_bpc_scripts(){ wp_register_script('sc-bpc-js', plugins_url( 'my-script.js', __FILE__), array('jquery')); wp_enqueue_script('sc-bpc-js'); } function sc_bpc_styles(){ wp_register_style('sc-bpc-css',plugins_url('my-style.css', __FILE__)); wp_enqueue_style('sc-bpc-css'); }
- The topic ‘Better file loading’ is closed to new replies.