• chatteenfee

    (@chatteenfee)


    Hi! GREAT plugin!

    However, if someone needs to add an attribute name without a value, it adds a default value of “1”. Would it be possible not to add that? I tried to add 2 properties separated by a space(prop1 prop2) and give value only to the last one but it does not work.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author websevendev

    (@websevendev)

    Empty value should work.

    Try here: https://playground.wordpress.net/?plugin=attributes-for-blocks&url=%2Fwp-admin%2Fpost.php%3Fpost%3D2%26action%3Dedit

    Select a paragraph, under Advanced -> Additional attributes add an attribute name “test”, no value, preview the page in new tab, the paragraph should have

    <p test="">...</p>

    If you’re getting test="1" something is doing something somewhere, not sure what though.

    Thread Starter chatteenfee

    (@chatteenfee)

    Hi! Thanks for the fast response.

    Just tested in the playground as you suggested and for an empty attribute value I am getting the default “1 “.

    However, I did try something and it worked. After updating the page (and getting the “1 ” value, I used the overwrite with the empty value and that did the trick, removing the default.

    It’s good that it works. Hopefully other people that have this issue can read here about a solution.

    Thanks for your feedback.

    Again, GREAT plugin! One of the best on the market!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Default value for attribute value’ is closed to new replies.