Skip to content

Instantly share code, notes, and snippets.

View bepatrickdavid's full-sized avatar

bepatrickdavid bepatrickdavid

View GitHub Profile
@bepatrickdavid
bepatrickdavid / functions.php
Created January 17, 2022 09:03
Add ACF to WP REST API
// add this to functions.php
//register acf fields to Wordpress API
//https://support.advancedcustomfields.com/forums/topic/json-rest-api-and-acf/
function acf_to_rest_api($response, $post, $request) {
if (!function_exists('get_fields')) return $response;
if (isset($post)) {
$acf = get_fields($post->id);
$response->data['acf'] = $acf;
:root {
--brown: #5b534f;
}
.wpcf7-acceptance .wpcf7-list-item {
margin-left: 0px;
margin-top: 10px;
margin-bottom: 10px;
}
@bepatrickdavid
bepatrickdavid / functions.php
Last active February 15, 2023 08:04
Simple Captcha Login WordPress
//CAPTCHA
// function number to word
function number_to_word($number) {
$words = array(
'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine',
'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen',
'twenty', 30 => 'thirty', 40 => 'forty', 50 => 'fifty', 60 => 'sixty', 70 => 'seventy', 80 => 'eighty', 90 => 'ninety'
);
if(!is_numeric($number)) {