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
UPDATE wp_options SET option_value = replace(option_value, 'http://old.com', 'http://new.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://old.com','http://new.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://old.com', 'http://new.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://old.com','http://new.com'); |
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
$(document).bind( | |
'touchend.namespace', | |
hideByClickingOutsideListener.bind(this, container) | |
); | |
function hideByClickingOutsideListener(containerElement, event) { | |
const container = $(containerElement); | |
if (!container.is(event.target) && container.has(event.target).length === 0) { |
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
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('user_id', 'user_login', MD5('user_password'), 'User Name', 'user_email', 'http://usersite.example.com', '2019-06-07 00:00:00', '', '0', 'User Name'); | |
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, 'user_id', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, 'user_id', 'wp_user_level', '10'); |
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( 'woocommerce_after_checkout_validation', 'prefix_validate', 10, 2); | |
function prefix_validate( $fields, $errors ){ | |
if ( true ){ | |
$errors->add( 'validation', 'Validation Message' ); | |
} | |
} |
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
RedirectMatch 404 /\.git | |
RedirectMatch 404 ^.*\.log |
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_loaded', 'action_wp_loaded_23235' ); | |
function action_wp_loaded_23235() { | |
$taxonomies = wc_get_attribute_taxonomy_names(); | |
$attributes_terms = get_terms( | |
[ | |
'taxonomy' => $taxonomies, |
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
/* | |
!wp-content/ | |
wp-content/* | |
!wp-content/mu-plugins/ | |
!wp-content/plugins/ | |
!wp-content/themes/ | |
wp-content/mu-plugins/* | |
wp-content/plugins/* |
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 | |
/** | |
* Filter Elasticsearch posts by current language. | |
*/ | |
add_filter( 'ep_formatted_args', function( $formatted_args, $args ) { | |
if ( function_exists( 'pll_current_language' ) ) { | |
$lang = pll_current_language(); | |
if ( $lang !== 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_action( 'wp', 'porto_child_categories' ); | |
function porto_child_categories() { | |
$categories = get_terms( | |
[ | |
'taxonomy' => 'product_cat', | |
'lang' => '' | |
] | |
); | |
foreach( $categories as $category ) { | |
pll_set_term_language( $category->term_id, 'uk' ); |
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', function () { | |
return; | |
if ( $_COOKIE['PHPSESSID'] !== 'xxxx' ) { | |
return; | |
} | |
global $sitepress; | |
foreach ( range( 1, 100 ) as $iteration ) { |
OlderNewer