WordPress.org

Forums

Custom Tables
Own Db Field (6 posts)

  1. degar007
    Member
    Posted 1 year ago #

    In the premium version its possible to create your own db fiels, so i did.

    They all write nicely to the database, the question that I have is how to use them, as they do not show up in any dropdown, or form creation.

    does anyone know how use them ?

    https://wordpress.org/plugins/custom-tables/

  2. degar007
    Member
    Posted 1 year ago #

    After long testing I did come up with a sollution

    lets say you wish to create a user which gets the currently logged in user and writes it to the database table that you created...

    create table user---varchar32 in the database that you are currently using, then just add this to your (form) entry setup:

    <input class="wct-formchar32" type="text" name="wctf_user" value="[wctphp]
    echo echo $current_user->user_login;;
    [/wctphp]" maxsize="32"/>
    Date:
    {date}

    The date is set up as a date, in the tables the user is set up as a normal varchar32 field. With this method, you do not have to create "Own Db Field" (as I have never gotten them to work)

  3. degar007
    Member
    Posted 1 year ago #

    sorry forgot the

    $current_user = wp_get_current_user();

    so it should be

    <input class="wct-formchar32" type="text" name="wctf_user" value="[wctphp]
    $current_user = wp_get_current_user();
    echo echo $current_user->user_login;
    [/wctphp]" maxsize="32"/>
    Date:
    {date}
  4. ccsnjf
    Member
    Posted 1 year ago #

    Never gotten "Own Db Field" to work either. Raised this with the plugin author ages ago. :-(

  5. degar007
    Member
    Posted 1 year ago #

    Yea, neither have I, and I didn’t really feel up to it going through his code...that’s why I came up with this alternative (which actually works well).

    I am actually working with this plug-in for a rather large inventory system, and know it pretty well by now. If you have any questions, and I know the answer, I will answer.

    All the best.

  6. Stefan M.
    Member
    Plugin Author

    Posted 1 year ago #

    [wctphp]echo 'USERNAME';[/wctphp]

    Thats all you need.

    USERNAME will automatically be replaced with the username of the logged in user.

    Regards

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Tables
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic