Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
@dexit
dexit / twilio-validation.js
Created June 12, 2025 10:02 — forked from kylemclaren/twilio-validation.js
Twilio CF Worker request validation
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
});
/* WARNING:
Anything starting with REPLACEABLE_SECRET_VDB12_ shouldn't be renamed,
because they are used in deployment transformations.
Do not remove the comment below,
it is required to timestamp workers on upload.
Sent from npm.
<?php
/*
Plugin Name: Rad Webhook Demo
Plugin URI: <https://vrhermit.com/?p=4154>
Description: Adds custom WP JSON endpoints that use the FileMaker OData API to submit form data to FileMaker.
Version: 1.0
Author: radicalappdev
Author URI: <https://radicalappdev.com/>
*/
<?php
add_action( 'rest_api_init', 'custom_routes_webhook_0277');
function custom_routes_webhook_0277(){
//(exemplo: /wp-json/exemplo/notificacoes)
register_rest_route(
'exemplo', '/notificacoes/', array(
'methods' => 'POST',
@DavePodosyan
DavePodosyan / elementor-form-turnstile-handler.php
Last active December 17, 2025 12:56
Cloudflare Turnstile Integration for Elementor Forms
<?php
/**
*
* A simple integration of Cloudflare Turnstile with Elementor Forms, following Elementor’s pattern for reCAPTCHA.
*
* Instructions:
* 1. Add this file to your WordPress theme directory.
* 2. Include the file in your theme's `functions.php` file using:
*
@dexit
dexit / gist:7dce5d51a374f1e3bbed6efc8bf70d62
Created December 16, 2024 16:28 — forked from NickMkrtchyan/gist:bbd3f05d233dff84484cd09260be0475
Complate Corporate/Customer Woo Script
<?php
// Custom registration form for WooCommerce
function custom_woocommerce_register_form() {
$user_role = ( ! empty( $_POST['user_role'] ) ) ? sanitize_text_field( $_POST['user_role'] ) : '';
$company_id = ( ! empty( $_POST['company_id'] ) ) ? sanitize_text_field( $_POST['company_id'] ) : '';
?>
<p class="form-row form-row-wide">
<label for="user_role"><?php _e( 'Choose account type', 'woodmart' ); ?></label>
@dexit
dexit / access-to-elementor-form-submissions.php
Created November 15, 2024 12:12 — forked from wal-f/access-to-elementor-form-submissions.php
A method to provide full management of form submissions to less-privileged WP roles.
<?php
/*
Plugin Name: Elementor form submission access
Description: Promotes the Elementor Pro form submissions page to top level, and bypasses the excessive and inflexible restrictions on access.
Version: 2.0.0
Author: Some netizen
Update URI: do-not-auto-update
*/
namespace Elementor\Core\Admin\Menu;
@gingerbeardman
gingerbeardman / webhook.php
Last active February 10, 2025 23:11
Webhook receiver PHP script
<?php
// GitHub webhook secret (set this in your GitHub webhook settings)
$secret = "Y0UR-secret-text-here!";
// Get the payload
$payload = file_get_contents('php://input');
// Verify the signature
$signature = $_SERVER['HTTP_X_HUB_SIGNATURE'] ?? null;
@dexit
dexit / functions.php
Created June 12, 2024 19:17 — forked from JoelEadeDesign/functions.php
Elementor Display Conditions for Page Templates
<?php
/**
* Elementor Conditions based on Page Template
*
* @return void
*/
add_action( 'elementor/theme/register_conditions', function( $conditions_manager ) {
class Page_Template_Condition extends ElementorPro\Modules\ThemeBuilder\Conditions\Condition_Base {
@dexit
dexit / functions.php
Created June 12, 2024 13:49 — forked from pingram3541/functions.php
Elementor Form Validation - Block non-english bots
/**
* Checks form textarea content is english to reduce spam from non-english bots
**/
function elementor_form_message_field_validation( $field, $record, $ajax_handler ) {
// Let's check the message field only
if ( empty( $field ) || empty( $field['message'] ) ) {
return;
}
// Validate content format by language
$string = $field['message'];
add_action( 'elementor/query/myonmarketpropertyquery', 'elementor_query_on_market_only' );
function elementor_query_on_market_only( $query )
{
$meta_query = $query->get('meta_query');
$new_meta_query = $meta_query;
$new_meta_query[] = array(
'key' => '_on_market',
'value' => 'yes'