March 27, 2023, 11:49am
Hi! I need to add a “Last Checked” field to the Child Site edit screen for our developers to update once they’ve checked a website. I’ve read this topic:
How do I add custom fields to site dashboard? and this topic: Customise Dashboard Menu of Managed Child Site, and have added the “Last Updated” column to the Manage Sites dashboard, but can’t figure out how to add a datepicker input to the Child Site edit screen.
Could I have a hand?
March 27, 2023, 7:26pm
To add new settings fields to the Site Edit page, you can use the
It’s documented here: mainwp_manage_sites_edit
Once you hook it up, you can use the something like this in the HTML part:
<div class="ui grid field">
<label class="six wide column middle aligned">Last Checked</label>
<div class="ui six wide column">
<div class="ui calendar mainwp_datepicker" >
<div class="ui input left icon">
<i class="calendar icon"></i>
<input type="text" placeholder="Date" autocomplete="off" id="" value=""/>
Let me know how it goes and if any additional help is needed
April 3, 2023, 9:06am
Hey Bogdan. Thanks for your reply! Sorry, I think I’m just still confused on how to actually hook this field up to the database so it can store a value?
April 3, 2023, 2:02pm
Can you please share the custom code you have so far I will review it and update what is missing.
April 7, 2023, 11:14pm
He means that the sampled code does not save the field to the database or retrieve it on page load of the site edit screen.
I need to do the same thing. When MainWP created the “clients” feature, the custom fields became client custom fields, so they apply to all websites where the client is used (I think that’s when it happend).
I need to have fields that are
only for the individual sites, so the normal Clients->client fields isn’t going to work.
I’ve been trying to figure out how to add custom fields only at the site level, and that allows them to be used in Pro Reports tags as well.
My use case is that each website has a certain maintenance plan level and plan options, and I need to save that info somewhere and be able to show it in the report.
April 10, 2023, 8:18pm
Let me try to provide more details about the whole process.
mainwp_manage_sites_edit action allows you to hook the HTML part. So you can use it to add a new field in the form.
However, to save the value on the Save Settings submission, you need to hook the code to the
To get the whole system working as expected,
Hook in the HTML part to the form
Hook in the code to save value
I will get a working example from our dev team and post it here as soon as possible.
May 11, 2023, 4:49pm
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.