Navigation überspringen

[Gelöst] Query custom field

This support ticket is created vor 1 Jahr. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 7 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 1 Jahr.

Assistiert von: Minesh.

Author
Artikel
#2674531

Hi, I have a Toolset custom field:
wpcf-plant-notes.
How would I query this field to display all existing values?
Can I find it using PHPMyAdmin?

Your help much appreciated

#2674593

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please tell me where exactly you want to display all the existing values for your custom field "wpcf-plant-notes"?

Do you want to add view filter or you have different usage?

In addition to that - Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

#2674607

Hi Minesh, thanks for reply.
I just need to query wpcf-plant-notes to see where it's used, not important if it's from the front or back end.

Thanks

#2674621

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Toolset post custom field stored in postmeta database table.

So you can query the postmeta table where meta key equal to your desired key i.e. wpcf-plant-notes

And you will be able to see all the values.

#2674747
wpcf-plant-notes.JPG

Hi Minesh,
Followed you instructions and arrived to attached image, but can't find the (plant) post specified by post_id.
Any ideas?

Thanks

#2674761

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

You can click on "Search" tab and search for your key as well as for your desired post id.

#2674769

Hi Minesh,
Added this to functions.php:

function add_column( $columns ){
$columns['post_id_clmn'] = 'ID'; // $columns['Column ID'] = 'Column Title';
return $columns;
}
add_filter('manage_posts_columns', 'add_column', 2);

function column_content( $column, $id ){
if( $column === 'post_id_clmn')
echo $id;
}
add_action('manage_posts_custom_column', 'column_content', 2, 2);

to see post ID in plants - but the post ID for wpcf-plant-notes doesn't appear, also if i enter an ID that exists and click "Search" nothing is found - what am I doing wrong?

#2674773

Minesh
Supporter

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

You should be using admin columns plugin to add such columns and search for it.
- https://wordpress.org/plugins/codepress-admin-columns/