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 | |
add_filter( 'powered_cache_advanced_cache_purge_urls', function ( $urls, $post_id ) { | |
if ( 'product' === get_post_type( $post_id ) ) { | |
$urls[] = get_permalink( $post_id ); | |
$urls[] = get_permalink( wc_get_page_id( 'shop' ) ); | |
$terms = wp_get_post_terms( $post_id, [ 'product_tag', 'product_cat' ] ); | |
foreach ( $terms as $term ) { | |
$urls[] = get_term_link( $term ); |
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 | |
add_action( 'wp_footer', function () { | |
?> | |
<script> | |
document.addEventListener('DOMContentLoaded', function () { | |
var messageElement = document.querySelector('.magic-login-form-header .message'); | |
if (messageElement) { | |
messageElement.innerText = 'Your new message 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 | |
add_action( 'plugins_loaded', function () { | |
$request_url = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : ''; | |
if ( false !== strpos( $request_url, '/checkout' ) || false !== strpos( $request_url, '/finalizar-compra' ) ) { | |
add_filter( 'powered_cache_fo_disable', '__return_true' ); | |
add_filter( 'powered_cache_fo_disable_css_combine', '__return_true' ); | |
add_filter( 'powered_cache_fo_disable_css_minify', '__return_true' ); | |
add_filter( 'powered_cache_fo_disable_js_combine', '__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
<?php | |
add_action( 'wp_footer', 'magic_login_auto_fill_email_from_url' ); | |
add_action( 'login_footer', 'magic_login_auto_fill_email_from_url' ); | |
function magic_login_auto_fill_email_from_url() { | |
?> | |
<script> | |
// Function to get URL parameters | |
function getURLParameter(name) { |
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
# BEGIN WordPress | |
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are | |
# dynamically generated, and should only be modified via WordPress filters. | |
# Any changes to the directives between these markers will be overwritten. | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
RewriteBase / | |
# Pass .well-known/security.txt to WordPress | |
RewriteRule ^\.well-known/security\.txt$ index.php [L] |
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 | |
add_action( 'plugins_loaded', function () { | |
add_action( 'powered_cache_flushed', 'flush_phast_cache' ); | |
add_action( 'powered_cache_purge_all_cache', 'flush_phast_cache' ); | |
add_action( 'powered_cache_clean_site_cache_dir', 'flush_phast_cache' ); | |
} ); | |
function flush_phast_cache() { | |
$cache_dir = WP_CONTENT_DIR . '/cache/'; |
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
ALTER TABLE wp_posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; | |
UPDATE wp_posts SET post_content = CONVERT(CAST(CONVERT(post_content USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_title = CONVERT(CAST(CONVERT(post_title USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_excerpt = CONVERT(CAST(CONVERT(post_excerpt USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_status = CONVERT(CAST(CONVERT(post_status USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET comment_status = CONVERT(CAST(CONVERT(comment_status USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET ping_status = CONVERT(CAST(CONVERT(ping_status USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_password = CONVERT(CAST(CONVERT(post_password USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET post_name = CONVERT(CAST(CONVERT(post_name USING latin1) AS BINARY) USING utf8); | |
UPDATE wp_posts SET to_ping = CONVERT(CAST(CONVERT(to_ping USING latin1) AS BINARY) USING |
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 | |
/** | |
* Drop all tables belongs to site. | |
* | |
* @param array $tables The tables to drop. | |
* @param int $blog_id The site ID. | |
* | |
* @return 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[ | |
add_filter( 'wpmu_drop_tables', function ( $tables, $blog_id ) { | |
global $wpdb; | |
$hustle = $wpdb->get_results( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->get_blog_prefix( $blog_id ) . 'hustle' ) . '%' ), ARRAY_A ); | |
if ( ! empty( $hustle ) ) { | |
foreach ( $hustle as $hustle_table ) { | |
$hustle_table = array_values( $hustle_table ); |
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 | |
add_filter( 'gettext', 'change_magic_login_strings', 10, 3 ); | |
function change_magic_login_strings( $translated_text, $untranslated_text, $domain ) { | |
if ( 'magic-login' !== $domain ) { | |
return $translated_text; | |
} | |
if ( 'Username or Email Address' === $untranslated_text ) { |
NewerOlder