Skip to content

Instantly share code, notes, and snippets.

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

Taciara Furtado taciara

🏠
Working from home
View GitHub Profile
@taciara
taciara / code.php
Created October 27, 2022 19:25 — forked from luizbills/code.php
Copy custom terms when duplicatin a woocommerce product
<?php
// credits: https://github.com/woocommerce/woocommerce/issues/17487#issuecomment-565433819
add_action( 'woocommerce_product_duplicate', function ( $duplicate, $product ) {
$taxonomies = [ 'taxonomy1', 'taxonomy2' ];
foreach ( $taxonomies as $taxonomy ) {
$terms = get_the_terms( $product->get_id(), $taxonomy );
if ( ! is_wp_error( $terms ) ) {
wp_set_object_terms( $duplicate->get_id(), wp_list_pluck( $terms, 'term_id' ), $taxonomy );
}
@taciara
taciara / wp-chosen-tax-metabox.php
Created April 24, 2022 02:25 — forked from helen/wp-chosen-tax-metabox.php
Use Chosen for a replacement WordPress taxonomy metabox
<?php
/**
* WordPress Chosen Taxonomy Metabox
* Author: Helen Hou-Sandi
*
* Use Chosen for a replacement taxonomy metabox in WordPress
* Useful for taxonomies that aren't changed much on the fly and are
* non-hierarchical in nature, as Chosen is for flat selection only.
* You can always use the taxonomy admin screen to add/edit taxonomy terms.
* Categories need slightly different treatment from the rest in order to
@taciara
taciara / jquery.fullPage.js
Created March 22, 2021 13:12 — forked from jtmalinowski/jquery.fullPage.js
jquery.fullPage.js with horizontal wheel-scrolling, it has some other changes too, so diff against original one to see what has changed
/**
* fullPage 2.0.9
* https://github.com/alvarotrigo/fullPage.js
* MIT licensed
*
* Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
*/
(function($) {
$.fn.fullpage = function(options) {
@taciara
taciara / yoast_seo_sitemap_add_custom_type.php
Created August 16, 2020 00:11 — forked from amboutwe/yoast_seo_sitemap_add_custom_type.php
Filters and example code for Yoast SEO sitemaps
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Create Custom Yoast Sitemap
* Credit: Unknown
* Last Tested: Unknown
*********
* HOW TO USE
* Replace TYPE with your custom type
*/
@taciara
taciara / functions.php
Created May 19, 2018 22:48 — forked from douglasanro/functions.php
Create WordPress settings page For custom options
<?php
// Let’s instantiate this class in our functions.php file:
if( is_admin() ) {
require 'simple_settings_page.php';
new simple_settings_page();
}