Support » Plugin: TablePress » Table ID – Advanced Custom Fields

  • Resolved therethere

    (@emotionaltrash)


    Hello there,

    i’m loving tablepress!

    I’m trying to get the tableID via Advanced Custom Fields.

    All work well i can get the table object with all the info the table has, but for some reason i cant get the tableID.

    How can i get this ID?

    many thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    I’m not really sure what you mean here. Where do you want to get the ID from, i.e. how do you query for it? The table IDs are stored in the tablepress_tables option in the wp_options table, where they are mapped to a post ID.

    Regards,
    Tobias

    Thread Starter therethere

    (@emotionaltrash)

    im using ACF, advanced custom fields, to associate a tablepress to a post.

    I can get the object data from the tablepress when i do get field for the selected tablepress.

    the problem is that the table ID is not getting in the query for the object data of the tablepress. All the content of the table is coming (content, etc) but not the tableID. I can get the postID of the selected table too but i dont know how can i get the tableID with the postid of the table.

    many thanks for all the help.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the clarification!
    I’m not sure if I understand the details, as I have never worked with ACF.

    How exactly are you associating the table to the post? What do you enter into ACF? The post ID of the tablepress_table post in the database table?
    That does not contain a reference to the used table ID, so that the better way might be to add a second custom field into which you enter the table ID.

    Regards,
    Tobias

    Thread Starter therethere

    (@emotionaltrash)

    We are using ACF and using the relationship option that gives the possibility to attach a tablepress object to a given article post. It’s pretty neat because this way they can avoid copy pasting the tablepressID manually and they just search for the wanted tablepress on that custom field by relationship directly inside the article they are creating.

    THe only problem here is that, i’m able to get allmost all the tablepress object data but not the tablepressID. Is there a way i can get it by the tablepress post ID?

    many thanks !

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    not really šŸ™ You would need to use PHP code to basically do an inverse search on the tablepress_tables option in the wp_options database table.

    Regards,
    Tobias

    Thread Starter therethere

    (@emotionaltrash)

    Ok, many thanks for the help. I will figure out another way to do this šŸ™‚

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem! Sorry, that I couldn’t really help with a solution here.

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Table ID – Advanced Custom Fields’ is closed to new replies.