Skip to content

Instantly share code, notes, and snippets.

View pierre-dekode's full-sized avatar
🚀

Pierre Saïkali pierre-dekode

🚀
View GitHub Profile
array (
'^wp-json/?$' => 'index.php?rest_route=/',
'^wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]',
'^index.php/wp-json/?$' => 'index.php?rest_route=/',
'^index.php/wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]',
'^wp-sitemap\\.xml$' => 'index.php?sitemap=index',
'^wp-sitemap\\.xsl$' => 'index.php?sitemap-stylesheet=sitemap',
'^wp-sitemap-index\\.xsl$' => 'index.php?sitemap-stylesheet=index',
'^wp-sitemap-([a-z]+?)-([a-z\\d_-]+?)-(\\d+?)\\.xml$' => 'index.php?sitemap=$matches[1]&sitemap-subtype=$matches[2]&paged=$matches[3]',
'^wp-sitemap-([a-z]+?)-(\\d+?)\\.xml$' => 'index.php?sitemap=$matches[1]&paged=$matches[2]',
<?php
declare( strict_types=1 );
function wporg_register_my_custom_post_type() : void {
register_post_type( 'my_custom_post_type', [
'label' => __( 'My Post Type', 'wporg' ),
'labels' => [ 'name' => _x( 'My custom post type', 'Post Type General Name', 'wporg' ) ],
'supports' => [ 'title', 'editor' ],
'hierarchical' => true,
/* eslint-disable import/no-extraneous-dependencies, @wordpress/dependency-group */
/**
* External dependencies
*/
const { sync: globSync } = require('fast-glob');
const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const RemoveEmptyScriptsPlugin = require('webpack-remove-empty-scripts');