Skip to content

Instantly share code, notes, and snippets.

@flyingwebie
flyingwebie / WSForm_fws_pull_metabox_data.php
Last active August 1, 2024 13:24
WSForm: Pull data from MetaBox Settings data and populate Select or Checkbox
<?php
// Creation Websites
// Add filter to change form '2' for Web Design prior to rendering
add_filter("wsf_pre_render_2", "fws_create_websites", 10, 1); // <=== CHANGE THE FUNCTION NAME
function fws_create_websites($form) {
// Get MetaBox Custom Fields - Setting Page -- Master Pricing
$setting_page = "master-pricing";
$field_name = "creation_services"; // <=== CHANGE ME WITH THE RIGHT CUSTOM FIELD ID (METABOX)
@interactiveRob
interactiveRob / GravityFormTracker.js
Created June 3, 2022 18:28
ES6 Gravity Forms GTM Custom Event
import { exists } from '@/helpers/utilities';
export let mixin = ({ node = null, config = {} } = {}) => {
if (!node) return false;
let state = {
node,
config,
};
<?php
public function delete_thumbnails( $args, $assoc_args ) {
global $wpdb;
if ( isset( $assoc_args['dry-run'] ) && 'false' === $assoc_args['dry-run'] ) {
$dry_run = false;
} else {
$dry_run = true;
WP_CLI::line( '!!! Doing a dry-run, no thumbnails will be deleted.' );
}
@interactiveRob
interactiveRob / echo-enqueued-styles-scripts-wordpress.php
Created March 28, 2022 17:57 — forked from omurphy27/echo-enqueued-styles-scripts-wordpress.php
Wordpress - Print Out All Enqueued Scripts And Styles On A Page
<?php
// add the below to your functions file
// then visit the page that you want to see
// the enqueued scripts and stylesheets for
function se_inspect_styles() {
global $wp_styles;
echo "<h2>Enqueued CSS Stylesheets</h2><div>";
foreach( $wp_styles->queue as $handle ) :
/**
* Proxy for the `wp` object, with fallback
* to experimental names and error throwing
* when accessing a non-existent item (intended
* for debugging purposes).
*/
export default new Proxy( {}, {
get( cache, moduleName, reciever ) {
if ( typeof cache[ moduleName ] === 'undefined' ) {
if ( typeof wp[ moduleName ] === 'undefined' ) {
@19h47
19h47 / wp-sticky-custom-post-types.php
Last active March 4, 2025 15:22
WP Sticky Custom Post Types
<?php
/**
* Plugin Name: WP Sticky Custom Post Types
* Plugin URI: https://gist.github.com/19h47/c54fd0e7a5c6fbc99a6087e7606054c0
* Description: WP Sticky Custom Post Types is a plugin that enables support for sticky custom post types.
* Version: 0.0.1
* Author: Jérémy Levron
* Author URI: https://19h47.fr
*
* @package WordPress
@damiencarbery
damiencarbery / acf-date-time-picker-start-end-date-twinned-norwegian.php
Last active January 14, 2023 20:55
ACF Date Time Picker – set end date to after start date - With two related Date Time Picker fields limit the end date to be after the start date. https://www.damiencarbery.com/2021/10/acf-date-time-picker-set-end-date-to-after-start-date/
<?php
/*
Plugin Name: ACF Date Time Picker - set end date to after start date
Plugin URI: https://www.damiencarbery.com/2021/10/acf-date-time-picker-set-end-date-to-after-start-date/
Description: With two related Date Time Picker fields limit the end date to be after the start date.
Author: Damien Carbery
Version: 0.3
*/
@dkjensen
dkjensen / filters.php
Last active March 15, 2025 10:58
WordPress Gutenberg Query Loop View More AJAX
<?php
/**
* Add data attributes to the query block to describe the block query.
*
* @param string $block_content Default query content.
* @param array $block Parsed block.
* @return string
*/
function query_render_block( $block_content, $block ) {
global $wp_query;
@mkkeck
mkkeck / class-editor-social-link.php
Last active October 15, 2024 13:41
Patched WordPress block `core/social-link` to allow theme developers to register own social services
@mithicher
mithicher / card-weather-forecast.blade.php
Created September 8, 2021 10:56
Weather Forecast Card Blade Component
// Usage
// <x-card-weather-forecast location="Guwahati" api-key="your-weatherapi.com-api-key" />
@props([
"location" => "Guwahati",
"apiKey" => "",
"poll" => 10000
])
<div class="bg-white shadow rounded-lg p-5 dark:bg-gray-800 max-w-full"