Skip to content

Instantly share code, notes, and snippets.

View KingMatrix1989's full-sized avatar

Roy (KM) KingMatrix1989

  • Netherland
View GitHub Profile
@HoussenMoshine
HoussenMoshine / telegram-instant-view-template-help
Last active December 27, 2023 18:40
Help for Telegram Instant View Template
# To remove only some text on a content
@remove: //p[self::p/strong[contains(text(), "Articles liés")]]
@remove: //iframe[contains(@src,"https://urlsomething")]
# To deal with fucking error of <img> is not supported in blabla
@before_el(./..): //a/img
@before_el(./..): //p/img
@spivurno
spivurno / gw-gravity-forms-display-prices-for-choice-based-product-fields.php
Last active May 19, 2023 21:48
Gravity Wiz // Gravity Forms // Display Price for Drop Down and Radio Button Product Fields
<?php
/**
* Gravity Wiz // Gravity Forms // Display Price for Drop Down and Radio Button Product Fields
* http://gravitywiz.com/
* Source: https://www.gravityhelp.com/documentation/article/gform_field_choice_markup_pre_render/#2-include-price-for-product-fields
*/
add_filter( 'gform_field_choice_markup_pre_render', function ( $choice_markup, $choice, $field, $value ) {
if ( $field->type == 'product' ) {
$new_string = sprintf( '>%s - %s<', $choice['text'], GFCommon::to_money( $choice['price'] ) );
@bekarice
bekarice / memberships-get-rules-sample.php
Created April 19, 2016 20:57
memberships: get plan restriction rules, check for product categories
<?php
// get plan restriction rules if we have an ID, could be used in member area for example
$plan = wc_memberships_get_membership_plan( $plan_id );
$product_rules = $plan->get_product_restriction_rules();
foreach ( $product_rules as $rule ) {
// get the ids of restricted items from the rules
$restricted_items = $rule->get_object_ids();
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active June 13, 2024 14:06
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@mclanecreative
mclanecreative / my-account.php
Last active March 27, 2023 23:12
Adds Tabs to WooCommerce "My Account" page. Instructions: add my-account.php to your /woocommerce/myaccount/ folder. Next, add the CSS to your child theme's style.css file. 11/25/2015 - Added tab6 for Event Espresso WP User Integration. Next challenge is to include Sensei My Courses & Pippin's AffiliateWP on these tabs.
<?php
/**
* My Account page
*
* @author WooThemes
* @edited by McLane Creative
* @package WooCommerce/Templates
* @version 3.1.0
*/