-
AuthorPosts
-
July 24, 2015 at 8:25 pm #478371
I am using this theme with a couple of plugins (‘wp job manager’ and (wp job manager) ‘field editor’).
They allow front-end posting of jobs, though they have been adapted for other purposes.
Users can visit the site and create custom posts (normally these are job adverts). The posts can be, but are not, created in the back end. All I have to do is ‘approve’ posts for them to go live.When creating a post, three of the fields in the submission form are text areas. I can choose ‘wp editor’ or ‘text area’. If I choose text area, I get unformatted text in a single paragraph, even though you appear to be able to paragraph it upon front-end input. I’m guessing this is intended.
If I choose ‘wp editor’ the tags (<p>, , etc) are all displayed and do not function. The plugin author says it must relate to the text editor used in the theme. Is there anything I need to do or know that you are aware of? Is the wp editor something that is disabled within the theme?
July 25, 2015 at 6:39 am #478559Hi brian7454!
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Regards,
RikardJuly 25, 2015 at 12:48 pm #478634Okay, details are below.
The plugins that relate to that page are ‘wp job manager’ and ‘WP Job Manager Field Editor’. Unfortunately, both are required for the post to exist and use data from both, so disabling them doesn’t help!
Using the dummy admin account, I created a post to illustrate what I mean.
I have included below the url of the published post and also the url of the front-end submission / edit screen for the post. You can see the before and after. If you need to. There are two text areas, and the rest are simple text fields.
If you view the published version you will see the text area block is totally unformatted. If I change the field type to ‘wp editor’ to allow formatting, it just prints the html tags on screen. In any event, all I want is to be able to create paragraphs or line breaks, nothing fancy.
Thanks guys.
July 29, 2015 at 7:40 am #480050Hi!
Is the html codes inside the input fields working when you switch to a default theme?
Best regards,
IsmaelJuly 29, 2015 at 8:32 am #480062Yes, with 2015, though changing the theme destroys the entire site….
Somebody logged on to the site from the Phillipines using the password and username I gave you. I hope that was you folks.. If it was, the activity log says they didn’t do anything or log out yet. I gave the example pages and explained how you could see how the editor doesn’t work. Did you see what I mean?July 30, 2015 at 1:29 pm #480663Hi!
I logged in to the site yesterday and yes, I can see the issue. Is it OK if we switch to a default theme while checking the site? We would like to fix the issue but unfortunately, we are not familiar with the plugin so it will help a lot if you can contact the plugin author. Note that we don’t provide support for third party plugins as stated on our support policy but we will try to find the issue.
Cheers!
IsmaelJuly 30, 2015 at 6:35 pm #480827Hello,
Thanks for the offer Ismael, but I tried switching themes and because of templates, etc, it didn’t help.However, I found the problem. I’ve not fixed it properly though. In the display template for the pages you looked at, I looked at the code and deleted and replaced it bit by bit. I realised that the two defective fields had esc_html in the code. I deleted that and suddenly everything works again. However, nothing I have tried to replace that code with seems to do the job properly and I know that code is required to protect from hackers. Someone suggested wp_kses_post but that takes me back to unformatted text again. All I really want is line breaks and maybe bold and italics….so not a lot. Also, everything I’ve read about wp_kses suggests it slows things down significantly.
How do you make a text area safe but let it display simple markup?
August 1, 2015 at 7:04 am #481642Hey!
You can try to replace it with the strip_tags function: http://php.net/manual/en/function.strip-tags.php
Example:
strip_tags($input, '<br><br/>');
Best regards,
IsmaelAugust 14, 2015 at 6:54 pm #487890Hello,
I found out what the problem was. I had used <?php echo esc_html …. which (I didn’t know) stripped the html I was trying to show. In the end <?php echo wp_kses_post… worked. -
AuthorPosts
- The topic ‘Unable to format text’ is closed to new replies.