Skip to content

Instantly share code, notes, and snippets.

@nicmare
nicmare / lmdm-disable-l10n-php.php
Created March 20, 2026 12:09
MU Plugin that prevents WordPress of creating .l10n.php files for specific textdomains
<?php
/**
* Plugin Name: LMDM Disable PHP Translation Cache for Selected Plugins
* Description: Forces WordPress to use .mo files instead of .l10n.php translation files for selected plugin textdomains.
* Author: Nic Bug / LMDM
* Version: 1.0.0
*/
defined('ABSPATH') || exit;
@nicmare
nicmare / style.css
Created March 19, 2026 15:24
Adds a nice blur reveal effect to Blocksy Submenu
.animated-submenu-block .sub-menu {
filter: blur(20px);
transition: opacity .2s ease,visibility .2s ease,transform .2s ease,margin .2s ease,height .2s ease, filter 0.2s ease;
}
.animated-submenu-block.ct-active .sub-menu {
filter: blur(0);
}
@nicmare
nicmare / functions.php
Created February 25, 2026 11:38
remove additional Blocksy User Profile URLs
<?php
function remove_contactmethods($cms) {
foreach($cms as $cm_key => $cm_label){
if(in_array($cm_key,["facebook","twitter","linkedin","instagram","vimeo","pinterest","tiktok","dribbble","behance","xing","odnoklassniki","vkontakte","youtube","github","soundcloud","spotify","medium","tumblr","mastodon","wordpress","mastodon"])){
unset($cms[$cm_key]);
}
}
return $cms;
}
@nicmare
nicmare / functions.php
Created October 8, 2025 13:25
Make wordpress synced blocks public in rest api
<?php
// fetch block by name like this:
// https://…/wp-json/public/v1/reusable?slug=brunch-termine
add_action('rest_api_init', function () {
register_rest_route('public/v1','/reusable',[
'methods' => 'GET',
'args' => ['slug'=>['required'=>true]],
'permission_callback' => '__return_true',
'callback' => function(WP_REST_Request $r){
$slug = sanitize_title($r['slug']);
@nicmare
nicmare / functions.php
Last active October 7, 2025 13:19
Autoplay YT Video in Blocksy Popup
<?php
// attention! place your yt-video in html-block inside a blocksy popup like this:
// <iframe src="https://www.youtube.com/embed/LW0OVY9e5r0?enablejsapi=1&autoplay=1" class="yt-video" style="aspect-ratio:16/9" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
// this approach is also compatible with script blocker plugin "embed privacy" AND "complianz cookie consent". last one is mandatory!
function autoplay_yt_video_in_blocksy_popup(){
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
ctEvents.on('blocksy:micro-popups:open', (popupId) => {
let video = document.querySelector("#post-"+popupId+" .yt-video");
@nicmare
nicmare / functions.php
Created October 1, 2025 11:58
Blocksy: Remove Links from custom post cards
<?php
function change_layer_from_card($layer,$prefix,$image_args){
if($prefix != "unterstuetzer_archive") return $layer;
$layer["featured_image"] = sprintf('<div class="ct-media-container">%s</div>',strip_tags($layer["featured_image"],"<img>"));
$layer["title"] = strip_tags($layer["title"],"<h2>");
return $layer;
}
add_filter('blocksy:archive:render-card-layers',"change_layer_from_card",10,3);
@nicmare
nicmare / functions.php
Last active September 26, 2025 13:19
blocksy: disable content block tools in wp admin bar
<?php
function disable_blocksy_hook_panel(){
$user = wp_get_current_user();
if(in_array("editor",$user->roles)) return false;
return true;
}
add_filter('blocksy:content-blocks:has-actions-debugger','disable_blocksy_hook_panel');
@nicmare
nicmare / style.css
Created September 19, 2025 12:23
Blocksy Theme: making default archive cards fully clickable
[data-archive="default"].entries article.entry-card {
position:relative;
}
[data-archive="default"].entries article.entry-card .entry-title > a::before {
position:absolute;
inset: 0;
content:"";
display:block;
z-index:10;
@nicmare
nicmare / style.css
Created September 19, 2025 12:02
Blocksy: disable theme button hover effect transform
// add the class to your button:
.no-btn-transform:hover {
--theme-button-transform: none;
}
@nicmare
nicmare / functions.php
Created September 4, 2025 09:25
Hide WP Armour Admin Menu
<?php
// hide wp armour menu from editor role
function remove_wpa_menu(){
if(!is_admin()) return;
if(current_user_can('editor'))
remove_action('admin_menu', 'wpa_plugin_menu');
}
add_action("wp_loaded",'remove_wpa_menu');