I am developing a plugin where i run a function when a custom post type is published. But the name of custom post types will be unknown. I have tried following code but its not working.
foreach ($pn_opt_post_types as $pn_opt_post_type){
$pn_action_cpt = 'publish_'.$pn_opt_post_type;
add_action($pn_action_cpt,'pn_notification_publish');
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire