Skip to content

Instantly share code, notes, and snippets.

View grandeto's full-sized avatar

Grandeto grandeto

View GitHub Profile
@grandeto
grandeto / composer.json
Created May 3, 2021 15:28 — forked from mfurlend/composer.json
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {
@grandeto
grandeto / WP_automatically_rename_slug_on_post_save.php
Last active December 17, 2020 13:54 — forked from Jany-M/WP_automatically_rename_slug_on_post_save.php
[WordPress] Automatically rename post slug on post save
<?php
// Change & Save New Permalink if post title was changed
function update_slug_on_edit( $data, $postarr )
{
global $post;
$id = $post->ID;
$status = $post->post_status;
$cpt = get_post_type($id);