Skip to content

Instantly share code, notes, and snippets.

View ionurboz's full-sized avatar

Onur ionurboz

View GitHub Profile
@ionurboz
ionurboz / sanitize.php
Created September 10, 2022 08:55 — forked from weartstudio/sanitize.php
WordPress: Sanitize elements for WP Customizr. Sanitize functions. Image upload, adsense box, checkbox, text, select
<?php
//sanitize adsense box adsense codes
function weart_sanitize_adsense( $input ) {
esc_js($input);
$input = str_replace(array("\r", "\n"), '', $input);
return $input;
}
//sanitize checkbox
@ionurboz
ionurboz / Wordpress Remove all unnecessary tags from head
Created August 28, 2022 18:48 — forked from coder618/Wordpress Remove all unnecessary tags from head
this pieces of code will remove all unnecessary tags from which generated between <head></head> by WordPress. Use with caution
add_action( 'after_setup_theme', 'prefix_remove_unnecessary_tags' );
function prefix_remove_unnecessary_tags(){
// REMOVE WP EMOJI
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
@ionurboz
ionurboz / docker_wordpress.md
Created August 27, 2022 14:51 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@ionurboz
ionurboz / gh-dl-release
Created July 2, 2022 22:26 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@ionurboz
ionurboz / gh-dl-release
Created July 2, 2022 22:26 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@ionurboz
ionurboz / countries
Created April 1, 2022 14:24 — forked from kalinchernev/countries
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@ionurboz
ionurboz / kinsta-share-users.php
Created March 25, 2022 12:23 — forked from carlodaniele/kinsta-share-users.php
A plugin to share users and usermeta tables between independent WordPress installations. This plugin requires CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE defined into wp-config file
<?php
/**
* @package Kinsta_Share_Users
* @version 1.0
*/
/*
Plugin Name: Kinsta Share Users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin for Kinsta blog readers
Author: Carlo Daniele
<?php
function custom_wc_coupon_validity( $valid, $product, $this, $values ) {
if ( $product->is_on_sale() ) {
return false;
}
return $valid;
}
@ionurboz
ionurboz / boz-❤️-open-source.png
Last active December 13, 2021 16:00
boz ❤️ Open Source
boz-❤️-open-source.png
@ionurboz
ionurboz / wp-routes.php
Created May 25, 2021 07:07 — forked from bradt/wp-routes.php
WordPress Routes
<?php
function bt_register_routes( $routes ) {
foreach ( $routes as $route_name => $args ) {
bt_register_route( $route_name, $args );
}
}
function bt_register_route( $route_name, $args = array() ) {
$args = wp_parse_args( $args, array(
'query_var' => 'route_' . $route_name,