Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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?

    #478559

    Hi 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,
    Rikard

    #478634

    Okay, 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.

    #480050

    Hi!

    Is the html codes inside the input fields working when you switch to a default theme?

    Best regards,
    Ismael

    #480062

    Yes, 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?

    #480663

    Hi!

    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!
    Ismael

    #480827

    Hello,
    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?

    #481642

    Hey!

    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,
    Ismael

    #487890

    Hello,
    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.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Unable to format text’ is closed to new replies.