Skip to content

Instantly share code, notes, and snippets.

View juanmaguitar's full-sized avatar

JuanMa juanmaguitar

View GitHub Profile
const { getBlockTypes, getBlockVariations } = wp.data.select('core/blocks');
getBlockTypes()
.filter(({ name }) => getBlockVariations(name).length)
.map(({ name }) => ({ [name]: getBlockVariations(name) }));
wp.data
.select('core/blocks')
.getBlockTypes()
.filter(({ name }) => !name.includes('core/'));
⬢  wp shell

wp> foreach ( wp_get_abilities() as $a ) echo $a->get_name() . "\n";

  core/get-site-info
  core/get-environment-info
  site/site-info
  list-all-urls/urls
// Helper: wait for all records of a given post type.
const getTypes = async ( types ) => {
return await Promise.all(
types.map(
( type ) =>
new Promise( ( resolve ) => {
const unsub = wp.data.subscribe( () => {
const items = wp.data
.select( 'core' )
.getEntityRecords( 'postType', type );
@juanmaguitar
juanmaguitar / ai-wordpress-october-2025.md
Last active October 13, 2025 15:32
State of Artificial Intelligence Integration in WordPress (October 2025)
@juanmaguitar
juanmaguitar / ai-wp-october-2025.md
Last active October 13, 2025 16:46
Estado de la Integración de la Inteligencia Artificial en WordPress (Octubre 2025)
@juanmaguitar
juanmaguitar / preply-lessons-2025.md
Last active October 6, 2025 11:09
Preply Lessons Notes 2025

2025

🗓️ Monday, 6 October 2025 at 08:30

💬 Vocabulary / Expressions

“Further” — means more or to a greater degree. It’s often used in more formal English.

  • Distance: “This is further away than that.” → Describes something that’s at a greater physical distance.
  • Degree or detail: “Let’s discuss this in further detail.” → Means in more depth or more precisely.
@juanmaguitar
juanmaguitar / index.js
Created August 7, 2024 06:19
MIddleware to log actions gutenberg stores - packages/data/src/redux-store/index.js
// #region loggerMiddleware
const loggerMiddleware = ( optionsLogger ) => ( store ) => ( next ) => {
const actions = [];
return ( action ) => {
const { whatToLog, storeName, storesToLog } = optionsLogger;
if ( storesToLog.includes( storeName ) ) {
if ( whatToLog.includes( 'action' ) ) {
console.log( { storeName, ...action } );
}
if ( whatToLog.includes( 'prevState' ) ) {