title: Call function in includes folder that have php file into another php file - Wordpress Plugin
body: <p>This is about the WordPress plugin.</p>
  <p>I look at other people WordPress plugin has somewhat like this code:</p>
  <p>example.php</p>
  <pre><code>&lt;?php
  
      $display = get_option( 'display' );
      
      if(!defined('PLUGIN_DIR'))
          define('PLUGIN_DIR', dirname(__FILE__));
      
      function init() {
        load_plugin_textdomain('example', false, basename( dirname( __FILE__ ) ) . '/lang' );
      }
      add_action('plugins_loaded', 'init');
      
      include(PLUGIN_DIR . '/includes/display.php');
  
  ?&gt;
  </code></pre>
  <p>and then there is includes a folder that has display.php</p>
  <p>have code like this:
  display.php</p>
  <pre><code>&lt;?php
  
      function display(){
      
      //thecodes
      
      }
   ?&gt;
  </code></pre>
  <p>I've tried this coded concept. From what I analyze, if I'm not wrong, this code for calling functions in display.php, call the function display(){} code</p>
  <p>this is my structure:</p>
  <pre><code>&gt;includes
  
  &gt;&gt;functions.php
  
  achan.php
  
  index.php
  </code></pre>
  <p>and, this is my code look like:</p>
  <p>achan.php</p>
  <pre><code>&lt;?php
  
      $test = get_option('test');
      
      define(PLUGIN_DIR . dirname(__FILE__));
      
      
      include(PLUGIN_DIR . 'includes/functions.php');
      
      function testing(){
          global $test;
          echo ($test);
      
      }
      add_action('bbp_theme_after_reply_author_details', 'testing');
  
  ?&gt;
  </code></pre>
  <p>and in includes folder, have functions.php
  my code like this:
  functions.php</p>
  <pre><code>&lt;?php
  
      function test(){
          echo &quot;HELLO&quot;;
      }
   ?&gt;
  </code></pre>
  <p>But not working. Is there any wrong with my codes? the Hello not displayed at bbp_theme_after_reply_author_details. or maybe there is a more efficient way to call a function in another folder PHP file? Thank you, web developer.</p>