Skip to content

Instantly share code, notes, and snippets.

@MogulChris
MogulChris / wpsl-export.php
Created March 27, 2022 22:07
Basic csv export for WP Store Locator
<?php
//bootstrap WP
require_once('wp-load.php');//I have this file saved in the site root
$stores = get_posts([
'post_type' => 'wpsl_stores',
'posts_per_page' => -1,
'post_status' => 'any'
]);
@GhanshyamBhava
GhanshyamBhava / TYPO3-Indexed-search.txt
Created January 20, 2021 05:01
Code snippet to add TYPO3 fluid base indexed search for to website header or somewhere in the website according to your preference using typoscript object.
# Fluid Template (Search.html) :
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:form action="search" method="post" action="search" controller="Search" extensionName="indexedsearch" pluginName="pi2" pageUid="5">
<label for="sword">Search: </label>
<f:form.textfield id="sword" name="search[sword]" value="{sword}" class="form-control" />
<f:form.submit name="search[submitButton]" value="Search" />
</f:form>
</html>
# You can use below lib object everywhere in fluid template!
@catalinmiron
catalinmiron / index.js
Created November 24, 2020 07:41
Starter code React Native Parallax carousel
import * as React from 'react';
import {
Animated,
Dimensions,
Image,
FlatList,
Text,
View,
StyleSheet,
} from 'react-native';
@peteleco
peteleco / Create.vue
Last active September 12, 2022 16:25
A simple validation wrapper for inertia.js
<template>
<app-layout>
<template #header>
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
Cadastrar Novo Cliente
</h2>
<breadcrumb slot="breadcrumb" :items="breadcrumbItems"></breadcrumb>
</template>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
@yanknudtskov
yanknudtskov / functions.php
Created June 9, 2020 14:06
Example on how to meta query ACF repeater fields
<?php
add_shortcode( 'user_company_link', 'yanco_user_company_link' );
function yanco_user_company_link() {
if( ! is_user_logged_in() ) {
return;
}
$html = '';
@igorbenic
igorbenic / elementor-widget.php
Last active April 11, 2024 09:12
Ultimate Guide for JavaScript in Elementor Widgets
<?php
/**
* Plugin Name: Elementor Widget
* Text Domain: elementor-widget
* Domain Path: /languages
* Version: 0.1.0
*
* @package Elementor_Widget
*/
@rogeriotaques
rogeriotaques / base64topdf-working.php
Last active October 22, 2024 12:33
Converts base64 string back to a pdf file
<?php
public function uploadFileFromBlobString($base64string = '', $file_name = '', $folder = '')
{
$file_path = "";
$result = 0;
// Convert blob (base64 string) back to PDF
if (!empty($base64string)) {
@cepheiVV
cepheiVV / 00 Flexform Snippets
Last active June 7, 2022 14:19
TYPO3 Flexform Snippets
# ---------------------------------------------- #
# #
# A collection of TYPO3 flexform snippets #
# #
# ---------------------------------------------- #
@oskarijarvelin
oskarijarvelin / cf7-extract-sent-data.php
Last active June 4, 2024 14:37
Contact Form 7 - How to extract sent data?
add_action('wpcf7_mail_sent', 'extract_cf7_data'); /* <- wpcf7_mail_sent is best hook to get values after succesfull submission */
function extract_cf7_data($data) {
if ($data->title == 'FORM-TITLE-HERE') { /* <- Put here title from form which submission you want to extract */
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$cf7_data = $submission->get_posted_data();
$cf7_data['name']; /* <- Contains values from 'name'-field */
$cf7_data['email']; /* <- Contains values from 'email'-field */
$cf7_data['text']; /* <- Contains values from 'text'-field */
}
@Tusko
Tusko / gallery.php
Created March 19, 2018 11:30
Horizontal swiper gallery like masonry