title: Shortcode class output to be returned from a different external class
body: <p>When creating a shortcode as object, this is the class:</p>
  <pre><code>class class_shortcode{
      function __construct(){
          add_shortcode( 'SHORTCODE_NAME', array( $this, 'shortcode_output' ) );  
      }
  
      function shortcode_output( $atts, $content ) {
          // create some output
          return $output;
      }
  }
  </code></pre>
  <p>But there happens to be an external class handling the shortcode output, like this:</p>
  <pre><code>class class_shortcode_output{
      function shortcode_output(){
          // create some output
          return $output;
      }
  }
  class class_shortcode{
      function __construct(){
          $this-&gt;display = new class_shortcode_output;
          // Then, the shortcode output will be returned by $this-&gt;display-&gt;shortcode_output()
  
          add_shortcode( 'SHORTCODE_NAME', array( $this, 'display', 'shortcode_output' ) );   &lt;---- THIS IS WHERE I AM STUCK
      }
  }
  </code></pre>
  <p>So I need the output in within <code>class_shortcode</code> to be handled by <code>$this-&gt;display-&gt;shortcode_output()</code> from the other class <code>class_shortcode_output</code>. Is it possible?</p>
  <p>I am trying these syntaxes:</p>
  <pre><code>array( $this, 'display-&gt;shortcode_output' )
  array( $this, 'display', 'shortcode_output' )
  array( $this, array( $this, 'display' ), 'shortcode_output' )
  </code></pre>
  <p>But nothing is working, is it possible to accomplish what I need?</p>