Skip to content

Instantly share code, notes, and snippets.

View olatechpro's full-sized avatar

Olawale Adesina olatechpro

View GitHub Profile
add_filter('publishpress_calendar_get_post_type_fields', function ($fields, $postType) {
// Output all form fields in debug log to see their current structure, and names
error_log(print_r($postType, true));
error_log(print_r($fields, true));
// let set default title value
$fields['title']['value'] = 'Default title text here';
// let set default content value
$fields['content']['value'] = 'Default content here';
// let set default post status value
@olatechpro
olatechpro / Paypal.js
Created April 1, 2024 04:22 — forked from schube/Paypal.js
Paypal Buttons SDK with Customer Data
<!DOCTYPE html>
<head>
<!-- Add meta tags for mobile and IE -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
@olatechpro
olatechpro / algolia-wpml.php
Last active March 20, 2024 15:15 — forked from richaber/README.md
Integrate WPML and WP Search with Algolia, customize labels in autocomplete.php per language
<?php
/**
* @wordpress-plugin
* Plugin Name: My Custom Algolia WPML Integrations.
* Description: My own customizations for Algolia and WPML.
* Version: 1.0.0
* Author: My Name
* License: GNU General Public License v2.0 / MIT License
*/
@olatechpro
olatechpro / php-block.js
Created July 10, 2021 18:18 — forked from pento/php-block.js
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.