WordPress custom block: Link saved in database not retrieved when editing post
Your selectors are wrong. { attributes: { link1: { type: ‘string’, source: ‘attribute’, attribute: ‘href’, selector: ‘.btn-afil-text-card a:first-child’ }, link2: { type: ‘string’, source: ‘attribute’, attribute: ‘href’, selector: ‘.btn-afil-text-card a:last-child’ } }, } Both of your a elements are the first (and last) children of their parents, which means that your attributes are each getting …