Skip to content

Instantly share code, notes, and snippets.

View erropix's full-sized avatar
💭
I may be slow to respond.

Abdelouahed E. erropix

💭
I may be slow to respond.
View GitHub Profile
<?php
add_action("oxygen_after_add_components", function () {
global $oxygen_vsb_components;
$div_component = $oxygen_vsb_components["div_block"];
$div_params = &$div_component->options["params"];
foreach ($div_params as $i => $param) {
if ($param["param_name"] == "tag") {
@erropix
erropix / cf7-conditional-assets-loader.php
Created October 22, 2020 10:24
Load CF7 assets in whitelisted pages only
/*
Title: Load CF7 assets in whitelisted pages only
Type: PHP > Custom Code
Location: Plugins loaded
Priority: 10
*/
// stop loading Contact form 7 JavaScript and CSS files
add_filter('wpcf7_load_js', '__return_false');
add_filter('wpcf7_load_css', '__return_false');
@erropix
erropix / remove-comments-menus.php
Created September 21, 2020 17:13
Remove comments links from admin bar and admin menu
/*
Title: Hide Comments Menu
Type: PHP > Custom Code
Location: Init
Priority: 10
*/
// Remove comments from admin bar
add_action('wp_before_admin_bar_render', function () {
global $wp_admin_bar;
/*
Title: Disable Gutenberg fullscreen mode
Type: JavaScript > Custom Code
Location: Custom Hooks
Hook name: enqueue_block_editor_assets
Priority: 10
*/
window.addEventListener('load', function() {
if (wp.data.select('core/edit-post').isFeatureActive('fullscreenMode')) {
@erropix
erropix / oxy-cm-theme.scss
Created September 21, 2020 10:35
An Advanced Scripts snippet to enhance the Oxygen code editor theme
/*
Title: Oxygen Code Editor Theme
Type: CSS > Compile SCSS Code
Location: Custom Hooks
Hook name: oxygen_enqueue_ui_scripts
Priority: 10
*/
#oxygen-ui {
.cm-s-default {