How to use useSelect to retrieve the currently default fontFamily?

It turns out that it wasn’t really needed to find the default font as an empty string is interpreted as the default font. I just did it this way: <FontFamilyControl> value={ buttonFontFamily || ” } onChange={ ( newFontFamily ) => { setAttributes({ buttonFontFamily: newFontFamily }) } } </FontFamilyControl> Another important thing to notice here is … Read more

How can I obtain an option (get_option) inside a block viewScript?

So, if I want to add any custom styles or scripts in a block’s CSS or JS file, I usually add them in the PHP file associated with the block (the render property in block.json). Add the following code to the PHP file at the end – $beautiful_option = get_option(‘beautiful’); wp_add_inline_script(‘some-script’, ‘const BEAUTIFUL_OPTION=’ .$beautiful_option, ‘before’); … Read more

Why is there a bunch of WordPress HTML code in my browser CSV download?

This code cannot run in a shortcode: if ( $_SERVER[‘REQUEST_METHOD’] == ‘GET’ && isset($_GET[‘CSV’]) ) { require_once __DIR__ . ‘/../assets/helpers.php’; // contains csv_download() function csv_download(); } The problem is that by the time a shortcode executes it’s too late to send HTTP headers, and WordPress has already sent the theme header and HTML body tags. … Read more

Custom fields in the billing address section woocommerce

I have run into these issues before myself. I am not entirely sure it’s possible to get adjust the billing address box directly unless you adjust the actual email template for the emails. Specifically, if you have access to the file structure, look in the “/wp-content/plugins/woocommerce/templates/emails” folder of the WooCommerce Plugin. They are made to … Read more

audio tags no longer working

You may need to update your shortcode function to generate the audio player using proper HTML markup instead of returning the raw shortcode text. Here’s an example: function myshortcode_shortcode() { $audio_url=”path/file.mp3″; $audio_markup = ‘<audio controls><source src=”‘ . esc_url($audio_url) . ‘” type=”audio/mp3″></audio>’; return $audio_markup; }

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