Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Customize my input field in the backend WordPress


I need a new input field for a custom post type in the backend, so editors can easily fill in data without having to resort to custom fields. I have used add_meta_box() to make my own input field and it works fine - but I also need the two following things:

1) The input field has to play nice with qTranslate. Editors should not have to type in the shortcodes for a language. I want them to be able to switch the language for this input field easily like this:

2) The content of this input field will be displayed as an unordered list in the frontend later. Ideally the editors should see the button for lists in the backend so they can make a list. However I don't want them to have a TinyMCE here. They might copy and paste their list in here and I fear the TinyMCE will keep any formatting they might accidentally include here. Not sure about that. An alternative idea: they would hit enter after each list item and you will add the appropriate <ul> and <il>.

The method I've used to add my own input field is explained rather nicely here (see "Adding Our Own Inputs"):

I want you to improve on this code so my two requirements are met.

Answers (2)


Denzel Chia answers:


You can start by <strong> posting your exact codes for creating your custom post type and meta box here,</strong> so that people don't waste time answering here. Or in other words, so that people maybe interested to answer your question.

I had downloaded and installed the qTranskate plugin, roughly read through the codes.
The qTranslate plugin actually uses jQuery to rewrite the inputs and text areas of the WordPress admin. It does not add, it rewrites, so you need the actual ID of the input or text area of the meta boxes, to even begin adding the three flag images which are actually divs with images.

In order to add qTranslate to a custom meta box, you need to at least modify three functions that rewrites the custom meta box, and for the front end, which I haven't read yet, you would need to use qTranslate to process the custom post meta before presenting on browser.

All the above is only for your question 1.

For question 2, you need to add tinymce list button to the meta box, then use jquery to scan the meta box input or text area for unwanted HTML tags and remove them, probably trigger by on mouse out event.

<strong>I personally think that this question is best left for engaging a developer to develop. And not post here as a question. As this is not something you can do within a few minutes or two hours. I took about an hour just to read and understand one file of the plugin. Reading and understanding the qTranslate plugin alone will take hours, before anyone can start working on the question with correct answers. Only the qTranslate plugin author or anyone familiar with qTranslate, will be able to answer this question efficiently and worth the value of the price.</strong>



Achim Baur comments:

Thank you Denzel for your reply. I did not realize I was aiming to high here. I am trying to get the question withdrawn.


Victor Teixeira answers:

I think the best approach for you would be using the Fields plugin ( wich have a duplicable field functionality (wich you can use to build your list) and the WPML plugin for multilingual content.

This definitely should work.