Skip to content

Instantly share code, notes, and snippets.

View artneo7's full-sized avatar
💭
Learning Svelte 👨‍💻

Andre Esteves Perrone artneo7

💭
Learning Svelte 👨‍💻
View GitHub Profile
@DavidPeralvarez
DavidPeralvarez / core-blocks.txt
Last active September 20, 2022 08:04
Gutenberg core blocks list
// Útil para filtros de Gutenberg como "allowed_block_types"
archives
audio
button
categories
code
column
columns
coverImage
@courtneymyers
courtneymyers / acf_modifications.php
Created February 28, 2018 18:36
Reduces initial height of Advanced Custom Fields WYSIWYG fields to 100px, and enables autoresizing of WYSIWYG field, as text is entered. Best practice would be to include this function in a site-specific plugin.
<?php
/*
* -----------------------------------------------------------------------------
* Advanced Custom Fields Modifications
* -----------------------------------------------------------------------------
*/
function PREFIX_apply_acf_modifications() {
?>
<style>
@igorbenic
igorbenic / desc.php
Last active February 21, 2024 21:32
How to Programmatically Change Yoast SEO Open Graph Meta | http://www.ibenic.com/programmatically-change-yoast-seo-open-graph-meta
<?php
function change_yoast_seo_og_meta() {
add_filter( 'wpseo_opengraph_desc', 'change_desc' );
}
function change_desc( $desc ) {
// This article is actually a landing page for an eBook
if( is_singular( 123 ) ) {
@ollietreend
ollietreend / acf-php-to-json.php
Last active June 5, 2024 17:34
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
@tanmay27vats
tanmay27vats / function.php
Last active April 18, 2024 08:30
Remove "Product Type/Product Data" Dropdown Options - WooCommerce
add_filter( 'product_type_selector', 'remove_product_types' );
function remove_product_types( $types ){
unset( $types['grouped'] );
unset( $types['external'] );
unset( $types['variable'] );
return $types;
}
@mohammad-ahid
mohammad-ahid / style.css
Created January 16, 2017 14:46
CSS hack to hide Chrome default date picker styles
// @see http://stackoverflow.com/questions/11320615/disable-browser-native-datepicker
input::-webkit-calendar-picker-indicator{
display: none;
}
input[type="date"]::-webkit-input-placeholder{
visibility: hidden !important;
}
@RadGH
RadGH / get-video-oembed-wordpress.php
Last active October 3, 2022 01:03
Get oEmbed data using WordPress oEmbed API, specifically for Video iframe
<?php
// Example 1) Using a function. Returns an array.
function radgh_get_video_data( $url, $width = null, $height = null ) {
if ( function_exists('_wp_oembed_get_object') ) {
require_once( ABSPATH . WPINC . '/class-oembed.php' );
}
$args = array();
if ( $width ) $args['width'] = $width;
if ( $height ) $args['height'] = $height;
@ghalusa
ghalusa / youtube_id_regex.php
Created June 20, 2015 23:14
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ