Skip to content

Instantly share code, notes, and snippets.

View apermo's full-sized avatar

Christoph Daum apermo

View GitHub Profile
@apermo
apermo / ios_fixed_background.css
Created January 10, 2020 13:54
A fix for the ios fixed&cover background issue
body::after {
content: "";
display: block;
position: fixed;
top: 0;
left: 0;
height: 100%;
height: 100vh;
width: 100%;
width: 100vw;
@apermo
apermo / wp-gutenberg-reusable-block-interface.php
Last active November 4, 2024 07:29 — forked from mrpritchett/wp-gutenberg-reusable-block-interface.php
Gutenberg Reusable Block Editor Interface
function custom_add_interface_to_wp_block( $args, $post_type ) {
global $pagenow;
if ( 'wp_block' !== $post_type ) {
return $args;
}
$changed_args = array(
'show_ui' => true,
'show_in_menu' => true,
@apermo
apermo / enqueue_filemtime.php
Last active July 3, 2019 05:09
wrapper for wp_enqueue_style using filemtime
<?php
// has been taken from a class, globals are just a quick and dirty workarround
// This Wrapper is one example for a simple use of cached filemtime version strings, in this case for the parent theme.
// Needs small changes to work for childtheme, javascript, plugins or register
function local_enqueue_style( $handle, $src, $deps = array(), $media = 'all' ) {
wp_enqueue_style( $handle, get_template_directory_uri() . $src, $deps, local_get_version( get_template_directory() . $src ), $media );
}
@apermo
apermo / class.mapping-composer.php
Last active February 16, 2017 17:23
WordPress Multisite Domain Mapping & Visual Composer
<?php
if ( ! class_exists( 'MultsiteComposer' ) ) {
class MultsiteComposer {
public static function init() {
if ( isset( $_GET['vc_action'] ) || isset( $_GET['vc_editable'] ) ) {
if ( defined( 'DOMAIN_MAPPING' ) ) {
remove_filter( 'plugins_url', 'domain_mapping_plugins_uri', 1 );
remove_filter( 'theme_root_uri', 'domain_mapping_themes_uri', 1 );
remove_filter( 'pre_option_siteurl', 'domain_mapping_siteurl' );
remove_filter( 'pre_option_home', 'domain_mapping_siteurl' );