Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

David Decker deckerweb

🏠
Working from home
Block or report user

Report or block deckerweb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@deckerweb
deckerweb / v1-tbex-unloading-translations-premium-addons.php
Last active May 13, 2019
Toolbar Extras plugin: Unload also translations for the Elementor Add-On "Premium Addons for Elementor" (free, by Leap13) --- website: https://toolbarextras.com
View v1-tbex-unloading-translations-premium-addons.php
<?php
/** Do NOT include the opening php tag */
/** Version 1 - strict unloading */
if ( ! function_exists( 'ddw_tbex_unload_textdomain_premium_addons' ) ) :
add_action( 'init', 'ddw_tbex_unload_textdomain_premium_addons' );
/**
@deckerweb
deckerweb / functions.php
Created Apr 8, 2019 — forked from nickcernis/functions.php
Wrap Custom HTML WordPress blocks in a div wrapper
View functions.php
<?php
add_filter( 'render_block', 'custom_wrap_html_block_output', 10, 2 );
/**
* Wrap output of HTML blocks.
*
* @param string $block_content Original block content.
* @param array $block Block info.
* @return string The block content with a wrapper.
*/
@deckerweb
deckerweb / wp-admin-add-posts-state.php
Created Mar 26, 2019 — forked from martijn94/wp-admin-add-posts-state.php
Snippet to add post state to a WordPress page
View wp-admin-add-posts-state.php
<?php
//======================================================================
// Add post state to the projects page
//======================================================================
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
View elementor-form-additional-webhook.php
<?php
/**
* Plugin Name: Elementor Form Additional Webhook
* Plugin URI: https://coreysalzano.com/
* Description: Adds a second Webhook to the Lot Wizard trial signup form
* Version: 1.0.0
* Author: Corey Salzano
* Author URI: https://github.com/mistercorey
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@deckerweb
deckerweb / tbex-custom-cap-unloading-translations.php
Last active Dec 21, 2018
Toolbar Extras plugin v1.3.9+: Set a custom capability for unloading translations
View tbex-custom-cap-unloading-translations.php
<?php
/** Do NOT include the opening php tag */
if ( function_exists( 'tbex_capability_unloading_translations' ) ) :
add_filter( 'tbex_filter_capability_unloading_translations', 'tbex_capability_unloading_translations' );
/**
* Set a custom capability for the Smart Tweak feature for unloading certain translations.
* This filter is available since Toolbar Extras version 1.3.9
*
@deckerweb
deckerweb / wp-499-up-fix-csv-upload.php
Created Dec 18, 2018 — forked from rmpel/wp-499-up-fix-csv-upload.php
A filter (an mu-plugin) to restore CSV upload functionality to WordPress 4.9.9 and up.
View wp-499-up-fix-csv-upload.php
<?php
/**
* Restore CSV upload functionality for WordPress 4.9.9 and up
*/
add_filter('wp_check_filetype_and_ext', function($values, $file, $filename, $mimes) {
if ( extension_loaded( 'fileinfo' ) ) {
// with the php-extension, a CSV file is issues type text/plain so we fix that back to
// text/csv by trusting the file extension.
$finfo = finfo_open( FILEINFO_MIME_TYPE );
$real_mime = finfo_file( $finfo, $file );
@deckerweb
deckerweb / btc-rcl-elementor-my-templates.php
Last active Dec 13, 2018
Disable "Builder Template Category" taxonomy for the WP Real Categories Management (RCL) plugin - only for Elementor My Templates post type
View btc-rcl-elementor-my-templates.php
<?php
/** Do NOT include the opening php tag */
add_filter( 'RCL/Available', 'btc_rcl_elementor_my_templates', 10, 3 );
/**
* Disable "Builder Template Category" taxonomy for Elementor My Templates for
* the "WP Real Categories Management" plugin (Premium, by Matthias Günter).
*
* @author David Decker - DECKERWEB
@deckerweb
deckerweb / gutenberg-frontpage-only.php
Created Nov 22, 2018
Disable Gutenberg except for “Frontpage” page - found via: https://codeshare.io/29Kj8K
View gutenberg-frontpage-only.php
<?php
/**
* Disable Gutenberg by Default
* but let others easily override that by changing hook priority to 5
* https://justnorris.com/how-to-dynamically-enable-gutenberg/
*/
add_filter( 'gutenberg_can_edit_post', '__return_false', 5 );
add_filter( 'use_block_editor_for_post', '__return_false', 5 );
@deckerweb
deckerweb / btc-tax-public.php
Created Nov 8, 2018
Make the "Builder Template Category" taxonomy public. - For plugin: "Builder Template Taxonomies"
View btc-tax-public.php
<?php
/** Do NOT include the opening php tag */
add_filter( 'register_taxonomy_args', 'ddw_btc_make_tax_public', 10, 2 );
/**
* Make the "Builder Template Category" taxonomy public.
* For plugin: "Builder Template Taxonomies".
*
* @author David Decker - DECKERWEB
@deckerweb
deckerweb / README-Template.md
Created Oct 16, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You can’t perform that action at this time.