How to hide custom fields added by a plugin?

I think, that the plugin create this meta boxes dynamicly not with the WordPress Core functions, like add_meta_box. This is the reason, that you can not hide this boxes with remove_meta_box. The markup is hard coded in the plugin files and not a part from the WordPress API. But easily you can hide via javascript. … Read more

Meta query relation ‘OR’ not working as expected

You are looking for this, most probably. Note: meta query support a compare method what is ‘IN’, which means any of the value. Like this – if( isset($_GET[‘H_property_type’]) ){ // you don’t need relation for this // if(count($_GET[‘H_property_type’]) > 1){ // $args[‘meta_query’][‘relation’] = ‘OR’; // } // if $_GET[‘H_property_type’] is an array // foreach ($_GET[‘H_property_type’] … Read more

Can wp_insert_post_data filter be used to save custom field data?

You can access the raw $_POST data from the wp_insert_post_data filter, but there are probably better ways to intercept that data. save_post or similar hook would probably work As you are dealing with post_meta, update_post_meta uses update_metadata which provides the update_{$meta_type}_meta and updated_{$meta_type}_meta filters. Those may be the best for you but your question is … Read more

Let Users Filter Posts by Custom Fields

Have you ever try to use ‘custom taxonomy’ to categorize the cars? I think taxonomy should be a more proper way to do this. You could register car brands like: // Register Custom Taxonomy function wpse_131586_custom_taxonomy() { $labels = array( ‘name’ => _x( ‘Brands’, ‘Taxonomy General Name’, ‘wpse’ ), ‘singular_name’ => _x( ‘Brand’, ‘Taxonomy Singular … Read more

Changing order in which custom fields appear in dashboard

If you’re talking about the WordPress custom fields (no external resource like plugin etc.), then the answer is: No, unfortunately not. The meta box calls has_meta and list_meta – and none of these functions provides suitable filter/action hooks. The custom fields are ordered by meta_key,meta_id. Of course, you can set up your own meta box. … Read more

Showing Custom Fields on Parent Page

I had the same issue, and found three ways to solve it. Types is really hard to convince to read data out of a different post than the current one in the loop… That’s the first solution, just create a loop using query_posts() and get the data there via types_render_field() as usual. Just remember to … Read more