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 | |
function array_rand_weight(array $array) | |
{ | |
reset($array); | |
$pointer = mt_rand(0, array_sum($array)); | |
if(!$pointer) { | |
return key($array); | |
} |
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 | |
use CoverArtArchive\CoverArt; | |
use Guzzle\Http\Client; | |
use MusicBrainz\Filters\RecordingFilter; | |
use MusicBrainz\HttpAdapters\GuzzleHttpAdapter; | |
use MusicBrainz\MusicBrainz; | |
use phpFastCache\CacheManager; | |
use Ramsey\Uuid\Uuid; |
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 | |
function delete_associated_media( $id ) { | |
$media = get_children( array( | |
'post_parent' => $id, | |
'post_type' => 'attachment' | |
) ); | |
if( empty( $media ) ) { | |
return; |
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
<select class="selectpicker" name="uf"> | |
<option value="AC">Acre</option> | |
<option value="AL">Alagoas</option> | |
<option value="AP">Amapá</option> | |
<option value="AM">Amazonas</option> | |
<option value="BA">Bahia</option> | |
<option value="CE">Ceará</option> | |
<option value="DF">Distrito Federal</option> | |
<option value="ES">Espírito Santo</option> | |
<option value="GO">Goiás</option> |
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
<Limit GET POST PUT DELETE> | |
order deny,allow | |
allow from all | |
</Limit> |
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
// Get the canonical url of a page | |
document.querySelector("link[rel='canonical']").href; | |
document.querySelector("link[rel='canonical']").getAttribute("href"); |
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 | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Remove Date Meta Tags Output by Yoast SEO | |
* Credit: Yoast development team | |
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1 | |
* For Yoast SEO 14.0 or newer, please see https://yoast.com/help/date-appears-search-results/#h-managing-dates | |
*/ | |
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // Premium versions 5.2 or older |
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 | |
/** | |
* Get font awesome file icon class for specific MIME Type | |
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551 | |
* @param string|null $mime_type | |
* @return string | |
*/ | |
function font_awesome_file_icon_class(?string $mime_type): string | |
{ |
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 is_cnpj(c) { | |
var b = [6,5,4,3,2,9,8,7,6,5,4,3,2]; | |
if((c = c.replace(/[^\d]/g,"")).length != 14) | |
return false; | |
if(/0{14}/.test(c)) | |
return false; | |
for (var i = 0, n = 0; i < 12; n += c[i] * b[++i]); |
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 | |
/* | |
Plugin Name: woocommerce modal variationn | |
Plugin URI: # | |
Description: show modal window with product variations after clicking -add to cart-. | |
Version: 0.1 | |
Author: Maks Buriy | |
Author URI: mailto:byymster@gmail.com | |
License: GPL2 | |
*/ |
OlderNewer