Scss snippet added inline in admin footer to update WPcoedbox folder and snippet styles, and add a different color background to cloud snippets
The WordPress Codex offers an interesting snippet for a shortcode. First copy the following code into the functions.php
of the theme or use WP Code Box:
function wpcodex_hide_email_shortcode( $atts , $content = null ) {
if ( ! is_email( $content ) ) {
return;
}
return '<a href="mailto:' . antispambot( $content ) . '">' . antispambot( $content ) . '</a>';
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$metabox_group_id = 50; | |
add_action( "rwmb_{$metabox_group_id}_after_save_post", function( $object_id ) { | |
// STEP: get the variables we want to override from the settings page. | |
$primary = rwmb_meta( 'test_primary_color', ['object_type' => 'setting'], 'test_client_dashboard'); | |
error_log( sprintf( '%s: primary %s', 'my action handler', $primary ) ); | |
$new_vars = array( | |
'color-primary' => $primary | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wp_load_translations_early(); | |
$protocol = wp_get_server_protocol(); | |
header( "$protocol 503 Service Unavailable", true, 503 ); | |
header( 'Content-Type: text/html; charset=utf-8' ); | |
header( 'Retry-After: 30' ); | |
?> | |
<!DOCTYPE html> | |
<html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* First Method. | |
*/ | |
function array_search_partial($arr, $keyword) { | |
foreach($arr as $index => $string) { | |
if (strpos($string, $keyword) !== FALSE) | |
return $index; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Smooth Scroll on Pageload | |
* Smooth scrolling on page load if URL have a hash | |
* Author: Franco Moya - @iamravenous | |
*/ | |
if (window.location.hash) { | |
var hash = window.location.hash; | |
if ($(hash).length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class WP_HTML_Compression | |
{ | |
// Settings | |
protected $compress_css = true; | |
protected $compress_js = true; | |
protected $info_comment = true; | |
protected $remove_comments = true; | |
// Variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$('a[href*=#]:not([href=#])').click(function() | |
{ | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
|| location.hostname == this.hostname) | |
{ | |
var target = $(this.hash), | |
headerHeight = $(".primary-header").height() + 5; // Get fixed header height | |