• Resolved awezoom

    (@awezoom)


    Hi. We’re trying to use this in a custom-type template in PHP, and I should be using the do_shortcode, but since the shortcode call here is something like this:
    [wp-datatable id=”mtable” fat=”1″]
    paging: true,
    responsive: true,
    ordering: true,
    buttons: [
    ‘copy’, ‘csv’
    ]
    [/wp-datatable]
    I don’t know how to deal with this by using the do_shortcode function. Any help on how to approach this? thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author samsk

    (@samsk)

    Simply pass the whole code to do_shortcode() as 1st argument, it should work.

    echo do_shortcode('[wp-datatable id=”mtable” fat=”1″]
    paging: true,
    responsive: true,
    ordering: true,
    buttons: [
    ‘copy’, ‘csv’
    ]
    [/wp-datatable]');

    I would assume.

    Plugin Author samsk

    (@samsk)

    No, beware of quotation:

    echo do_shortcode('[wp-datatable id=”mtable” fat=”1″]
    paging: true,
    responsive: true,
    ordering: true,
    buttons: [
    "copy", "csv"
    ]
    [/wp-datatable]');
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to make it work in PHP with do_shortcode’ is closed to new replies.