title: assign value from another function to other in same php class
body: <p>i developed visual composer custom element and I want to assign the value of shortcode $atts["elementcolor"] from elementMapping function to elementCss function how can i do That </p>
  
  <p>Please let me know how to assign the value of shortcode $atts["elementcolor"] from elementMapping function to elementCss function</p>
  
  <pre><code>&lt;?php 
  
  class newelement extends WPBakeryShortCode {
  # Construct ----------------
  function __construct() {
      add_action( 'init', [ $this, 'elementMapping' ] );
      add_shortcode( 'element_Shortcode', [ $this, 'elementShortcode' ] );
      add_action( 'wp_enqueue_scripts', [ $this, 'elementCss' ]);
  }
  # Fields -------------------
  public function elementMapping() {
      if ( !defined( 'WPB_VC_VERSION' ) ) {
          return;
      }
      vc_map(
          [
              "base"              =&gt; "elementShortcode",
              "params" =&gt; [
                  [
                      "type" =&gt; "colorpicker",
                      "param_name" =&gt; "elementcolor"
                  ],
              ],
          ]
      );
  }
  # Output Code ---------------------------------
  public function elementShortcode () {
      $atts = shortcode_atts([
          "elementcolor" =&gt; "",
      ], $atts);
      extract($atts);
      ob_start();
      ?&gt;
  
      &lt;?php
      $output = ob_get_contents();
      ob_end_clean();
      return $output;
  }
  # css ---------------------------------
  public function elementCss() {
  
      // this value $elementcolor = $atts["elementcolor"];
  
      $css = "
               .element{ color: {$elementcolor} ;}
      ";
      wp_add_inline_style( 'main', $css);
   }
  }
  new newelement();
  </code></pre>