• Resolved bb23hk

    (@bb23hk)


    Hi, I have a table with a field that contains post id (of a custom post type). My question is when I insert a new record, I would like to read-only this field and give a default value.

    Currently, I am pasting the post id via ?post_id=999 on the URL. To insert the shortcode, I use:-

    <?php
    if (isset($_GET[‘post_id’])) {
    $thepost_id = $_GET[‘post_id’];
    $thispost = get_post( $thepost_id, OBJECT );
    echo ‘<p>Editing ‘ . $thispost->post_title . ‘</p>’;
    echo ‘[wpdatatable id=3 var1=’ . $thepost_id . ‘]’;
    echo ‘<div id=”thispostid” style=”display: none;”>’ . $thepost_id . ‘</div>’;
    } else {
    echo ‘<p>No Class Data</p>’;
    }

    echo <<<EOT
    <script>document.write(‘Click me to go Back‘);</script>
    EOT;

    And I use “where classname= %VAL1%” in SQL. Any ideas?

Viewing 1 replies (of 1 total)
  • Plugin Author wpDataTables

    (@wpdatatables)

    Hello there

    Creating tables using SQL queries is not included in the Lite version of the plugin, so it seems you have the full version installed.

    Due to rules of wordpress.org, we cannot provide support for the full version of the plugin on this forum.

    Please access our official support platform and open a new ticket, and one of our support managers will gladly help. You can access the platform from our official website.

    Kind regards.

Viewing 1 replies (of 1 total)

The topic ‘default column value during insert’ is closed to new replies.