Gutenberg Editor: dynamically edit slug field based on ACF field

I’ve found the way to edit the slug’s field. Just simply use: wp.data.dispatch(‘core/editor’).editPost({slug: ‘my-slug-value-here’}); With an event listener like this, I can dynamically change the slug field based on a custom field: jQuery(document).ready(() => { const acfField = ‘field_61f8bacf53dc5’; const inputShortTitle = document.getElementById(‘acf-‘ + acfField); const slugify = (str) => { return str.toLowerCase().replace(/ /g, ‘-‘) … Read more

get_term_by with a variable

you can look at line 874 in /wp-includes/taxonomy.php for the function itself. the value has stripslashes applied and then it’s used in a prepared statement, so I’d say it’s safe. but there’s nothing stopping you from checking the value yourself first if you know what parameters it will always fall within, like ctype_alnum or something. … Read more

Category Slugs = 404s?

Here’s what I think is causing the problem: <?php query_posts($query_string . ‘&cat=-98, 101, 102’); ?> should be: <?php query_posts($query_string . ‘&cat=-98,-101,-102′); ?> The way it is now, it’s telling WordPress re-run the old query, but give me nothing from category 98, AND only pull posts from categories 101 and 102. I’m guessing you want it … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)