title: Calling a php function from a wordpress site
body: <p>I'm trying to create a link/button inside a wordpress site which starts a plugin if you click on it (in my case it should make a cookie banner appear). I'm completely new to this so I'm not 100% sure which function actually starts the cookie banner but i assume it's <code>function func_wp_vue()</code>inside the <code>main.php</code>. The main.php looks like this:</p>
  <pre><code>&lt;?php
      function func_load_vuescripts() {
          wp_register_script('wp_js', plugin_dir_url( __FILE__ ).'dist/js/app.js', [], '1.0.0', true);
          wp_register_script('wp_js1', plugin_dir_url( __FILE__ ).'dist/js/chunk-vendors.js', true);
          wp_register_style('wp_css', plugin_dir_url( __FILE__ ).'dist/css/app.css', true);
          wp_register_style('wp_css1', plugin_dir_url( __FILE__ ).'dist/css/chunk-vendors.css', true);
      }
      add_action('wp_enqueue_scripts', 'func_load_vuescripts');
  
      function func_wp_vue(){
          wp_enqueue_script('wp_js');
          wp_enqueue_script('wp_js1');
          wp_enqueue_style('wp_css');
          wp_enqueue_style('wp_css1');
  
          $str =  &quot;&lt;div id='app'&gt;&quot;
                  .&quot;&quot;
                  .&quot;&lt;/div&gt;&quot;;
          return $str;
      }
      add_shortcode( 'cookie', 'func_wp_vue' ); 
  </code></pre>
  <p>The plugin is uploaded and loads on the site but i would like to manually activate the cookie banner again if i click on the link/button.
  I tried to implement it with<code>&lt;p&gt;&lt;a href=&quot;wp-content/plugins/cookie/main.php&quot;&gt;Click me&lt;/a&gt;&lt;/p&gt;</code> into the wordpress site but just get this error:</p>
  <p>Fatal error: Uncaught Error: Call to undefined function add_action() in /home/www/wordpress-cookie/wp-content/plugins/cookie/main.php:16 Stack trace: #0 {main} thrown in /home/www/wordpress-cookie/wp-content/plugins/cookie/main.php on line 16</p>
  <p>Any help is appreciated!</p>