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
/** | |
* Title: [YITH] Change product-brands slug name | |
* Author: Mattias Ghodsian | |
* Description: Change product-brands slug name | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
function yith_brand_slug_rewrite() { | |
return 'varumarke'; | |
} |
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
/** | |
* Title: [Woocommerce] Add product attribute to menu | |
* Author: Mattias Ghodsian | |
* Description: Add product attribute to menu | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
add_filter('woocommerce_attribute_show_in_nav_menus', 'wc_attr_in_menu', 1, 2); | |
function wc_attr_in_menu( $register, $name = '' ) { | |
if ( $name == 'pa_smakprofil' ) $register = true; |
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
/** | |
* Title: Append text before comment form | |
* Author: Mattias Ghodsian | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
add_action('comment_form_before', 'text_before_comment_form'); | |
function text_before_comment_form() { | |
echo '<h4>Hello world</h4>'; | |
} |
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
#!/bin/bash | |
### | |
# Title: add site (experimental) | |
# Author: Mattias Ghodsian | |
# Description: Auto make site for nginx (run with sudo) | |
# Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
# Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
### |
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 | |
/** | |
* Title: Ratsit | |
* Author: Mattias Ghodsian | |
* Docs: https://api.ratsit.se/swagger/ui/index.html#/ | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
class RATSIT |
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
/** | |
* Title: coinmarketcap exchanges | |
* Author: Mattias Ghodsian | |
* Description: Fetch Coin exchanges with coins they offer (Don't use for live sites, this is experimental and for practise) | |
* Site: https://coinmarketcap.com/exchanges/volume/24-hour/all/ | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
function getExchangeData($exchanges, $coins){ | |
$data = ['meta' => ['source' => 'coinmarketcap.com', 'datatype' => 'exchanges', 'interval' => '24h', 'version' => 'alpha (practise)', 'created' => '9/05/2018', 'developer' => 'Mattias Ghodsian'] ]; |
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
/** | |
* Title: Add YITH Brand to Schema on Product page | |
* Author: Mattias Ghodsian | |
* Description: This is for yith-woocommerce-brands-add-on-premium plugin | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
function yith_brand_schema() { | |
if ( is_product() ) { |
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
/** | |
* Title: Filter bad words in comments | |
* Author: Mattias Ghodsian | |
* Description: Filter bad words in comments | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
function filter_text( $comment_text, $comment = null ) | |
{ | |
$words = ['grym', 'great', 'awesome', 'good']; |
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
/** | |
* Title: Remove yoast bredcrumb ld+json | |
* Author: Mattias Ghodsian | |
* Description: This removes the schema (json+ld) from yoast | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
function remove_yoast_breadcrumb_json_ld($data) | |
{ | |
if ( $data['@type'] == 'BreadcrumbList') { |
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
/** | |
* Title: Custom Wordpress Dropdown | |
* Author: Mattias Ghodsian | |
* Description: Custom wordpress dropdown for taxonomy terms | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
* | |
* | |
* @param array $taxonomy |