Add values of post meta fields?

You can put the meta value of each post within an array while inside loop. Then just calculate the average of the ratings after the loop ends. for getting meta values you can see this link Function Reference/get post meta

Extract array from custom field

This is mostly pure PHP, but you need to implode the array. add_shortcode(‘bundled_ids’,’bundled_ids_func’); function bundled_ids_func() { $meta_values = get_post_meta( get_the_ID() , ‘_bundled_ids’, true ); if (!empty($meta_values)) { $mydata = implode(‘,’,$meta_values); // add this line return $mydata; } }

Website that sells statistics

Well to say that these custom fields are insecure in the wp core tables is to say that the usernames and passwords are also insecure, along with any private or password protected posts. As long as you are not outputting these custom fields anywhere but a secure page for logged in, paid up users, no … Read more

Show or hide custom fields by user’s role [frontend]

Yes, it is possible to hide or show custom fields by user’s role. Use current_user_can() for finding current user role. This function returns true if current user has capability or role. For example your current user is “wholesale” then you can use like this: <?php if( current_user_can(‘wholesale’)) { ?> // stuff here for wholesale <?php … Read more

How do I add custom fields to the “Edit page” admin screen?

In you code you are passsing ‘Page’ as object types. Please update your code as follows: $cmb = new_cmb2_box( array( ‘id’ => $prefix . ‘banner_media’, ‘title’ => __( ‘Banner media’, ‘foo’ ), ‘object_types’ => array( ‘post’ , ‘page’ ), ‘context’ => ‘advanced’, ‘priority’ => ‘default’, ) ); When set object types to Post and Page … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)