hi john. will the customer use the dashboard and the tinymce editor?
you could extend the tinymce.
Here is one Example
Hi afr0, thanks for your response,
I wanted to get away from using the tinymce / WYSIWYG as the customer will likely mess the table up and cause problems, also there would be no way to prevent the display of the out of date items without deleting them manually and I need to have them kind of archived on the admin page… I thought about just using the wordpress revisions as the archive but the customer doesn’t want that. They want to be able to see previous entries.
having spent hours today looking into this, it seems i should be able to do what I’m looking for, exactly how I’m not sure but it looks like I need to use the add_post_meta function with an array to include multiple values….
however i don’t know how to add in a button to a custom post which will trigger the add_post_meta to add in another row?
can anyone help?
Hello johnsimpson_uk,
excuse my english, I#m no native speaker.
As long as I understood your question, you try to add a button in the edit post page, and this button should be able, to display a new row with input-tags.
I think you have to use javaScript to create the additional input-filds with an array and count up the index.
The firs input would be:
<input name="name[1][]" type="text" size="8" value="value" />
the second
<input name="name[2][]" type="text" size="8" value="value" />
You can create the number in js and save them with update_post_meta.
Greets paka
What you’re looking for needs to be done in two separaete locations in two separate ways.
Firstly, you’ll need to set up a new meta box using add_meta_box() that wil ldisplay any current items and will output the JavaScript that’s needed for step 2.
Secondly you’ll need to use a JavaScript function to listen on an ‘Add’ button and use that event to add in a new row with whatever fields/details you need to have in it.
Thirdly, you’ll need to use save_post() to save the values that are passed back from the fields in the meta box. You’ll have to watch your field names as you don’t want any two to be the same or they’ll only take the last value that’s passed. You can get around this using something like name="field[]" to send back arrays, so there’s ways to get around this.
As for not allowing the user ot edit past dates, add in some code in the meta box that will switch between displaying the data in fields if it’s not passed the date, or displays it as non-editable text if it has passed the date.
It’s not quite so easy, but it’s not as bad as it sounds. I have odne a lot owrse then this, but it’s not what I’d consider a “beginner” exercise. π
guys this is great thanks I don’t class myself as a beginner but I’m no expert either so I will have a shot at it but if I am really struggling would you be interested in doing this (paid of course).
I hope you can get it. There’s a lot of resources that will help, and if you get stuck with anything you can post here again and I’m sure you’ll get some help.
As for getting someone to do it for you, you’re best off posting on http://jobs.wordpress.net/ as asking for paid help on these forums is not exactly encouraged…