Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
This guy is on fire

Jérémy Levron 19h47

🔥
This guy is on fire
View GitHub Profile
View wp-sanitize-title-with-underscores.php
<?php
/**
* Plugin Name: WP Sanitize Title With Underscores
* Plugin URI: https://gist.github.com/19h47/c54fd0e7a5c6fbc99a6087e7606054c0
* Description: Simple wrapper around sanitize_title_with_dashes to replacing dashes with underscores.
* Version: 0.0.0
* Author: Jérémy Levron
* Author URI: https://19h47.fr
*/
@19h47
19h47 / wp-sticky-custom-post-types.php
Last active Aug 10, 2022
WP Sticky Custom Post Types
View wp-sticky-custom-post-types.php
<?php
/**
* Plugin Name: WP Sticky Custom Post Types
* Plugin URI: https://gist.github.com/19h47/c54fd0e7a5c6fbc99a6087e7606054c0
* Description: WP Sticky Custom Post Types is a plugin that enables support for sticky custom post types.
* Version: 0.0.0
* Author: Jérémy Levron
* Author URI: https://19h47.fr
*
* @package WordPress
View wp-insert-image.php
<?php
/**
* Plugin Name: WP Insert Image
* Plugin URI: https://gist.github.com/19h47/f85ab2722676b1f8e2f86cb2451792b6
* Description: WordPress insert image.
* Version: 0.0.0
* Author: Jérémy Levron
* Author URI: https://19h47.fr
*/
@19h47
19h47 / wp-form-controls.php
Last active Sep 17, 2021
WP Form Controls
View wp-form-controls.php
<?php
/**
* Plugin Name: WP Form Controls
* Plugin URI: https://gist.github.com/19h47/5bc7dc96204d7290ce781a54756e0a7b
* Description: WP Form Controls is a plugin that allows to generate form controls in WordPress.
* Version: 3.1.5
* Author: Jérémy Levron
* Author URI: https://19h47.fr
*/
@19h47
19h47 / billing-phone-exists.php
Created Aug 20, 2021
Determines whether the given billing phone exists.
View billing-phone-exists.php
<?php
/**
* Plugin Name: Billing phone exists
* Plugin URI: https://gist.github.com/19h47/
* Description: Determines whether the given billing phone exists.
* Version: 1.0.0
* Author: Jérémy Levron
* Author URI: https://19h47.fr
*/
@19h47
19h47 / exclude-posts-from-feed.php
Last active May 17, 2022
Exclude posts from WordPress feed
View exclude-posts-from-feed.php
<?php // phpcs:ignore
add_action( 'pre_get_posts', 'exclude_posts_from_feed', 10, 1 );
/**
* Exclude posts from feed
*
* Exclude posts from feed based on a boolean metadata (maybe set by an ACF
* field): exclude_from_feed
*
View Settings.php
<?php
/**
* Settings class
*/
/**
* Class Settings
*/
class Settings {
/**
@19h47
19h47 / CONNECT-SSH-IONOS.md
Last active Apr 6, 2019
Connect to IONOS shared hosting with SSH
View CONNECT-SSH-IONOS.md

In your terminal, enter the following command

ssh username@host

Then the terminal ask your password

username@host's password:
@19h47
19h47 / queries.sql
Last active Dec 10, 2019
SQL queries to change domain name on a WordPress site
View queries.sql
# see https://sql.sh/988-requetes-migrer-wordpress
# Change the URL of the site
UPDATE wp_options
SET option_value = replace(option_value, 'http://localhost:8888/site', 'http://www.site.fr')
WHERE option_name = 'home'
OR option_name = 'siteurl';
# Change GUID URL
UPDATE wp_posts
View getMousePositions.js
/**
* Get mouse position
*
* @param obj event
* @return obj { x, y }
* @see from http://www.quirksmode.org/js/events_properties.html#position
*/
export default function getMousePositions(event) {
let positionX = 0;
let positionY = 0;