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 / functions.php
Created June 16, 2025 09:02 — forked from emre-edu-tech/functions.php
Filter to limit or trim product title using characters or words except on Single Product Template
<?php
add_filter( 'the_title', 'shorten_woo_product_title', 10, 2 );
function shorten_woo_product_title( $title, $id ) {
if (!is_singular(array('product')) && get_post_type($id) === 'product') {
// return substr( $title, 0, 30) . '…'; // change last number to the number of characters you want
return wp_trim_words($title, 4); // last number = words
} else {
return $title;
}
}
@dexit
dexit / cpt-metabox.php
Created June 12, 2025 12:40 — forked from jonshipman/cpt-metabox.php
Custom Post Type Metabox Class
<?php
/**
* Custom Post Type Meta Box.
*
* @package Heartland
*/
/**
* Meta box class.
*/
@dexit
dexit / ocdi_elementor_kit_import.php
Created June 12, 2025 12:38 — forked from arfinmilondev/ocdi_elementor_kit_import.php
Import Elementor kit data in OCDI
/**
* Function to perform setup after importing data.
* This function assigns the front page and the posts page (blog page) based on the imported demo.
* @param array $selected_import The selected import data.
* @link https://www.codeixer.com/addressing-the-issue-of-one-click-demo-import-not-add-elementor-global-options/
*/
function cdx_after_import_setup( $selected_import ) {
// Import Elementor kit data.
$cdx_kit_zip = get_parent_theme_file_path() . '/demo-content/elementor-kit.zip';
@dexit
dexit / functions.php
Created June 12, 2025 12:37 — forked from harisenbon/functions.php
Elementor Empty Dynamic Field Condition
/**
* Load our override of dynamic-tags-condition
*/
add_action( 'elementor/display_conditions/register', function( $conditions_manager ) {
require_once(get_template_directory() . '/inc/elementor/seg-dynamic-tags-condition.php' );
$conditions_manager->register_condition_instance( new \Seg_Dynamic_Tags_Condition() );
} );
@dexit
dexit / elementor-conditions.php
Created June 12, 2025 12:31 — forked from pingram3541/elementor-conditions.php
Elementor Element Display Condition by Post ID
<?php
/**
* Plugin Name: Elementor Conditions for Elements
* Description: A plugin to add custom display conditions
* Plugin URI: https://elementor.com/
* Version: 1.0.0
* Author: Phil Ingram
* Author URI: https://developers.elementor.com/
* Text Domain: elementor-conditions
*

Mudassar Ali

Muridke Town Main Bazar, Lahore, Punjab, 29000

+92 300 4746182 | [email protected]

LinkedIn: linkedin.com/in/mudassar-ali-chouhan | GitHub: github.com/mudassaralichouhan

Date: [Insert Date]

@dexit
dexit / About-Laravel-Twilio-Webhook-Callback.php
Created June 12, 2025 10:22 — forked from ccc-developer/About-Laravel-Twilio-Webhook-Callback.php
Templates for handling a Twilio Webhook for a Status Callback using Laravel (including Event & Listener)
Hi. I'm new to Laravel & PHP, so thanks for joining me on this journey.
My application CareNote - https://carenote.app allows a user to send a Twilio SMS.
Twilio can post a SMS message status callback/webhook.
Laravel makes it straight-forward to handle this incoming Webhook.
Workflow:
• Route to Incoming Twilio Callback
• Add 'api/twilio/incoming/callback' to the VerifyCsrfToken exclude array
@dexit
dexit / lol.php
Created June 12, 2025 10:17 — forked from owainlewis/lol.php
Tumblr source code ? Don't know if this is real
<?php
require_once('chorus/Utils.php');
require_once('chorus/Kestrel.php');
require_once('chorus/DataService.php');
require_once('chorus/Shard.php');
Database::set_defaults(array(
'user' => 'tumblr3',
'password' => 'm3MpH1C0Koh39AQD83TFhsBPlOM1Rx9eW55Z8YWStbgTmcgQWJvFt4',
'database' => 'tumblr3',
@dexit
dexit / 1-outbound-call.php
Created June 12, 2025 10:16 — forked from jmadden/1-outbound-call.php
Twilio PHP Outbound Call and Gather Example
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "YOU_ACCOUNT_SID";
$token = "YOUR_AUTH_TOKEN";
$client = new Client($sid, $token);
@dexit
dexit / call.php
Created June 12, 2025 10:15 — forked from jonmarkgo/call.php
Simple Phone Verification with Twilio, PHP, MySQL, and jQuery
<?php
require("Services/Twilio.php");
require("database.php");
// require POST request
if ($_SERVER['REQUEST_METHOD'] != "POST") die;
// generate "random" 6-digit verification code
$code = rand(100000, 999999);