How to add custom supports for custom post types?

i need to define a custom support feature for my WordPress Plugin but i can’t find how to do so.

What i want to do is to display a box on certain custom post type containing 2 meta fields in which users can type in Longitude and Latitudes values for geolocalisation purposes.

For practical uses, i want to attach this custom feature the same way as supports are to posts :

<?php
$args = array(


‘supports’ => array(‘title’,’editor’, ‘thumbnail’, ‘my_custom_support’),


);
register_post_type(‘my_custom_post_type’, $args);
?>

OR, if my custom post type has already been created beforehand:

<?php
add_post_type_support(‘my_custom_post_type’, ‘my_custom_support’);
?>

I know what i want but i just can’t find how to register new supports …

I hope someone can answer this problem because i’m actually tearing off my hairs !

Read more here:: How to add custom supports for custom post types?

Leave a Reply

Your email address will not be published. Required fields are marked *