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
javascript:(()=>{const prefer='ru';const pick=(h)=>{try{const u=new URL(h);const seg=u.pathname.split('/').filter(Boolean);return seg[0]===prefer;}catch{return false}};const as=[...document.querySelectorAll('tbody td.left a.localized')];const hrefs=[...new Set(as.map(a=>a.href).filter(pick))];const txt=hrefs.join('\n');const d=document,w=d.createElement('div');w.style.cssText='position:fixed;left:10%;right:10%;top:10%;z-index:999999;background:#111;color:#eee;border:1px solid #444;padding:16px;border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.6);font:14px/1.4 system-ui,Arial';w.innerHTML='<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px"><b>Extracted links ('+hrefs.length+') — '+prefer.toUpperCase()+'</b><button id="x" style="background:#333;border:0;color:#fff;padding:6px 10px;border-radius:6px;cursor:pointer">Close</button></div>';const ta=d.createElement('textarea');ta.style.cssText='width:100%;height:60vh;background:#000;color:#0f0;border:1px solid #333;borde |
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
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType image/avif "access plus 1 year" | |
ExpiresByType image/webp "access plus 1 year" | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/svg+xml "access plus 1 year" | |
ExpiresByType font/woff2 "access plus 1 year" |
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 get_wp_menu_by_chunk($menu_location, $max_items_per_column = 5) | |
{ | |
$menu_locations = get_nav_menu_locations(); | |
if (!isset($menu_locations[$menu_location])) { | |
return; | |
} | |
$menu = wp_get_nav_menu_object($menu_locations[$menu_location]); | |
if (!$menu) { | |
return; |
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 | |
add_action('template_redirect', function () { | |
global $post, $wp_query; | |
if (function_exists('wpml_get_language_information')) { | |
$current_lang = apply_filters('wpml_current_language', null); | |
if ($current_lang !== 'he') { | |
return; | |
} |
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
/** | |
* Automatically Enable Contact Form 7 Endpoints with Disable WP REST API Plugin | |
* Plugin URI: https://wordpress.org/plugins/disable-wp-rest-api/ | |
*/ | |
function disable_wp_rest_api_enable_contact_form7_endpoints() { | |
$active_plugins = get_option('active_plugins'); | |
// Check if the "Disable WP REST API" plugin is active | |
if (in_array('disable-wp-rest-api/disable-wp-rest-api.php', $active_plugins) | |
// Check if the "Contact Form 7" plugin is active | |
&& in_array('contact-form-7/wp-contact-form-7.php', $active_plugins) |
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
<main> | |
<svg class="icon"> | |
<use xlink:href="#icon"></use> | |
</svg> | |
</main> | |
<footer> | |
<!-- some content--> | |
<!-- inline svg in html --> | |
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> |
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 add_preload_featured_image() { | |
if (is_single() || is_page()) { | |
if (has_post_thumbnail()) { | |
$post_thumbnail_id = get_post_thumbnail_id(); | |
$post_thumbnail_url = wp_get_attachment_image_url($post_thumbnail_id, 'full'); | |
if ($post_thumbnail_url) { | |
echo '<link rel="preload" href="' . esc_url($post_thumbnail_url) . '" as="image" type="image/webp">'; | |
} | |
} |
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 | |
add_filter( 'pre_option_elementor_maintenance_mode_mode', function ( $option ) { | |
$parameter = 'bypass_maintenance'; // change this to whatever you like | |
if ( isset( $_GET['bypass_maintenance'] ) and $_GET['bypass_maintenance'] ) { | |
return 0; // needs to be falsy but not 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
<?php | |
// Automatic theme updates from the GitHub repository | |
add_filter('pre_set_site_transient_update_themes', 'automatic_GitHub_updates', 100, 1); | |
function automatic_GitHub_updates($data) { | |
// Theme information | |
$theme_dtls = array( | |
'theme_parent' => get_option('template'), | |
'theme_parent_uri' => get_template_directory_uri(), | |
'theme_name' => get_option('stylesheet'), | |
'theme_template' => get_stylesheet_directory(), // Folder name of the current theme |
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
/** | |
* Author: Dakota Lee Martinez | |
* Url: https://dakotaleemartinez.com/tutorials/how-to-add-active-highlight-to-table-of-contents/ | |
* Thanks! | |
*/ | |
class Scroller { | |
static init() { | |
if (document.querySelector('.sticky-toc')) { | |
this.tocLinks = document.querySelectorAll('.sticky-toc a'); | |
this.headers = Array.from(this.tocLinks).map(link => { |
NewerOlder