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
@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'
) );
@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
@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';
@iMazed
iMazed / contactform7-form.php
Created February 27, 2015 09:11
Great for when you want to use FontAwesome in a submit button in Contact Form 7
//add instead of [submit] in Contact Form 7
<button type="submit" class="btn btn-large btn-primary"><i class="fa fa-bed"></i></button>
<img class="ajax-loader" src="http://www.yoursite.com/wp-content/plugins/contact-form-7/images/ajax-loader.gif" alt="Sending ..." style="visibility: hidden; opacity: 1;">
@r-a-y
r-a-y / bp-disable-translation.php
Created February 15, 2015 18:40
Disable automatic translations by WordPress.org / GlotPress for BuddyPress.
<?php
/*
Plugin Name: BP Disable Auto Translation
Description: Disables automatic translations by WordPress.org / GlotPress for BuddyPress.
Author: r-a-y
License: GPLv2 or later
*/
/**
* Disables automatic translations for BuddyPress.
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active October 28, 2024 06:16
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
@wpmark
wpmark / gist:9d5d2395cb01a2de0179
Created October 8, 2014 11:06
Check If WordPress Post is Older than X Days
<?php
/*******************************
* this will work in the loop
*******************************/
/* check if the posts publish date is older than 60 days */
if( strtotime( $post->post_date ) < strtotime('-60 days') ) {
/* post is older than 60 days - do something with it!! */
@bramchi
bramchi / searchform.php
Last active November 1, 2022 12:07
Roots.io searchform.php template hack to get search widget working in Polylang, only searching within the active language. 'soil-nice-search' disabled btw.
<?php
/*
*
* Roots.io searchform.php template hack to fix Polylang search
*
* Note: Polylang setting 'Hide URL language info for default language' should be enabled for this to work.
* Soil-nice-search disabled in Roots.
*
*/
@jillmugge
jillmugge / wp-config.php
Last active December 7, 2018 15:19
wp-config.php
/* Place after define('WP-DBUG', false);*/
define('FORCE_SSL_ADMIN', true); //will force login thru SSL https://entire site: goto general settings add https://
//define('ALTERNATE_WP_CRON', true); //posts not getting published? redirect cron
//define('DISALLOW_FILE_EDIT', true); //will disable WP editor
//define('DISALLOW_FILE_MODS', true); //disables add/delete theme & plugins
define('WP_CASHE', true); //wp default cashe.
//define('WP_POST_REVISIONS', 4); //limits revisions false to turn off
//define('AUTOSAVE_INTERVAL', 240); //minutes
//define( 'WP_SITEURL', 'https://jmgmarketinggroup.com' ); //hard code into gen settings
//define( 'WP_HOME', 'https://jmgmarketinggroup.com' );
@maxrice
maxrice / wc-hide-coupons-cart-checkout.php
Created January 21, 2014 23:43
WooCommerce - hide the coupon form on the cart or checkout page, but leave coupons enabled for use with plugins like Smart Coupons and URL Coupons
<?php
// hide coupon field on cart page
function hide_coupon_field_on_cart( $enabled ) {
if ( is_cart() ) {
$enabled = false;
}
return $enabled;