Skip to content

Instantly share code, notes, and snippets.

View javiermarinros's full-sized avatar

Javier Marín javiermarinros

  • ideatic
  • Cartagena, Spain
View GitHub Profile
@javiermarinros
javiermarinros / preload.php
Last active September 12, 2023 00:27
Opcache preload for core WordPress 5.6 classes and functions
<?php
function is_preloaded(): bool
{
return true;
}
// WordPress
define('ABSPATH', __DIR__ . '/');
define('WPINC', 'wp-includes');
@javiermarinros
javiermarinros / create_block.php
Created December 18, 2018 18:08
Easy shortcode and Gutenberg block creation. Shared render function and no JS coding required
<?php
function create_block($namespace, $name, $params, $render_callback)
{
static $config = null;
if (!isset($config) && is_admin()) {
$config = [];
add_action(
@javiermarinros
javiermarinros / feedly_2_pocket
Last active January 29, 2017 15:08
Import all your feedly saved for later into pocket
// Simple script that exports a users "Saved For Later" list out of Feedly
// as a JSON string.
//
// This was intended for use in the Google Chrome's "Inspector" tool so your
// mileage may vary if used in other contexts.
//
// Format of JSON is as follows:
// [
// {
// title: "Title",