View gist:4277401d2a6d310b88f8908808cef3af
// Enable WP_DEBUG mode | |
define( 'WP_DEBUG', true ); | |
// Enable Debug logging to the /wp-content/debug.log file | |
define( 'WP_DEBUG_LOG', true ); | |
// Disable display of errors and warnings | |
define( 'WP_DEBUG_DISPLAY', false ); | |
@ini_set( 'display_errors', 0 ); |
View kybernaut_ico_dic_povinna-vsechna_pole.php
<?php // vynechte tento řádek | |
/** | |
* @snippet Nastavit všechna pole (IČO, DIČ, IČ DPH) jako povinné pole | Kybernaut IČO DIČ | |
* @comment Pokud používáte plugin Kybernaut IČO DIČ a potřebujete mít pole všechna pole jako povinné, použijte tento snippet. | |
* @source https://kybernaut.cz/clanky/wp-multisite-maximalni-velikost-nahravaneho-souboru/ | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WordPress 5.0.2 | |
*/ | |
// ------------------- |
View kybernaut_ico_dic_povinne_ico.php
<?php // vynechte tento řádek | |
/** | |
* @snippet IČO (Business ID) jako povinné pole | Kybernaut IČO DIČ | |
* @comment Pokud používáte plugin Kybernaut IČO DIČ a potřebujete mít pole IČO jako povinné, použijte tento snippet. | |
* @source https://kybernaut.cz/clanky/wp-multisite-maximalni-velikost-nahravaneho-souboru/ | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WordPress 5.0.2 | |
*/ | |
// ------------------- |
View wp_db_images_within_legacy_content.sql
/* | |
WordPress DB: Images within legacy content | |
source: https://css-tricks.com/moving-to-https-on-wordpress/ | |
author: Jason Witt (http://jawittdesigns.com/) | |
*/ | |
/* Quotes */ | |
UPDATE wp_posts | |
SET post_content = ( Replace (post_content, 'src="http://', 'src="//') ) | |
WHERE Instr(post_content, 'jpeg') > 0 |
View Add new user: add to wp_usersmeta.sql
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '9999', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'), (NULL, '9999', 'wp_user_level', '10'); |
View Add new user: add to wp_users.sql
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('9999', 'username', MD5('password'), 'nickname', 'email@example.com', '', '2014-11-04 00:00:00', '', '0', 'username'); |
View upload_max_filesize_wpmu.php
/** | |
* @snippet Upload max filesize | WP Multisite | |
* @comment Put the correct blog id number in the if condition. Currently set to the main blog. | |
* @source https://kybernaut.cz/clanky/wp-multisite-maximalni-velikost-nahravaneho-souboru/ | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WordPress Multisite 4.9 | |
*/ | |
// ------------------- | |
function custom_filter_fileupload_maxk( $maxk ) { |
View tax_placeholders_for_price_display_suffix.php
<?php | |
/** | |
* @snippet Tax placeholders for Price Display Suffix | WooCommerce | |
* @comment Use "{tax_rate}" and "{tax_rate_label}" placeholder for displaying the product tax rate and its label | |
* @source https://gist.github.com/vyskoczilova/2ff56afcfd4c75338fb7f0be3a5615c2 | |
* @author Karolína Vyskočilová (https://kybernaut.cz) | |
* @testedwith WooCommerce 4.2 | |
*/ | |
// ------------------- |
View woocommerce-stock-filter-for-wordpress-admin.php
/** | |
* @snippet Add Stock Filter to Products page in WordPress admin | WooCommerce | |
* @comment Localization is automatic if you have localized WooCommerce to your language | |
* @source https://gist.github.com/vyskoczilova/fbc9dd818af20ff514cdb2d50eab410a | |
* @updatedversionof https://popoleodesigns.com/add-inout-of-stock-filter-to-wordpress-admin/ | |
* @author Karolína Vyskočilová | |
* @testedwith WooCommerce 3.0.7 | |
*/ | |
// ------------------- |
View WooCommerce check Billing phone against pattern
add_filter( 'woocommerce_checkout_fields' , 'wc_kbnt_override_checkout_fields' ); | |
function wc_kbnt_override_checkout_fields( $fields ) | |
{ | |
$fields['billing']['billing_phone']['custom_attributes'] = array( "pattern" => "^\+?{1}[0-9 ]{9,17}$" ); | |
return $fields; | |
} |