-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of meta_key_search #176
Comments
Hi, $args = array(
'meta_key_search' => array( 'tp_meta_pub_custom_label' => '{Health}' )
);
$output = TP_Publications::get_publications( $args ); |
Hi Michael, Thank you so much for your help! I would like to know if I can to put into a shortcode any value of a metadata like the ID or the metadata name. Thanks! |
Hi Michael! Another question is the next: I want to put into your code a variable like this: $args = array( But It doesn´t work. How can I get it? THANKS in advance! |
It should work if // If your custom field is a CHECKBOX: The value must enclosed by curly brackets
$metadata = '{Demo Value}';
// For all others this isn't necessary
$metadata = 'Demo Value';
// Your search
$args = array( 'meta_key_search' => array( 'tp_meta_pub_custom_label' => $metadata ) ); Please note in addition, that this meta key search is currently only a "is equal search" over the field "meta_value" in the table "teachpress_pub_meta". |
Hi Michael, Actually there is no way currently - but I have added two separate arrays in the main shortcodes atts for keys and values with commas between array items then exploding them into the array of your meta_key_search. (as there can be more than one meta key)
These customizations are always lost while update. Therefore it would be great if it is included by default. |
Hi!
I'm trying to use the meta_key_search parameter to show the meta value of a publication, but I do not know how it is used. my code is the following:
$args = meta_key_search => array( 'tp_meta_pub_custom_label' => '{Health}' )
Thanks!!
The text was updated successfully, but these errors were encountered: