Skip to content

Instantly share code, notes, and snippets.

@ewallz
ewallz / README.MD
Created March 7, 2022 15:18 — forked from ihciah/README.MD
A reverse proxy for Telegram Bot API on Aliyun Function Compute / Cloudflare Workers

A reverse proxy for Telegram Bot API on Aliyun Function Compute / Cloudflare Workers

To help users in China mainland access telegram api stably and conveniently with low cost, this script maybe the one you need.

The server-less means you don't have to run a server to proxy the requests, just pay as you go.

Usage

Edit key_prefix, set it to the prefix of you bot address(like /bot563441998:) can avoid abusing.

@ewallz
ewallz / pll_copy_post_metas.php
Created September 15, 2021 16:36 — forked from qstudio/pll_copy_post_metas.php
WP / PolyLang / Un-Sync Specified Custom Fields
<?php
// filter to exclude specified post_meta from Polylang Sync ##
add_filter( 'pll_copy_post_metas', 'q_pll_copy_post_metas' );
/**
* Remove defined custom fields from Polylang Sync
*
* @since 0.1
* @param Array $metas
@ewallz
ewallz / wp-disable-plugin-update.php
Created August 11, 2021 09:28 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
if ( isset($value) && is_object($value) ) {
if ( isset( $value->response['plugin-folder/plugin.php'] ) ) {
unset( $value->response['plugin-folder/plugin.php'] );
}
<?php
/**
* Plugin Name: WooCommerce Custom Payment Gateway
* Version: 1.0.0
**/
class WC_Other_Payment_Gateway extends WC_Payment_Gateway {
public function __construct() {
$this->id = 'other_payment';
@ewallz
ewallz / make-elementor-default-editor.php
Created September 17, 2019 09:00 — forked from heyfletch/make-elementor-default-editor.php
Make Elementor the Default Editor, Not the WordPress Editor (Gutenberg or Classic)
<?php
/**
* Make Elementor the default editor, not the WordPress Editor (Gutenberg or Classic)
* Clicking the page title will take you to the Elementor editor directly
* Even non-Elementor-edited pages will become Elementor-edited pages now
* You can revert by clicking the "Back to WordPress Editor" button
*
* Author: Joe Fletcher, https://fletcherdigital.com
* URL: https://gist.github.com/heyfletch/7c59d1c0c9c56cbad51ef80290d86df7
@ewallz
ewallz / woocommerce-filter-gateways.php
Created November 12, 2018 16:16 — forked from yanknudtskov/woocommerce-filter-gateways.php
Remove payment gateways based on the totalt amount in the WooCommerce cart. #woocommerce #cart #gateways
<?php
add_filter('woocommerce_available_payment_gateways', 'va_filter_gateways', 1);
function va_filter_gateways($gateways) {
global $woocommerce;
// This line should be changed to reflect the name of the payment gateway you want to remove
$payment_method_name = 'paypal'; // Could be bacs, cheque, paypal, epay_dk, etc.
@ewallz
ewallz / points_shortcode
Created July 26, 2017 07:31
Shortcode fix for WC Points & Rewards
function woocommerce_points_rewards_my_points($atts, $content = null) { // **SHORTCODE** add string ($atts, $content=null)
global $wc_points_rewards;
$points_balance = WC_Points_Rewards_Manager::get_users_points( get_current_user_id() );
$points_label = $wc_points_rewards->get_points_label( $points_balance );
$count = apply_filters( 'wc_points_rewards_my_account_points_events', 5, get_current_user_id() );
// get a set of points events, ordered newest to oldest
$args = array(