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 | |
echo realpath(__FILE__); |
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: Lynt Admin | |
* Author: Vladimir Smitka | |
* Author URI: https://lynt.cz/ | |
* License: GNU General Public License v3 or later | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
defined( 'ABSPATH' ) or die( 'nothing here' ); |
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 prefered_language($available_languages, $http_accept_language) { | |
$available_languages = array_flip($available_languages); | |
$langs = array(); | |
preg_match_all('~([\w-]+)(?:[^,\d]+([\d.]+))?~', strtolower($http_accept_language), $matches, PREG_SET_ORDER); | |
foreach($matches as $match) { |
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('wp_default_scripts', 'lynt_remove_jquery_migrate'); | |
function lynt_remove_jquery_migrate($scripts) | |
{ | |
if (!is_admin() && isset($scripts->registered['jquery'])) { | |
$script = $scripts->registered['jquery']; | |
if ($script->deps) { // Check whether the script has any dependencies | |
$script->deps = array_diff($script->deps, array( | |
'jquery-migrate' |
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
//doplní všem skriptům, na kterých nejsou jiné závislé atributy async a defer | |
if (!is_admin()) { | |
add_filter('script_loader_tag', 'lynt_async_attr', 10, 3); | |
} | |
function lynt_async_attr($tag, $handle, $src) | |
{ | |
global $wp_scripts; |
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: Moje funkce | |
*/ | |
add_filter( 'get_the_archive_title', function ( $title ) { | |
if( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} | |
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_filter( 'get_the_archive_title', function ( $title ) { | |
if( is_category() ) { | |
$title = single_cat_title( '', false ); | |
} | |
if( is_tag() ) { | |
$title = single_tag_title( '', false ); | |
} |
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 lynt_is_en() { | |
$path_parts = explode('/', $_SERVER['REQUEST_URI']); | |
if (isset($path_parts[1]) && $path_parts[1] === 'en') { | |
return true; | |
} | |
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
- hosts: all | |
gather_facts: no | |
tasks: | |
- shell: uname -a | |
register: result | |
- debug: msg={{ result.stdout }} |
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> | |
document.addEventListener( 'wpcf7mailsent', function( event ) { | |
window.dataLayer.push({ | |
"event" : "cf7submission", | |
"formId" : event.detail.contactFormId, | |
"response" : event.detail.inputs | |
}) | |
}); | |
</script> |