In my theme, i want to create a generic way of inserting a meta box to a post, page, portfolio or other custom item.
For now, this action is like :
add_action('admin_init', 'add_portfolio_settings');
Which works fine, but has a problem. It currently works only for creating an add_meta_box for a portfolio item. However, what if i wanted to add the same to a post or page ?
So, i would like to have add_action passing an argument to my add_portfolio_settings function, ideally an array, that specifies what the types that a new meta box should register under.
I've read stuff and tried different things about do_action, but i cannot get it to work. Any ideas ?
add_meta_boxes
oradd_meta_boxes_$type
action, it's why those 2 actions exist.