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
["abacus"=>"f640","acorn"=>"f6ae","ad"=>"f641","address-book"=>"f2b9","address-card"=>"f2bb","adjust"=>"f042","air-conditioner"=>"f8f4","air-freshener"=>"f5d0","alarm-clock"=>"f34e","alarm-exclamation"=>"f843","alarm-plus"=>"f844","alarm-snooze"=>"f845","album"=>"f89f","album-collection"=>"f8a0","alicorn"=>"f6b0","alien"=>"f8f5","alien-monster"=>"f8f6","align-center"=>"f037","align-justify"=>"f039","align-left"=>"f036","align-right"=>"f038","align-slash"=>"f846","allergies"=>"f461","ambulance"=>"f0f9","american-sign-language-interpreting"=>"f2a3","amp-guitar"=>"f8a1","analytics"=>"f643","anchor"=>"f13d","angel"=>"f779","angle-double-down"=>"f103","angle-double-left"=>"f100","angle-double-right"=>"f101","angle-double-up"=>"f102","angle-down"=>"f107","angle-left"=>"f104","angle-right"=>"f105","angle-up"=>"f106","angry"=>"f556","ankh"=>"f644","apple-alt"=>"f5d1","apple-crate"=>"f6b1","archive"=>"f187","archway"=>"f557","arrow-alt-circle-down"=>"f358","arrow-alt-circle-left"=>"f359","arrow-alt-circle-right"=>"f35 |
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 copyToClipboard(textToCopy) { | |
// navigator clipboard api needs a secure context (https) | |
if (navigator.clipboard && window.isSecureContext) { | |
// navigator clipboard api method' | |
return navigator.clipboard.writeText(textToCopy); | |
} else { | |
// text area method | |
let textArea = document.createElement("textarea"); | |
textArea.value = textToCopy; | |
// make the textarea out of viewport |
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
<script> | |
/** | |
* Paste the code in console here https://fontawesome.com/icons?d=gallery&c=vehicles,weather,winter,writing | |
* it will give icons in json | |
*/ | |
var icon = []; | |
jQuery('ul.list li').each(function(){ | |
icon.push(jQuery(this).find('i').attr('class')); | |
console.log(JSON.stringify(icon)) | |
}) |
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
RewriteEngine On | |
RewriteCond %{HTTPS} !on | |
RewriteCond %{HTTP_HOST} ^(?:[a-z0-9-])?cyclonethemes\.com | |
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L] | |
// http://site1.example.com | |
// https://example.com |
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
add_action( 'init' , 'hotelica_get_kirki_fields' ); | |
function hotelica_get_kirki_fields(){ | |
Kirki::add_config( 'my_theme', | |
array( | |
'capability' => 'edit_theme_options', | |
'option_type' => 'theme_mod', | |
) | |
); |
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 multidimentional_array_map( $function, $arr ){ | |
$result = array(); | |
foreach ($arr as $key => $val){ | |
$result[$key] = (is_array($val) ? multidimentional_array_map($function, $val) : $function($val)); | |
} | |
return $result; | |
} |
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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
// | |
// Permission is hereby granted, free of charge, to any person |
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 | |
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Island |
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 tryParseJSON(jsonString){ | |
try { | |
var o = JSON.parse(jsonString); | |
// Handle non-exception-throwing cases: | |
// Neither JSON.parse(false) or JSON.parse(1234) throw errors, hence the type-checking, | |
// but... JSON.parse(null) returns null, and typeof null === "object", | |
// so we must check for that, too. Thankfully, null is falsey, so this suffices: | |
if (o && typeof o === "object") { | |
return o; | |
} |
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 | |
add_action( 'woocommerce_product_query', 'so_27971630_product_query' ); | |
function so_27971630_product_query( $q ){ | |
$meta_query = $q->get( 'meta_query' ); | |
$meta_query[] = array( | |
'key' => 'custom_acf_key', | |
'value' => 'custom_acf_value', | |
'compare' => '=' |
NewerOlder