Can you ungroup Custom Fields?
You can create and position your own meta boxes via add_meta_box. You can store the data as meta data behind the scenes but it will allow you to customize the UI in the admin screens.
You can create and position your own meta boxes via add_meta_box. You can store the data as meta data behind the scenes but it will allow you to customize the UI in the admin screens.
Following the recomendations of @toscho i had a look at get_results and the following edits to the function ended up doing the trick. if ( ! function_exists( ‘get_meta_values’ ) ) { function get_meta_values( $key = ”, $type=”post”, $status=”publish” ) { global $wpdb; if( empty( $key ) ) return; $r = $wpdb->get_results($wpdb->prepare( ” SELECT pm.meta_value, pm.post_id … Read more
This is, as you guessed, default behavior. It’s stored in the wp_usermeta table for each user in the wp_user-settings meta_key and does not differentiate between different editor instances. On a side note, the tinymce version of wp_edior() does not cooperate very well with being inside a meta box. Especially if the metabox is moved, or … Read more
Take a look at meta.php:777: … CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$meta_compare_string})… So if you want to use DATE comparisons, you should use MySQL compatible date formats (YYYY-MM-DD). Change this part of your code: array( ‘key’ => ‘date’, ‘value’ => date(“Y/m/d”), ‘compare’ => ‘>=’, ‘type’ => ‘DATE’ ), to: array( ‘key’ => ‘date’, ‘value’ => date(“Y-m-d”), … Read more
First, keep in mind that pre_get_posts is a hook that is run on every single query that WP runs, so be very, very careful when utilizing it. That said, it is absolutely the best tool for what you want to do, and certainly better than writing a separate custom query in the page template. I’ve … Read more
You can use the filter hooks ‘add_post_metadata’ and ‘update_post_meta’, when a function hooked there return anything but NULL the process of adding/updating metadata is stopped. The two hooks passes almost same args: NULL post id the meta key the meta value being added/updated Only last argument is different, in case of update is previous value, … Read more
I recommend you look into the get_{$meta_type}_metadata filter. This is a basic hook setup to return a dynamic post meta value: <?php add_filter( “get_post_metadata”, function( $points, $post_id, $meta_key, $single ){ if ( ‘points’ == $meta_key && $single ) { update_post_meta( $post_id, ‘rank’, calculate_post_rank( $post_id, $points ) ); } return $points; }, 10, 4 );
I’m not entirely 100% on the order you are looking to achieve, but I think you need to spend a little more time with the documentation for WP_Query. An orderby array takes the name of a column in the wp_posts table OR meta_value or meta_value_num as the key, not the name of the custom field … Read more
I am doing the same thing at the moment and I just use the standard WP login/register systems/pages. You can use wp_signon() to do logon. Then on a standard page, you can create a custom template and use this for retrieving their info: wp_get_current_user() You will also need to get the customer user meta information … Read more
Ok, so here’s the right answer, with the full code for an ACF Repeater Field: $count = get_post_meta( get_the_ID(), ‘items’, true ); if ( $count ) { for ( $i = 0; $i < $count; $i++ ) { $item_100x100 = intval( get_post_meta( get_the_ID(), ‘items_’ . $i . ‘_item_100x100’, true ) ); $item_200x200 = intval( get_post_meta( … Read more