• Resolved millonario

    (@millonario)


    Hello, I want to insert this shortcode in php: [table-cell id = 123 row = 1 column = 1 /]

    How could he do it? I have tried like this, but it does not work:

    ? <? php tablepress_print_table_info (array (‘id’ => ‘1’, ‘row’ => ‘1’, ‘column’ => ‘1’)); ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The [table-cell] Shortcode does not have a direct companion as a template tag function. You can however just embed it in a do_shortcode() call (which is possible for every Shortcode:

    echo do_shortcode( '[table-cell id=123 row=1 column=1 /]' );
    

    Regards,
    Tobias

    Thread Starter millonario

    (@millonario)

    Thank you very much, I wanted the PHP option, because I want to put another shortcode in to get a table number, do you know how I could do it? I want to do something similar to this:

    [table-cell id=123 row=[id_user] column=1 /]

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    then just create the Shortcode (which is just a string) on the fly ??

    $user_id = ...;
    echo do_shortcode( "[table-cell id=123 row={$user_id} column=1 /]" );

    Regards,
    Tobias

    Thread Starter millonario

    (@millonario)

    Thank you very much, I will try to do it!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘insert table with php’ is closed to new replies.