WordPress.org

Ready to get started?Download WordPress

Forums

Code changes upon saving (8 posts)

  1. thecolourinbetween
    Member
    Posted 1 year ago #

    Hi there,

    I've recently purchased the Daisho theme. They have these lovely social media icons that you can put in your footer via a text box.

    All you have to do is insert code like this:

    <ul id="social">
    	<li><a href="javascript:void(null);"><span class="social-icon">y</span></a></li>
    	<li><a href="javascript:void(null);"><span class="social-icon">t</span></a></li>
    	<li><a href="javascript:void(null);"><span class="social-icon">s</span></a></li>
    	<li><a href="javascript:void(null);"><span class="social-icon">f</span></a></li>
    	<li><a href="javascript:void(null);"><span class="social-icon">m</span></a></li>
    	<li><a href="javascript:void(null);"><span class="social-icon">r</span></a></li>
    	<li><a href="javascript:void(null);"><span class="social-icon">l</span></a></li>
    </ul>

    Except as soon as I click on save I see it change to:

    <ul>
    	<li><a href="void(null);"><span class="social-icon">y</span></a></li>
    	<li><a href="void(null);"><span class="social-icon">t</span></a></li>
    	<li><a href="void(null);"><span class="social-icon">s</span></a></li>
    	<li><a href="void(null);"><span class="social-icon">f</span></a></li>
    	<li><a href="void(null);"><span class="social-icon">m</span></a></li>
    	<li><a href="void(null);"><span class="social-icon">r</span></a></li>
    	<li><a href="void(null);"><span class="social-icon">l</span></a></li>
    </ul>

    I've disabled all plug ins although I don't really have that many installed. What could be going wrong?

  2. s_ha_dum
    Member
    Posted 1 year ago #

    There is a form that lets you paste in that code? Sounds like that is something created by the Daisho theme. Have you asked the creators of that theme for help?

  3. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

  4. <a href="void(null);"></a></li>
  5. blocked by all major browsers (requires trusted source status) - use an up to date theme.

  6. udaraaka
    Member
    Posted 1 year ago #

    I think this is because WordPress use some data validation before it insert the data into the database. See here

    http://codex.wordpress.org/Data_Validation

    If this theme use some core WordPress functions to save this content then your code can be affected by Data validation

    You can check this by creating a sample post (that you can delete later) and putting your above code there. Check the output of that post after saving

  7. thecolourinbetween
    Member
    Posted 1 year ago #

    Turns out this was the issue from the words of the Theme Developer:

    "Too bad you didn't include info that it's "Text Widget". They think you're referring to some custom field in admin panel created by us :) The last reply is correct: http://codex.wordpress.org/Data_Validation but that's all we know - it uses SOME validation and removes id="" and leaves class="" intact.

    I'll skip investigation on why it removes id="" and I just fixed it on your server by replacing it with class="". It works on your server. On demo server (also WP 3.4.1) we use id="" and it doesn't remove it when I hit "Save" in "Text Widget".

    The reason I suspect: your DATABASE (and not WordPress) removes that for some reason. That's rational explanation because we both use WP 3.4.1 on test server and your server."

  8. udaraaka
    Member
    Posted 1 year ago #

    I don't think that this is a problem with your DATABASE. He is just trying to hide his faults.

  9. s_ha_dum
    Member
    Posted 1 year ago #

    The reason I suspect: your DATABASE (and not WordPress) removes that for some reason. That's rational explanation because we both use WP 3.4.1 on test server and your server."

    No way. The database does not selectively remove bits and piece of HTML. That is nonsense.

    Also, not counting functions that completely strip markup, I've never noticed WordPress data validation functions remove 'ids' while leaving 'classes'. That makes no sense from a security standpoint. 'ids' aren't security risks. Possibly if you pasted from a Word Processor (like MS Word) you may have had a weird cascade that removed the 'ids', but I wouldn't bet on it. It is too targeted.

  10. udaraaka
    Member
    Posted 1 year ago #

    Yes It is funny that these half-baked premium themes have more bugs and problems than free themes. :D

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.