This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sort(input, ...sortArgs) { | |
// Handles both null and undefined | |
if (input == null) return []; | |
if (typeof input === 'string') { | |
return input.split(',').sort(...sortArgs); | |
} | |
if (Array.isArray(input)) { | |
return input.slice().sort(...sortArgs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_product_tabs', 'wc_add_custom_tabs' ); | |
function wc_add_custom_tabs($tabs) { | |
// Add the custom tab | |
$tabs['specifiction_tab'] = array( | |
'title' => __('Specification', 'dcpd'), | |
'priority' => 50, | |
'callback' => 'wc_custom_tabs_cb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WooCommerce Catalog Mode | |
Plugin URI: https://gist.github.com/mbilalsiddique1/52c0d13cd5c78f8f00f0c024b521f761 | |
Description: This plugin enables catalog mode for WooCommerce and removes the shopping functionality. | |
Version: 1.0.0 | |
Author: Muhammad Bilal | |
Author URI: https://github.com/mbilalsiddique1 | |
License: GPLv2 or later | |
Text Domain: woocommerce-catalog-mode |