Skip to content

Instantly share code, notes, and snippets.

View fabiankaegy's full-sized avatar

Fabian Kägy fabiankaegy

View GitHub Profile
@fabiankaegy
fabiankaegy / flywheel-local-xdebug-vscode.md
Created May 9, 2019 19:39 — forked from ahmadawais/flywheel-local-xdebug-vscode.md
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@fabiankaegy
fabiankaegy / functions.php
Created June 29, 2022 14:05
WordPress YouTube Embed block lite embed
add_filter( 'render_block', 'modify_youtube_embed_markup', 10, 2 );
/**
* Modify block rendering to make YouTube embeds load a facade
*
* @param string|null $block_content The pre-rendered content. Default null.
* @param WPBlock $block The block being rendered.
* @return string modified Block HTML
*/
function modify_youtube_embed_markup( $block_content, $block ) {
@fabiankaegy
fabiankaegy / compressed-size.yml
Last active January 6, 2023 12:43
WordPress Project GitHub Actions Setup
name: Compressed Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
@fabiankaegy
fabiankaegy / default-rendering-mode.js
Created December 5, 2024 16:43
Set default rendering mode in WordPress 6.6+
import { registerPlugin } from '@wordpress/plugins';
import { useDispatch, useSelect } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
import { store as editorStore } from '@wordpress/editor';
// Define post types that show the full template locked site editor by default.
const TEMPLATE_LOCKED_POST_TYPES = ['page', 'post'];
registerPlugin('namespace-set-default-template-rendering-mode', {
render: function Edit() {
@fabiankaegy
fabiankaegy / edit.js
Created December 17, 2024 21:40
Responsive Text align options prototype
port { registerBlockExtension } from '@10up/block-components';
import { useSelect } from '@wordpress/data';
import { store as editorStore } from '@wordpress/editor';
import { InspectorControls } from '@wordpress/block-editor';
import { useState, useEffect } from '@wordpress/element';
import { addFilter } from '@wordpress/hooks';
import { createHigherOrderComponent } from '@wordpress/compose';
import classnames from 'classnames';
const SUPPORTED_BLOCKS = ['core/heading'];