text: Q:
  
  OOP and WordPress shortcode
  
  I tried to add a shortcode this way
  class MyPlugin {
  
      function __construct() {
          $this->make_shortcode();
      }
  
      function ShowMsg($cls, $lst4) {
          $data = shortcode_atts(array('phn' => '', 'msg' => ''), $atts);
          return 'You sent '.$data['msg '] .' from '.$data['phn'] ;
      }
  
      function make_shortcode() {
          add_shortcode('ShowMsg', 'ShowMsg');
      }
  
  }
  new MyPlugin;
  
  And [ShowMsg phn="123456" msg="Test Message"] isn't working, it's returning full shortcode instead of desired text.
  I need your advice to fix.
  
  A:
  
  That is not the way you add an object method as a callback. 
  function make_shortcode() {
      add_shortcode('ShowMsg', array($this,'ShowMsg'));
  }
  
  This is explained in the Codex as it pertains to actions and filters, but the principle is the same.
  I should add that anonymous classes make for painful debugging. Instantiate that class to a variable. It will save you headaches.
  
  