Include external po file for 3th party plugin to theme

If discussed plugin already uses load_plugin_textdomain() function to load its translations, usually it is enough to place <plugin_name>-<locale_code>.mo file to the wp-content/languages/plugins directory. If it doesn’t (or you can’t do it for some reason), you can use init hook to load its translation via your functions.php. Here is an example from one of my child … Read more

created post displaying differently on front end

I managed to sort the problem by adding this CSS to the bottom of my main-styles.css file p { display: block; margin-block-start: 1em; margin-block-end: 1em; margin-inline-start: 0px; margin-inline-end: 0px; } It also fixed all the issues with the images that I mentioned above and the line breaks that were not appearing on the front end. … Read more

How to extend SelectControl with data from my theme

You can use wp_localize_script() to pass JavaScript variables to the editor: $asset_file = include(get_template_directory() . ‘/path/to/blocks/index.asset.php’); wp_register_script( ‘pb-theme-blocks’, get_template_directory_uri() . ‘/path/to/blocks/index.js’, $asset_file[‘dependencies’], $asset_file[‘version’] ); wp_localize_script( ‘pb-theme-blocks’, ‘pbThemeBlocksVars’, array( ‘classes’ => array(), // Your theme classes go here ) ); Then in your edit function: const classes = pbThemeBlocksVars.classes;