Skip to content

Instantly share code, notes, and snippets.

View indikatordesign's full-sized avatar

Bruno Bouyajdad indikatordesign

View GitHub Profile
@indikatordesign
indikatordesign / functions.php
Last active September 9, 2017 09:55
[Shortcode-Finder]Fork of the shortcode-finder described by wpbeginner.com
<?php
// This is a fork of the shortcode-finder described in this useful post: http://www.wpbeginner.com/wp-tutorials/how-to-find-and-remove-unused-shortcodes-from-wordpress-posts/
// Just add the snippet in your themes functions.php. You can use this shortcode in a post or page, as shown in the following example:
// [find_shortcode name='et_pb_dfbm_blog']
add_shortcode( 'find_shortcode', function( $atts, $content = false )
{
@indikatordesign
indikatordesign / coming-soon-snippet.php
Last active September 9, 2017 09:59
[Divi Coming Soon Snippet]Divi allows you to create coming soon pages (blank template), but when someone tries to reach something like "my-domain.com/about/", it will achieve it because there is no implementation to hide those pages.This is what this simple snippet can do for you.
<?php
// Create a page called "Coming Soon"
// Make sure that the permalink looks like this: my-domain.com/coming-soon/
// Then paste the snippet below into your themes (child-themes) functions.php.
// After inserting, any user who is not logged-in will be redirected to your coming-soon page.
add_action( 'init', function()
{
if( ! is_user_logged_in() )
@indikatordesign
indikatordesign / open-mail.js
Last active September 9, 2017 10:01
[Mask email]Trigger to open email-client by clicking on an image using jQuery.
(function($){
$(function(){
"use strict";
$( '#e-placeholder' ).find( 'img' ).on( 'click', function()
{
var link = $( '<a />',
{
id : 'e-remove',
href : 'mailto:my-mail@my-domain.com?Subject=I want to get in touch with you!&body=My message to you.',
@indikatordesign
indikatordesign / wp-config.php
Last active October 27, 2017 13:49
[WordPress Debug.log and useful var_dump snippet]Allows you to write the error.log right into the wp-content-folder. You can also use something like this to var_dump to your error log: - idWriteLog( $myVar, 'varName' ); - or - idWriteLog( myFunc(), 'funcName' ); - It is especially useful to var_dump ajax requests and will also show you on which …
<?php
// Add the snippet below in the file wp-config.php right above: /* That's all, stop editing! Happy blogging. */
define('WP_DEBUG', true );
if ( WP_DEBUG )
{
define('SAVEQUERIES', true );
@indikatordesign
indikatordesign / class-license.php
Last active December 30, 2017 14:08
[Indikator Design - EMP License Key Registration] Needs to run in WordPress
<?php
/**
* Do not allow direct access
*
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) die( 'Don\'t try to load this file directly!' );
/**
* Indikator Design - EMP License Key Registration
@indikatordesign
indikatordesign / functions.php
Last active March 15, 2018 19:34
[Divi Layout Shortcode]
<?php
// Add layouts to the Divi library and get the ID from the corresponding URL
// To get your results, you can add a shortcode to text fields as follows: [divi-layout id="7"]
add_shortcode( 'divi-layout', function( $atts )
{
$atts = shortcode_atts( [ 'id' => '', ], $atts );
@indikatordesign
indikatordesign / functions.php
Last active April 14, 2018 07:50
[WordPress - Imprint and Privacy on login]
<?php
add_action( 'login_footer', function()
{
$imprint = site_url( 'imprint' ); // change imprint with your page-slug
$privacy = site_url( 'privacy' ); // change privacy with your page-slug
echo <<<LINKS
@indikatordesign
indikatordesign / plugins-handler.js
Last active August 10, 2018 22:26
EMP EDD Plugin Updater - Another Approach
(function($){$(function(){
class prefixUpdater
{
setProperties()
{
this.red = '#fff0f0';
this.green = '#f1fff0';
@indikatordesign
indikatordesign / functions.php
Last active December 15, 2018 13:45
[WordPress 5(+) - Remove Builder Info]
<?php
if ( is_admin() ) :
add_action( 'current_screen', function( $hook )
{
if ( 'edit' == $hook->base ) :
add_action( 'admin_print_styles', function()
@indikatordesign
indikatordesign / functions.php
Last active November 5, 2021 01:28
[Divi - Change the order for the default filterable portfolio module]
<?php
// Add this snippet to your themes "functions.php" to order the projects by title
add_action( 'parse_query', function( $vars )
{
if ( 'project' == $vars->query['post_type'] )
{