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 …

Read more

Is it smart to require_once wp-admin/includes/plugin.php when you need only one function from it

So, the answer isn’t as straightforward as I initially hoped. A quick test using memory_get_usage() on a local environment with only Twenty Sixteen enabled as the theme gives the following results: Memory usage before requiring plugin.php: 8496336 Memory usage after requiring plugin.php: 8583912 So, loading plugin.php takes up 87.576 bytes, or roughly 85KB. If you …

Read more