Skip to content

Instantly share code, notes, and snippets.

View rwkyyy's full-sized avatar
🏠
Working from home

Eduard “RwkY” Doloc rwkyyy

🏠
Working from home
View GitHub Profile
@jennimckinnon
jennimckinnon / post-meta.sql
Created June 18, 2015 06:48
Delete post meta data in WordPress database via <http://benmarshall.me/wordpress-sql-queries/#num-spam-entries>. Referencing for post.
DELETE FROM wp_postmeta WHERE meta_key = 'your-meta-key';
@MikeNGarrett
MikeNGarrett / wp-config.php
Last active May 12, 2025 16:13
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@seventhqueen
seventhqueen / fix-for-visual-composer-update-with-tgmpa.php
Created April 22, 2016 22:09
Disable Visual composer nasty auto update functionality that won't let you update the plugin from TGMPA. A quick snippet that can be dropped in your child theme functions.php
/* Disable VC auto-update */
function seventhqueen_vc_disable_update() {
if (function_exists('vc_license') && function_exists('vc_updater') && ! vc_license()->isActivated()) {
remove_filter( 'upgrader_pre_download', array( vc_updater(), 'preUpgradeFilter' ), 10);
remove_filter( 'pre_set_site_transient_update_plugins', array(
vc_updater()->updateManager(),
'check_update'
) );
@beovulf
beovulf / if_else_lang.php
Created December 1, 2016 08:19
If else language wordpress (polylang)
<?php
$currentlang = get_bloginfo('language');
if($currentlang=="en-GB"):
?>
<?php elseif($currentlang=="pl-PL"): ?>
<?php endif; ?>
@lukecav
lukecav / DNS Prefetch domains
Last active October 9, 2024 00:30
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@MrJSdev
MrJSdev / functions.php
Last active August 11, 2020 12:51
The guide for this code is available at http://extracatchy.net/resize-wordpress-images-on-upload
<?php
/**resize on upload to the largest size in media setting */
function replace_uploaded_image($image_data) {
// if there is no large image : return
if (!isset($image_data['sizes']['large'])) return $image_data;
// path to the uploaded image and the large image
$upload_dir = wp_upload_dir();
@xadapter
xadapter / functoin.php
Last active July 13, 2020 15:26
Snippet to hide WooCommerce shipping methods on the cart/checkout page based on the destination country. Supports PluginHive Shipping Plugins: https://www.pluginhive.com/product-category/woocommerce-plugin/woocommerce-shipping/
add_filter('woocommerce_package_rates', 'wf_remove_shipping_options_for_particular_country', 10, 2);
function wf_remove_shipping_options_for_particular_country($available_shipping_methods, $package){
global $woocommerce;
//Config this array with country code and corresponding shipping methods to hide.
$country_list = array(
'CA' => array('wf_fedex_woocommerce_shipping','free_shipping'),
);
@maddisondesigns
maddisondesigns / functions.php
Last active March 8, 2025 09:18
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
<?php
/*
Plugin Name: CI Comment Rating
Description: Adds a star rating system to WordPress comments
Version: 1.0.0
Author: The CSSIgniter Team
Author URI: https://cssigniter.com/
*/
//Enqueue the plugin's styles.
@trey8611
trey8611 / import-optimizations.md
Last active November 29, 2024 11:06
WP All Import - Optimize your import speed.