0

I am trying to attach my js and CSS files but it's not working can anyone help me out?

Here is my code.

add_action( 'wp_enqueue_scripts', 'script_manager');
public function script_manager() {
    wp_register_script( 'wc-'.self::$endpoint."-js" , plugin_dir_url(__FILE__).'template/shCore.js', array( 'jquery' ), '1.0', true );

}
MaxiGui
  • 6,190
  • 4
  • 16
  • 33
Abdul Basit
  • 161
  • 1
  • 1
  • 11
  • What's not working? Do you see the output of the script URL in your markup? This also appears to be part of a PHP class. Check this out: https://wordpress.stackexchange.com/questions/99067/enqueue-scripts-inside-a-class-in-a-plugin – disinfor Oct 12 '20 at 18:36
  • Yes, it's a PHP class code and URL that appears correct. But the script is not being attached http://siteurl/wp-content/plugins/gprofile/template/shCore.js?ver=1.0 – Abdul Basit Oct 12 '20 at 19:01
  • What do you mean "not being attached"? If you can see the URL in the markup, the script is there. – disinfor Oct 12 '20 at 19:50

0 Answers0