I am trying to: Create a custom taxonomy, the taxonomy will just have one option (possibly two).
My question is how can I select an option by default?
My scenario is a notification system. When a new post is published an email is sent to a list of subscribers, I want this to be the default action with the ability to turn the option off if required on a post by post basis.
My second question is how to remove unwanted functions in the metabox. Add new notification and Most Used are not required, I guess it could be done via CSS but wondered if there is another way.
To select a taxonomy term by default I have placed a PHP snippet I have in the functions.php file
The CPT name is event, the taxonomy name is send-to-subscriber and the default slug name I want to select is send. Any suggestions as to why this does not work?
hello, thanks for your response, unfortunately, it hasn't solved the issue. The code works and does set the custom taxonomy, but it fails to trigger the notification. I'm guessing this is something to do with timing/order of actions.
i have tried giving the action a higher priority but this failed to work also.
add_action( 'save_post', 'mfields_set_default_object_terms', 0, 2 );
Is there anything else you can suggest that would make this action trigger first before anything else or can a metabox be set using javascript client side.
The general save_post action must be used with a priority of at least 30 when used in conjunction with post types registered with Types, or inconsistencies in the updated data may be experienced.
So, could you please share problem URL and access details, I will try to fix this for you.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Sorry but I wanted to double check your requirement here.
I'm on following page which is used to create new club-news post and I see there is taxonomy available to select. hidden link
As I understand you want to attach " Send now" term automatically when user create new post for post type "club-news' - correct? Is there any other additional requirement you have?
Setting the taxonomy should trigger the Mailster newsletter plugin into sending an email to a list of subscribers. However, It only works if the taxonomy is set manually. The action you supplied must be triggering after the call to the newsletter plugin I think.
Ok thank you. Unfortunately, FTP access details not working at this end. Additionally, I do not have access to theme editor, that means I do not able to access the theme files.
Could you please send me working FTP access details.
I have set the next reply to private which means only you and I have access to it.