Skip to content

Instantly share code, notes, and snippets.

View IAMAdamN's full-sized avatar
💙
Blah blah blah

Adam IAMAdamN

💙
Blah blah blah
View GitHub Profile
@claudiosanches
claudiosanches / add-to-cart.php
Last active October 18, 2023 14:02
WooCommerce - Template add-to-cart.php with quantity and Ajax!
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
@edheltzel
edheltzel / fucntions.php
Last active February 15, 2023 18:47
Remove personal options from profile page in wordpress
/** REMOVE PERSONAL OPTIONS FROM PROFILE PAGE **/
<?
// removes the `profile.php` admin color scheme options
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
if ( ! function_exists( 'rdm_remove_personal_options' ) ) {
// removes the leftover 'Visual Editor', 'Keyboard Shortcuts' and 'Toolbar' options.
function rdm_remove_personal_options( $subject ) {
$subject = preg_replace( '#<h2>Personal Options</h2>.+?/table>#s', '', $subject, 1 );
@DevinWalker
DevinWalker / remove-rev-slider-metabox.php
Created May 14, 2014 20:32
This code removed the Revolution Slider metabox on pages, posts and CTPs
/**
* Remove Rev Slider Metabox
*/
if ( is_admin() ) {
function remove_revolution_slider_meta_boxes() {
remove_meta_box( 'mymetabox_revslider_0', 'page', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'post', 'normal' );
remove_meta_box( 'mymetabox_revslider_0', 'YOUR_CUSTOM_POST_TYPE', 'normal' );
}
@jwondrusch
jwondrusch / wordpress-disable-distraction-free.php
Last active September 13, 2022 18:02
Disable Distraction Free Writing Mode and Full Height Editor editor based on a list of post types.
<?php
/**
* Disable Distraction Free Writing Mode and the "Auto Expanding"
* height of the editor based on a list of post types.
*
* @return void
*/
function my_deregister_editor_expand($val, $post_type)
{
@woogist
woogist / wc_shipment_tracking_add_custom_provider.php
Last active September 22, 2022 02:37
Shipment Tracking: adds custom provider
/**
* wc_shipment_tracking_add_custom_provider
*
* Adds custom provider to shipment tracking or add existing providers to another country.
*
* Change the country name, the provider name, and the URL (it must include the %1$s)
* Add one provider per line
*/
add_filter( 'wc_shipment_tracking_get_providers' , 'wc_shipment_tracking_add_custom_provider' );
@CaroManel
CaroManel / wp-remove-slider-revolution-metabox.php
Created January 7, 2016 20:13
Remove Slider Revolution Metabox
/**
* Remove Slider Revolution Metabox
* for certain post types
*/
function remove_slider_rev_metabox() {
if ( is_admin() ) {
$post_types = array('page','post','custom','acf');
foreach ($post_types as $post_type) {
remove_meta_box( 'mymetabox_revslider_0', $post_type, 'normal' );
}
@leevigraham
leevigraham / Generate ssl certificates with Subject Alt Names on OSX.md
Last active June 11, 2024 09:48
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

We're going to generate a key per project which includes multiple fully qualified domains. This key can be checked into the project repo as it's intended for local development but never used on production servers.

Save ssl.conf to your my_project directory.

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

@croxton
croxton / SSL-certs-OSX.md
Last active March 3, 2024 18:58 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@lukecav
lukecav / functions.php
Created September 15, 2017 19:59
Bypass logout confirmation in WooCommerce
function wc_bypass_logout_confirmation() {
global $wp;
if ( isset( $wp->query_vars['customer-logout'] ) ) {
wp_redirect( str_replace( '&amp;', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) );
exit;
}
}
add_action( 'template_redirect', 'wc_bypass_logout_confirmation' );
add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' );
function custom_shipment_tracking( $providers ) {
unset($providers['Australia']);
unset($providers['Austria']);
unset($providers['Brazil']);
unset($providers['Belgium']);
unset($providers['Canada']);
unset($providers['Czech Republic']);