Skip to content

Instantly share code, notes, and snippets.

View pixelbart's full-sized avatar
👋
Hi

Kevin Pliester pixelbart

👋
Hi
View GitHub Profile

aspe:keyoxide.org:OPFUKQOYFMHX7ZQJY2IYTIR62Y

@pixelbart
pixelbart / style.css
Last active December 12, 2023 08:46
MainWP CSS Fixes
.mainwp-widget .label {
font-size: 0.8rem !important;
white-space: nowrap;
}
.mainwp-widget .value {
font-size: 1.5rem !important;
}
@pixelbart
pixelbart / error-reporting.php
Created October 24, 2023 21:38
Must-use WordPress plugin to suppress PHP 8+ error reporting for warnings and deprecations
<?php
if (!function_exists('untrailingslashit') || !defined('WP_PLUGIN_DIR')) {
exit;
}
if (defined('WP_DEBUG') && WP_DEBUG === true) {
error_reporting(E_ALL & ~E_WARNING & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_NOTICE);
}
@pixelbart
pixelbart / readme.md
Last active October 13, 2023 19:38
Must-Use Plugin for Instant Admin Account Creation in WordPress

Essential Must-Use Plugin for Instant Admin Account Creation in WordPress

Activate this crucial plugin to effortlessly generate an administrator account in WordPress through a targeted GET parameter request to your primary domain.

To establish an admin account, just visit domain.com?create_hidden_admin_account.

Ensure you place the file inside the /wp-content/mu-plugins/ directory to guarantee continuous activation of the plugin.

@pixelbart
pixelbart / functions.php
Created July 27, 2023 14:52 — forked from InpsydeNiklas/functions.php
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 );
@pixelbart
pixelbart / local.json
Created March 3, 2022 10:46
Date Range Picker German
{
format: "DD.MM.YYYY",
separator: " - ",
applyLabel: "Speichern",
cancelLabel: "Abbrechen",
fromLabel: "Von",
toLabel: "Bis",
customRangeLabel: "Eigene Auswahl",
weekLabel: "W",
daysOfWeek: [
@pixelbart
pixelbart / subreddits.js
Created May 18, 2016 11:00
Show an random image from a subreddit
// Place in your body:
// <div id="image"></div>
$(document).ready( function() {
var subreddit = 'VillagePorn'; // Your Subreddit without /r/
var aRandomNum = Math.floor((Math.random() * 25) + 1); // A random number - range 25
$.getJSON('http://www.reddit.com/r/'+subreddit+'.json?jsonp=?&show=all&limit=25', function(data) {
$.each(data.data.children, function(i,item){
@pixelbart
pixelbart / functions.php
Last active July 28, 2021 15:19
WooCommerce REST API: Random sorting for products and other post types.
<?php // functions.php
/**
* rest_{post_type}_collection_params
*
* @param array $params
* @return array
*/
add_filter( 'rest_product_collection_params', function ( $params ) {
$params['orderby']['enum'][] = 'rand';
@pixelbart
pixelbart / functions.php
Created March 22, 2021 23:11
Disable Helpful in a specific term of a taxonomy
<?php
/**
* Disable helpful on new posts with specific term of taxonomy.
*
* @param int $post_id
* @param WP_Post $post
* @param bool $update
*
* @return void
@pixelbart
pixelbart / functions.php
Created August 27, 2020 13:36
Enables you to enter votes for the Helpful WordPress Plugin. The votes count as real votes!
<?php // functions.php
/**
* Start Value
*/
$amount = 300;
/**
* Helpful Post Types set in the Helpful settings.
*/