Skip to content

Instantly share code, notes, and snippets.

@wpt00ls
wpt00ls / uc_woocommerce_product_title_filter.php
Created December 20, 2023 04:11
Woocommerce product title filter for "Ultimate Carousel For Divi" plugin
<?php
// WooCommerce Product Title
add_filter(
'uc_carousel_product_title',
function ($title) {
// Add your logic to change the title string
$title = substr($title, 0, 9);
return $title;
},
@wpt00ls
wpt00ls / modify-faq-post-type-and-taxonomy-args-public.php
Last active October 18, 2023 03:34
Modify the faq post type and taxonomy args to make them public and searchable.
<?php
// Add this code to your child theme's function.php
// Filter to modify default post type args
add_filter('register_post_type_args', 'modify_faq_post_type_args', 10, 2);
/**
* Modify FAQ post type args to make them public and searchable
*/
@wpt00ls
wpt00ls / freemius_toolkit_hooks.php
Last active March 16, 2023 03:59
WordPress hooks for "Freemius Toolkit" plugin
<?php
/**
* Text at the start of the pricing table.
* Mainly used for multi-plan pricing tables
*/
add_filter(
'pricing_table_features_start',
function (
// generated list item content
@wpt00ls
wpt00ls / freemius-hooks.js
Created March 13, 2023 04:28
Freemius javascript hooks
/** On Freemius purchase complete **/
jQuery(document).on(
"wpt-freemius-checkout",
function(event, response, handler_args){
});
@wpt00ls
wpt00ls / divi-gravity-form-dynamic-gravityform-id-filter.php
Last active January 25, 2023 13:45
Replace the gravityform ID for the divi gravity form module with a programmatically computed form ID
/**
* A filter used in the "Divi Gravity Form" module to programmatically change the
* gravity form ID for the divi module.
*/
add_filter(
'wpt_divi_gravity_form_id',
function (
$gravity_form_id,
$post_id
) {
@wpt00ls
wpt00ls / custom-meta-data-field-and-imports-for-multi-locations.php
Created November 4, 2022 08:47
Gist to add custom meta field & exdend csv importer to import these fields for location post. Divi Multi Location plugin.
<?php
// Add custom fields to Location post type
add_filter(
'mlsl_custom_fields',
function($fields, $container){
// Add your custom fields by appending to $fields array
// Fields Documentation https://docs.carbonfields.net/ (version 3.3.2)
$fields[] = \Carbon_Fields\Field::make('text', 'my_custom_field', 'My Custom Field')
@wpt00ls
wpt00ls / filter-override-category-html-divi-masonry-gallery.php
Last active August 24, 2022 05:58
Filter to override the category link in the Divi "Post Type" Masonry Gallery
@wpt00ls
wpt00ls / function.php
Created August 12, 2022 04:44
Strip Slash Filter - Ultimate Carousel For Divi
<?php
// add this to your divi child theme
add_filter(
'uc_carousel_can_strip_slashes',
function ($strip_slashes) {
return false;
},
10,
1
);
@wpt00ls
wpt00ls / function.php
Last active April 8, 2023 07:02
[ Ultimate Carousel For Divi ] Change navigation button html using wordpress filter
<?php
// Filter to change the ultimate carousel navigation button HTML.
// Add it to your functions.php file of your child theme
add_filter(
'uc_carousel_nav_button_html',
function (
$html,
$nav_type
@wpt00ls
wpt00ls / masonry-image-gallery-hover-title-description.css
Created July 17, 2022 09:41
Show Title and Description On Masonry Image Gallery Item Hover