Skip to content

Instantly share code, notes, and snippets.

View jeshuavegas's full-sized avatar
🎯
Focusing

Jeshua Vega jeshuavegas

🎯
Focusing
View GitHub Profile
@jeshuavegas
jeshuavegas / locked pattern example
Created April 18, 2024 00:38 — forked from annezazu/locked pattern example
A pattern that demonstrates how block locking can work.
function register_block_patterns() {
if ( class_exists( 'WP_Block_Patterns_Registry' ) ) {
$content = '<!-- wp:cover {"dimRatio":70,"customGradient":"linear-gradient(135deg,rgb(255,255,255) 20%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(253,253,253) 80%)","isDark":false,"align":"full","lock":{"remove":false,"move":true}} -->
<div class="wp-block-cover alignfull is-light"><span aria-hidden="true" class="has-background-dim-70 wp-block-cover__gradient-background has-background-dim has-background-gradient" style="background:linear-gradient(135deg,rgb(255,255,255) 20%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(253,253,253) 80%)"></span><div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"center","style":{"typography":{"lineHeight":"1.2"}},"textColor":"grey","lock":{"remove":true,"move":true}} -->
<h2 class="has-text-align-center has-grey-color has-text-color" id="book-your-next-adventure" st
<?php
/*
Plugin Name: RafflePress Invent Your Own
Plugin URI:
Description: Programmatically Add User and Complete Actions in RafflePress
Version:
Author:
Author URI:
License:
License URI:
@jeshuavegas
jeshuavegas / full_list_of_wp_globals.php
Created May 30, 2023 03:45 — forked from kagg-design/full_list_of_wp_globals.php
Full list of WordPress global variables, extracted from WP Coding Standards
<?php
/**
* List of global WP variables.
*
* @since 0.3.0
* @since 0.11.0 Changed visibility from public to protected.
* @since 0.12.0 Renamed from `$globals` to `$wp_globals` to be more descriptive.
* @since 0.12.0 Moved from WordPress_Sniffs_Variables_GlobalVariablesSniff to WordPress_Sniff
*
* @var array
@jeshuavegas
jeshuavegas / wp-custom-post-type-as-submenu-item.php
Created May 19, 2023 06:06 — forked from BODA82/wp-custom-post-type-as-submenu-item.php
Add WordPress custom post type as submenu item of existing admin menu.
<?php
if (! function_exists('gist_register_cpt')) {
/**
* Register Custom Post Type
*/
function gist_register_cpt() {
// Set CPT labels
$labels = array(