This file contains hidden or 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: Read more/less | |
* Plugin URI: https://ozbey.se | |
* Description: Read more/less in WooCommerce product categories | |
* Version: 2 | |
* Author: Tolga Ozbey | |
* Author URI: https://ozbey.se | |
* Requires at least: 5.6 | |
* Requires PHP: 7.4 |
This file contains hidden or 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 Registration Fields | |
* Description: My Custom registration fields. | |
* Version: 1.0 | |
* Author: T | |
*/ | |
/* Extra Fields in WooCommerce Registration */ |
This file contains hidden or 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 | |
/** | |
* Disable Admin Notification of User Password Change | |
* | |
* Credit: https://wordpress.stackexchange.com/a/266006/67466 | |
* | |
* Suppressing this email notification has to be handled | |
* with a plugin because pluggable.php is loaded earlier | |
* than a theme's functions.php file. |
This file contains hidden or 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
{ | |
"editor.fontSize": 16, | |
"editor.lineHeight": 24, | |
"editor.letterSpacing": 0.2, | |
"editor.fontFamily": "Source Code Pro", | |
"editor.fontLigatures": true, | |
"workbench.iconTheme": "vs-seti", | |
"editor.minimap.enabled": false, | |
"workbench.colorCustomizations": { | |
"tab.inactiveBackground": "#31353d", |
This file contains hidden or 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
/** | |
* Hide admin menu items. Can be both parents and children in dropdowns. | |
* Specify link to parent and link to child. | |
* @link https://codex.wordpress.org/Function_Reference/remove_menu_page | |
*/ | |
add_action( 'admin_menu', function () { | |
// Remove Settings | |
remove_menu_page( 'options-general.php' ); | |
// Remove Settings -> Writing |
This file contains hidden or 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
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields'); | |
add_filter('woocommerce_enable_order_notes_field', '__return_false'); | |
function custom_remove_woo_checkout_fields( $fields ) { | |
// remove billing fields | |
unset($fields['billing']['billing_first_name']); | |
unset($fields['billing']['billing_last_name']); | |
unset($fields['billing']['billing_company']); | |
unset($fields['billing']['billing_address_1']); |
This file contains hidden or 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
// Remove all tabs on product page | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
// unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; |
This file contains hidden or 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
// Add save amount next to sale item prices | |
add_filter( 'woocommerce_get_price_html', 'modify_woocommerce_get_price_html', 10, 2 ); | |
function modify_woocommerce_get_price_html( $price, $product ) { | |
if( $product->is_on_sale() && ! is_admin() ) | |
return $price . sprintf( __('<p class="saveprice">Du sparar: <span class="woocommerce-Price-amount amount">%s <span class="woocommerce-Price-currencySymbol">kr</span></span></p>', 'woocommerce' ), $product->regular_price - $product->sale_price ); | |
else | |
return $price; | |
} |
This file contains hidden or 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
// Hide WordPress admin notices | |
function oz_disable_admin_notices() { | |
global $wp_filter; | |
if ( is_user_admin() ) { | |
if ( isset( $wp_filter['user_admin_notices'] ) ) { | |
unset( $wp_filter['user_admin_notices'] ); | |
} | |
} elseif ( isset( $wp_filter['admin_notices'] ) ) { | |
unset( $wp_filter['admin_notices'] ); | |
} |