get_custom_table_field()

Returns the value of a specific field from a custom table.

Parameters

get_custom_table_field( $custom_table_name, $selector, [$post_id] )
  • $custom_table_name (string) (Required) The custom table name
  • $selector (string) The ACF field name. (i.e. column name)
  • $post_id (mixed) (Optional) The post ID where the value is saved. Defaults to the current post.

Example

Get a value from the current post

get_custom_table_field('wp_products', 'name');

Get a value from a specific post

get_custom_table_field('wp_products', 'name', 123);

Upgrade to PRO