Skip to content

Instantly share code, notes, and snippets.

View Ezekiel1349's full-sized avatar
💻
Working at Home!

Ezequiel Alonzo Ezekiel1349

💻
Working at Home!
View GitHub Profile
function my_custom_post_types() {
$args = array(
'label' => 'Recipes',
'hierarchical' => true,
'taxonomies => array( 'post_tag' )
);
register_post_type( 'recipe', $args );
}
add_action( 'init', 'my_custom_post_types' );
@Ezekiel1349
Ezekiel1349 / woocommerce-add-new-tab-my-account-page.php
Created October 26, 2021 19:27 — forked from sandeshjangam/woocommerce-add-new-tab-my-account-page.php
WooCommerce - Add New “Tab” at My Account Page
<?php
/**
* @snippet WooCommerce How To Add New Tab @ My Account
* @how-to Watch tutorial @ https://techiesandesh.com
* @author Sandesh Jangam
* @compatible WooCommerce 3.6.2
* @donate $7 https://www.paypal.me/SandeshJangam/7
*/
/**
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@Ezekiel1349
Ezekiel1349 / plugin.php
Created July 15, 2021 16:38 — forked from claudiosanches/plugin.php
WooCommerce - Send "New User Registration" email to admins when new customer is created.
<?php
/**
* Send "New User Registration" email to admins when new customer is created on WooCommerce.
*
* @param int $id New customer ID.
*/
function my_wc_customer_created_notification( $id ) {
wp_new_user_notification( $id, null, 'admin' );
}
@Ezekiel1349
Ezekiel1349 / attributes-as-options.php
Created January 28, 2021 11:45 — forked from dazecoop/attributes-as-options.php
WooCommerce product attributes as selectable options without variations
<?php
/**
* List available attributes on product page in a drop-down selection
*/
add_action('woocommerce_before_add_to_cart_button', 'list_attributes_on_product_page');
function list_attributes_on_product_page() {
global $product;
$attributes = $product->get_attributes();
@Ezekiel1349
Ezekiel1349 / countries
Created March 1, 2020 00:08 — forked from kalinchernev/countries
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria