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: WooCommerce - Klarna payment gateway (Modded) | |
* Author Niklas Hogefjord | |
* Editor: Mattias Ghodsian | |
* Description: Only accept purchases from customer over 18 years of age. | |
* Source: https://gist.github.com/NiklasHogefjord/07e60a4f08799c3cfdb0870fb5481f71 | |
* Klarna: https://developers.klarna.com/en/se/kco-v2/checkout-api | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
**/ |
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: Group simple/variations | |
* Author Mattias Ghodsian | |
* Description: Group simple/variations and group all variations that had same parent | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
**/ | |
function wooGroupProducts(){ | |
$args = array( 'post_type' => 'product', 'posts_per_page' => -1 ); | |
$loop = new WP_Query( $args ); |
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: PRO Ladder | |
* Author: Mattias Ghodsian | |
* Description: Get ladder data as array from http://pokemon-revolution-online.net | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
**/ | |
class PROLadder | |
{ | |
private $url = "http://pokemon-revolution-online.net/ladder.php"; |
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: getProductIDBySku | |
* Author: Mattias Ghodsian | |
* Description: get woocommerce product ID by sku | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
**/ | |
Public function getProductIDBySku( $sku ) | |
{ | |
if (empty($sku)) { return false; } | |
global $wpdb; |
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: Runner | |
* Author: Mattias Ghodsian | |
* Description: Run given functions from array | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
class Runner | |
{ |
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: Widgets collapse for Front-end user | |
* Author Mattias Ghodsian | |
* Description: Make widgets inside widget area collapse for the Front-end user | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
// register widget area |
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 Get product attributes | |
* Author: Mattias Ghodsian | |
* Description: Get product attributes in a simple way (array) | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
* | |
* @param integer $postID | |
* return array | |
**/ |
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: Wordpress Get Taxonomy | |
* Author: Mattias Ghodsian | |
* Description: Wordpress Get taxonomy and assosiated options & "fields" | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
* | |
* @param boolean $getCurrent get current set "brand" and not list | |
* @param string $taxonomy taxonomy | |
* @param boolean $hide_empty hide empty terms |
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 Show price only for logged-in users | |
* Author: Mattias Ghodsian | |
* Description: Woocommerce Show price only for logged-in users | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
* | |
* @param integer $price | |
* @param array $product | |
* return integer |
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: Shortcode Logged in | |
* Author: Mattias Ghodsian | |
* Description: Shortcodes that works like if statments | |
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian | |
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5 | |
**/ | |
// If logged in | |
function loggedincontent( $atts , $content) |
OlderNewer