Skip to content

Instantly share code, notes, and snippets.

View onur-km's full-sized avatar
🏝️
I may be slow to respond.

kmo onur-km

🏝️
I may be slow to respond.
View GitHub Profile
@onur-km
onur-km / wp-extended-search-in-all-meta-data.php
Created August 18, 2020 08:05 — forked from ionurboz/wp-extended-search-in-all-meta-data.php
wp-extended-search-in-all-meta-data.php
<?php
/**
* Extend WordPress search to include custom fields
*
* https://adambalee.com
*/
/**
* Join posts and postmeta tables
*
@onur-km
onur-km / expose_ACF_fields_to_REST.php
Created August 27, 2020 09:14 — forked from MelMacaluso/expose_ACF_fields_to_REST.php
Automatically expose all the ACF fields to the Wordpress REST API in Pages and in your custom post types.
<?php
function create_ACF_meta_in_REST() {
$postypes_to_exclude = ['acf-field-group','acf-field'];
$extra_postypes_to_include = ["page"];
$post_types = array_diff(get_post_types(["_builtin" => false], 'names'),$postypes_to_exclude);
array_push($post_types, $extra_postypes_to_include);
foreach ($post_types as $post_type) {
register_rest_field( $post_type, 'ACF', [
@onur-km
onur-km / vergi_daireleri.sql
Created October 9, 2020 08:07 — forked from ridvanucok/vergi_daireleri.sql
Türkiye Vergi Daireleri Veri Tabanı // Turkey Tax Departments Database
CREATE TABLE `vergi_daireleri` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`plaka` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL,
`il` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`ilce` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`daire` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
INSERT INTO vergi_daireleri (id, plaka, il, ilce, daire) VALUES (1, '01', 'ADANA', 'Merkez', '5 Ocak Vergi Dairesi Müdürlüğü');
@onur-km
onur-km / XHR-request.js
Created April 6, 2021 11:48 — forked from deanhume/XHR-request.js
A simple XHR request
function successListener() {
var data = JSON.parse(this.responseText);
console.log(data);
}
function failureListener(err) {
console.log('Request failed', err);
}
var request = new XMLHttpRequest();