19.1 Hiển thị shortcode (ok)

C:\xampp\htdocs\test\wp-content\plugins\plugin-name\public\class-wpf-public_ct.php

<?php  
	class WPF_Public_CT {
		private $plugin_name;
		private $version;
		public static function get_instance() {
      static $instance = null;
      if ( $instance === null ) {
          $instance = new self;
      }
      return $instance;
    }
    private function __construct() {
    	$this->plugin_name = WPF_CT::get_instance()->get_plugin_name();
      add_shortcode( 'searchandfilter', array( $this, 'shortcode' ) );
    }
    public function shortcode( $atts ) {
      echo 'aaaaaa';
    }
	}
?>

Last updated