Skip to content

Instantly share code, notes, and snippets.

View cdsaenz's full-sized avatar

charly cdsaenz

View GitHub Profile
@cdsaenz
cdsaenz / functions.php
Created December 4, 2024 18:50 — forked from unculturedswine/functions.php
Using Pardot and Formidable
<?php
add_action('frm_after_create_entry', 'sendToPardotFormHandler', 30, 2);
function sendToPardotFormHandler($entry_id, $form_id){
if($form_id == 3){ //replace 3 with the id of the form
$args = array();
if(isset($_POST['item_meta'][XX])) //change XX to the field ID
$args['firstName'] = $_POST['item_meta'][XX]; //change 'firstName' to the named parameter to send
if(isset($_POST['item_meta'][XX])) //change XX to the field ID
$args['lastName'] = $_POST['item_meta'][XX]; //change 'lastName' to whatever you need
if(isset($_POST['item_meta'][XX])) //change XX to the field ID
@cdsaenz
cdsaenz / lazy-load
Created October 30, 2024 20:54 — forked from keithdevon/lazy-load
Lazy loading WordPress images
// make sure this script is called in the footer of your document
function inView(image){
var $image = jQuery(image),
view_top = jQuery(window).scrollTop() - 300,
view_bottom = view_top + jQuery(window).height() + 600,
height = $image.height(),
_top = $image.offset().top,
_bottom = _top + height;
return height > 0 && _top <= view_bottom && _bottom >= view_top;
@cdsaenz
cdsaenz / website-field.php
Created September 5, 2024 18:16 — forked from cartpauj/website-field.php
Collect a website URL from users at signup in MemberPress. Allows you to store a different website URL with each user's subscription.
<?php
/*
Plugin Name: MemberPress Website Fields
Version: 1.0.0
Author: Caseproof, LLC
Author URI: http://caseproof.com
Description: Allow users to enter their website URL for each subscription they purchase
*/
//Signup form functions
@cdsaenz
cdsaenz / README.md
Created March 20, 2024 21:04 — forked from AmmarCodes/README.md
WordPress: link to specific elementor tab on a specific page

It's a quick ad-hoc solution to allow you to link to your page to a specific tab from elementor tabs widget.

Here's the catch, you need to replace the id of the specific tab you want to use to not contain the title- part.

Use https://your-website/#elementor-tab-1515

instead of: https://your-website/#elementor-tab-title-1515

@cdsaenz
cdsaenz / index.html
Created March 6, 2024 12:14 — forked from iosifnicolae2/index.html
Whatsapp Floating Button
<a href="https://wa.me/40123456789?text=hi" style="
position: fixed;
width: 60px;
height: 60px;
bottom: 32px;
right: 33px;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
@cdsaenz
cdsaenz / class-jwt.php
Created September 26, 2023 00:25 — forked from davisshaver/class-jwt.php
WordPress/Coral Project Talk JWT integration
<?php
use \Firebase\JWT\JWT as JWT_Wrapper;
/**
* Class wrapper for JWT tokens.
*/
class JWT {
use Singleton;
@cdsaenz
cdsaenz / mailchimp-curl.php
Created June 16, 2023 16:42 — forked from iloveitaly/mailchimp-curl.php
MailChimp PHP API using CURL
<?php
class Mailchimp_Core {
var $version = "1.3";
var $errorMessage;
var $errorCode;
/**
* Cache the information on the API location on the server
*/
@cdsaenz
cdsaenz / card.php
Created May 13, 2023 21:31 — forked from Niq1982/card.php
Load more to WordPress blog archive using AlpineJS and Axios
<div class="card">
<?php if ($args['link']) : ?>
<a href="<?php echo esc_url($args['link']); ?>" class="global-link">
</a>
<?php endif; ?>
<div class="card-image">
<?php wp_get_attachment_image($args['image']); ?>
</div>
@cdsaenz
cdsaenz / wpinstall.sh
Created January 18, 2023 18:40 — forked from fmtarif/wpinstall.sh
#wp #bash #cli Install and initial set up for WordPress sites (uses WP-CLI)
#!/bin/bash
# get wp-cli
# curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp
# wp-cli auto-completion
# wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash && source wp-completion.bash && echo -e "\nsource wp-completion.bash" >> .bashrc
#verify if wp-cli correctly installed
# wp --info
@cdsaenz
cdsaenz / 01-common-example.php
Created November 14, 2022 17:29 — forked from westonruter/01-common-example.php
Temporarily disabling filters in WordPress
<?php // Common way to do it:
remove_filter( 'the_title', 'wptexturize' );
$title = get_the_title();
add_filter( 'the_title', 'wptexturize' );