Skip to content

Instantly share code, notes, and snippets.

View Jany-M's full-sized avatar
🎯
Focusing

Jany Martelli Jany-M

🎯
Focusing
View GitHub Profile
@corsonr
corsonr / gist:3d0425deaa80c601d454
Last active August 9, 2023 17:49
WooCommerce: custom variations settings
<?php
// Add Variation Settings
add_action( 'woocommerce_product_after_variable_attributes', 'variation_settings_fields', 10, 3 );
// Save Variation Settings
add_action( 'woocommerce_save_product_variation', 'save_variation_settings_fields', 10, 2 );
/**
* Create new fields for variations
@mwolff44
mwolff44 / gist:abfc7848e5cfa35b8c6a
Last active February 24, 2019 06:41
remove jetpack unwanted css - Wordpress
<?php
/*
MU Plugin: remove-jetpack-css
Plugin Name: WP Remove Jetpack CSS
Plugin URI: http://www.blog-des-telecoms.com
Description: Remove jetpack CSS
Version: 1.0
Author: Mathias WOLFF
Author URI: http://www.mathias-wolff.fr
License: GPLv3
@kjbenk
kjbenk / purge_transients.php
Last active November 20, 2021 15:28
WordPress - Purge All Expired Transients
<?php
// Schedule the CRON Job to purge all expired transients
if (!wp_next_scheduled('purge_popup_transients_cron')) {
/**
* wp_schedule_event
*
* @param - When to start the CRON job
@ericrasch
ericrasch / disable-xml-rpc.php
Created April 10, 2015 18:46
Disable XML-RPC + Pingback WordPress Plugin
<?php
/*
Plugin Name: Disable XML-RPC + Pingback
Plugin URI: http://www.philerb.com/wp-plugins/
Description: This plugin disables XML-RPC API + pingbacks in WordPress 3.5+, which is enabled by default. 2 WP plugins were combined together to cover all bases.
Version: 1.0.0
Author: Eric Rasch
Author URI: http://ericrasch.com
License: GPLv2
*/
@neilgee
neilgee / jetpack-all-modules.php
Last active May 5, 2019 13:08
Remove JetPack CSS
<?php
//Do not copy the above php tag
// Stop JetPacks Minified/Concatention CSS file
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
//Remove JepPack CSS
function themeprefix_remove_jetpack_css() {
wp_deregister_style( 'AtD_style' ); // After the Deadline
wp_deregister_style( 'jetpack_likes' ); // Likes
@lagden
lagden / Custom-select-box.markdown
Created November 25, 2014 22:02
Custom select box
@Zodiac1978
Zodiac1978 / .htaccess
Last active May 3, 2024 12:11
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
@abrudtkuhl
abrudtkuhl / wp_posts.reset.sql
Created July 22, 2014 17:54
Reset Auto_Increment in WordPress Posts table
DELETE FROM wp_posts;
DELETE FROM wp_post_meta;
TRUNCATE TABLE wp_posts;
TRUNCATE TABLE wp_post_meta;
@dcondrey
dcondrey / format-audio.php
Created July 19, 2014 08:21
Modify Wordpress Post Formats and display them as a horizontal tab bar along the top of the post editor page.
<div class="post-editor-block" id="post-editor-audio-fields" style="display: none;">
<label for="post-editor-audio-embed"><?php _e('Audio URL (oEmbed) or Embed Code', 'post-format'); ?></label>
<textarea name="_format_audio_embed" id="post-editor-audio-embed" tabindex="1"><?php echo esc_textarea(get_post_meta($post->ID, '_format_audio_embed', true)); ?></textarea>
</div>
@DanielSantoro
DanielSantoro / functions.php
Created July 18, 2014 15:40
Only display minimum price for WooCommerce variable products
/**
* Only display minimum price for WooCommerce variable products
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';