Skip to content

Instantly share code, notes, and snippets.

@lynt-smitka
lynt-smitka / cross-login.php
Last active April 17, 2025 20:57
WordPress cross-domain login system that auto-authenticates users across multiple Polylang language domains using secure AJAX calls.
<?php
// Get site domains from Polylang
function lynt_get_domains() {
$domains = [];
if (function_exists('pll_languages_list')) {
$languages = pll_languages_list(array('fields' => 'home_url'));
foreach ($languages as $home_url) {
$domain = parse_url($home_url, PHP_URL_HOST);
if (!empty($domain)) {
@adam-laita
adam-laita / laita-bricks-typography.php
Last active September 8, 2024 14:53
Adds support for Czech typography plugins for Bricks builder.
<?php
/**
* Plugin Name: Bricks Typography
* Description: Adds support for Czech typography plugins for Bricks builder.
* Plugin URI: https://gist.github.com/adam-laita/01c088b986dac578ec0839d52bdbb8a5
* Author: Adam Laita
* Author URI: https://www.laita.cz
* License: GNU General Public License v3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active May 21, 2025 23:42
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@mattclements
mattclements / function.php
Last active May 15, 2025 08:56
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}