Skip to content

Instantly share code, notes, and snippets.

View WebAtelier47's full-sized avatar

Laurent WebAtelier47

  • France - Marmande
View GitHub Profile
@wpeasy
wpeasy / DummyJSON_API.php
Last active January 23, 2025 20:51
Bricks Builder: : Query Loop anything from any API!
<?php
define("WPE_JSON_TRANSIENT_NAME", "wpe_dummyjson");
define("WPE_JSON_TRANSIENT_TTL", 60);
define("WPE_JSON_ENDPOINT_BASE", "https://dummyjson.com/");
/** Add query type to dropdown */
add_filter("bricks/setup/control_options", function ($control_options) {
// Add a new query loop type
$control_options["queryTypes"]["wpe_json"] = esc_html__(
"DummyJSON",
@alexander-young
alexander-young / functions.php
Created January 17, 2022 17:00
WP Basic Cleanup
<?php
// //remove emoji support
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
// // Remove rss feed links
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
@MjHead
MjHead / get-jet-engine-gallery-images.php
Created September 26, 2019 08:37
Example how to get an array of images stored in JetEngine gallery field
@mul14
mul14 / facebook-video-regex
Created December 6, 2015 05:55
Facebook Video URL Regex
http://regexr.com/3cbrm
^http(?:s?):\/\/(?:www\.|web\.|m\.)?facebook\.com\/([A-z0-9\.]+)\/videos(?:\/[0-9A-z].+)?\/(\d+)(?:.+)?$
@itskingori
itskingori / iframe-loader.md
Last active April 11, 2023 06:37
How to add an iframe loader without JavaScript stuffs!
@wpexplorer
wpexplorer / wordpress-remove-post-type-slug
Last active October 7, 2022 01:27
Remove Custom Post Type Slug
<?php
/**
* Remove the slug from published post permalinks for our custom post types.
*/
add_filter( 'post_type_link', function( $post_link, $post, $leavename ) {
$post_types = array(
'post_type_1',
'post_type_2'
);
@bryanwillis
bryanwillis / disable_dash.php
Created December 12, 2013 00:40
Different ways to remove wp dashboard widgets. I think disable_dash.php is considered the best method.
//* REMOVE DASHBOARD WELCOME
remove_action('welcome_panel', 'wp_welcome_panel');
// */
//* REMOVE ADMIN DASHBOARD WIDGETS
// Create the function to use in the action hook
function remove_default_dashboard_widgets() {
@zigotica
zigotica / youtube-poster-frame.css
Last active August 8, 2024 22:50
Very simple method to add custom poster frame to youtube video without using youtube API. This code is also valid in browsers not supporting window.postMessage (API uses postMessage). The trick is adding the iframe in a comment. Javascript reads comment contents and saves iframe definition to a var. When JQuery (for the sake of brevity, not real…
.video { position: relative; padding-bottom: 56.25%; /* 16:9 */ height: 0; }
.video img { position: absolute; display: block; top: 0; left: 0; width: 100%; height: 100%; z-index: 20; cursor: pointer; }
.video:after { content: ""; position: absolute; display: block;
background: url(play-button.png) no-repeat 0 0;
top: 45%; left: 45%; width: 46px; height: 36px; z-index: 30; cursor: pointer; }
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* image poster clicked, player class added using js */
.video.player img { display: none; }
.video.player:after { display: none; }