This file contains hidden or 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 | |
| usort($array, function($a, $b) { if($a['key']==$b['key']) return 0; return $a['key'] > $b['key']?1:-1; }); | |
| ?> |
This file contains hidden or 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 | |
| ////////////////////////////////////////////////////////////// | |
| ///////// AUTOMATE ALT TAGS FOR IMAGES | |
| ////////////////////////////////////////////////////////////// | |
| function image_alt_tag($content) { | |
| global $post; | |
| preg_match_all('/<img (.*?)\/>/', $content, $images); | |
| if(!is_null($images)) { | |
| foreach($images[1] as $index => $value) { | |
| if(!preg_match('/alt=/', $value) && preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $value)) { |
This file contains hidden or 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 | |
| $string = 'stringToSearch'; | |
| $dir = new RecursiveDirectoryIterator('folder'); | |
| foreach (new RecursiveIteratorIterator($dir) as $filename => $file) { | |
| //$thename = $file->getFilename(); //uncomment this line and next to print names of all files scanned | |
| //echo $thename.'<br />'; | |
| $content = file_get_contents($file->getPathname()); | |
| if (strpos($content, $string) !== false) { |
This file contains hidden or 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
| // consulente error checks | |
| consulente_errors_list = []; | |
| $('#detrazione-fiscale-consulente .consulente-checK input[type="checkbox"]').change(function () { | |
| consulente_errors_list = $('#detrazione-fiscale-consulente .consulente-checK input[type="checkbox"]:checked').map(function (i) { | |
| var classes = $(this).closest('.cmb-row').attr('class'); | |
| var error_el = '.' + classes.match("cmb2-id-([a-zA-Z\-]+)")[1]; | |
| //console.log(consulente_errors_list); | |
| //console.log(error_el); |
This file contains hidden or 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
| var group_fields = []; | |
| // Loop through the fields | |
| theForm.serializeArray().forEach(function(entry,i) { | |
| // Get the index and prop name from the entry name | |
| var nameparts = /^([a-zA-Z0-9_]+)\[(.+)\]\[(.*)\]$/.exec(entry.name); | |
| // Get the group entry if we already have it | |
| var group = group_fields[nameparts[2]]; | |
| if (!group) { | |
| // We don't, create and add it | |
| group = group_fields[nameparts[2]] = {}; |
This file contains hidden or 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
| # START SECURITY | |
| # Don't show errors which contain full path diclosure (FPD) | |
| # Use that line only if PHP is installed as a module and not per CGI | |
| # try using a php.ini in that case. | |
| # Change mod_php5.c to mod_php7.c if you are running PHP7 | |
| <IfModule mod_php5.c> | |
| php_flag display_errors Off | |
| </IfModule> | |
| # Don't list directories |
This file contains hidden or 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
| <video controls width="100%" height="100%" preload="none" style="background-image:url('preview.jpg');"> | |
| <source src="video.mp4" type="video/mp4" /> | |
| <source src="video.webm" type="video/webm" /> | |
| <source src="video.ogg" type="video/ogg" /> | |
| <p>Il tuo browser non supporta questo video</p> | |
| </video> |
This file contains hidden or 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($) { | |
| $.fn.extend({ | |
| myPlugin: function(options) { | |
| var defaults = { | |
| something: 23, | |
| otherThing: 'hello' | |
| }; | |
| options = $.extend(defaults, options); |
This file contains hidden or 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 elogp($var, $level="", $log="") { | |
| $date = date("d-m-Y h:m:s"); | |
| $t = debug_backtrace(); | |
| $file = $t[0]['file']; | |
| $level = $level == "" ? "info" : $level; | |
| $log = $log == "" ? ABSPATH."/elogp.log" : $log; | |
| $message = "[{$date}] [{$file}] [{$level}] ".print_r($var, true).PHP_EOL; | |
| error_log($message, 3, $log); | |
| } |