Shortcodes inside a shortcode - wordpress

后端 未结 3 1281
攒了一身酷
攒了一身酷 2020-12-05 07:20

I created a shortcode which display the employees, the HTML look somthing like that:

3条回答
  •  醉梦人生
    2020-12-05 07:49

    You have to use shortcodes recursively to get the result.

    function start_employee($attr,$content){
              return '
      '.do_shortcode($content).'
    '; } add_shortcode("start_employee","start_employee"); function employee($attr,$content){ return '
  • name
    ;

    description

  • '; } add_shortcode("employee","employee");

提交回复
热议问题