Edit — best to first try:
mariadb-secure-installation -u $(whoami)
Original version here below in case the above does not work for you.
| -enqueue the JS file with the enqueue_block_editor_assets hook. | |
| JS file: | |
| function removeAlignment( settings, name ) { | |
| if ( name !== 'core/group' ) { | |
| return settings; | |
| } |
| <?php | |
| add_action('registered_post_type', 'make_posts_hierarchical', 99, 2); | |
| /** | |
| * Ensure posts post type is hierarchal and allows page attributes | |
| * | |
| * Initial Setup - Runs after each post type is registered | |
| */ | |
| function make_posts_hierarchical($post_type, $pto) |
| const { addFilter } = wp.hooks; | |
| const { assign, merge } = lodash; | |
| const { createBlock } = wp.blocks; | |
| function filter(settings) { | |
| return assign({}, settings, { | |
| transforms: merge(settings.transforms, { | |
| from: [ | |
| { | |
| type: 'block', |
| import { select, subscribe } from '@wordpress/data' | |
| export function whenEditorIsReady() { | |
| return new Promise((resolve) => { | |
| const unsubscribe = subscribe(() => { | |
| // This will trigger after the initial render blocking, before the window load event | |
| // This seems currently more reliable than using __unstableIsEditorReady | |
| if (select('core/editor').isCleanNewPost() || select('core/block-editor').getBlockCount() > 0) { | |
| unsubscribe() | |
| resolve() |
Edit — best to first try:
mariadb-secure-installation -u $(whoami)
Original version here below in case the above does not work for you.
| <?php | |
| function lynt_is_en() { | |
| $path_parts = explode('/', $_SERVER['REQUEST_URI']); | |
| if (isset($path_parts[1]) && $path_parts[1] === 'en') { | |
| return true; | |
| } | |
| <?php | |
| /** | |
| * Renders content before the blog starts. Using a reusable gutenberg block. | |
| */ | |
| function generate_blog_intro() { | |
| /** | |
| * Make sure we are on the posts page. | |
| */ | |
| if ( is_home() ) { | |
| /** |
| <?php | |
| namespace JensSogaard; | |
| class BlockHelper | |
| { | |
| /** | |
| * Gets ACF fields for a specific block on a given post | |
| * @author Jens Soegaard <[email protected]> | |
| */ | |
| public function getBlockFromPage(string $block_id, int $post_id) |
| <!-- wp:paragraph {"align":"center","customTextColor":"#000000","backgroundColor":"very-light-gray","fontSize":"small"} --> | |
| <p style="color:#000000;text-align:center" class="has-background has-small-font-size has-very-light-gray-background-color">Gutenberg Sample Content.<br/>Put together with ❤️ by <a href="https://artisanthemes.io/">Artisan Themes</a>.</p> | |
| <!-- /wp:paragraph --> | |
| <!-- wp:heading {"level":1} --> | |
| <h1>This is a heading (H1)</h1> | |
| <!-- /wp:heading --> | |
| <!-- wp:heading --> | |
| <h2>This is a heading (H2)</h2> |