This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Extend WordPress search to include custom fields | |
* | |
* https://adambalee.com | |
*/ | |
/** | |
* Join posts and postmeta tables | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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üğü'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function successListener() { | |
var data = JSON.parse(this.responseText); | |
console.log(data); | |
} | |
function failureListener(err) { | |
console.log('Request failed', err); | |
} | |
var request = new XMLHttpRequest(); |