Skip to content

Instantly share code, notes, and snippets.

View daniloparrajr's full-sized avatar
🏃‍♂️
Onward to good things!

Danilo Parra Jr daniloparrajr

🏃‍♂️
Onward to good things!
View GitHub Profile
@daniloparrajr
daniloparrajr / acf-field-group-php-to-json.php
Last active January 23, 2024 05:57 — forked from mishterk/acf-field-group-php-to-json.php
Convert an ACF Field Group from PHP to ACF-JSON
<?php
add_action( 'acf/init', function() {
// Get all the local field groups and loop through them for processing.
$field_groups = acf_get_local_field_groups();
foreach ( $field_groups as $group ) {
// If the field group has fields, load them into the 'fields' key.
if ( acf_have_local_fields( $group['key'] ) ) {
$group_fields = acf_get_local_fields( $group['key'] );
@daniloparrajr
daniloparrajr / bpm.html
Created December 1, 2021 13:01
Beats per minute calculator and counter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beats Per Minute Calculator and Counter</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
This file has been truncated, but you can view the full file.
[05-Mar-2021 08:21:18 UTC] Array
(
[group] => 0
[original_size] => 71356
[final_size] => 23693
[element] => DOMElement Object
(
[tagName] => link
[schemaTypeInfo] =>
[nodeName] => link
@daniloparrajr
daniloparrajr / virtualhost.markdown
Last active February 17, 2020 02:29
Creating Virtual Host in XAMPP

Step 1

Open httpd.conf file present in C:\xampp\apache\conf\httpd.conf Remove the #(hash) sign present to include the “httpd-vhosts.conf” file in httpd.conf file.

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

To
composer self-update - To update Composer itself to the latest version.
.gform_wrapper textarea,
.gform_wrapper input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]) {
font-size: 14px;
padding: 7px 10px !important;
letter-spacing: normal;
border: 1px solid #fff;
width: 100%;
font-weight: 600;
}
<?php
/**
* Broadbean Integration Class that handles custom endpoints in adding, updating and deleting job adverts.
*
* @package Divi
*/
/**
* Custom WP ENDPOINT for Broadbean integration
*/
@daniloparrajr
daniloparrajr / functions.php
Last active September 11, 2018 06:58
Custom Wordpress Recent Post
<?php
/**
* Widget API: WP_Widget_Better_Recent_Posts class
*/
/**
* Register and load the widget.
*
* @return void
*/
@daniloparrajr
daniloparrajr / functions.php
Created July 12, 2018 02:02
Filter image src if the attachment parent post is woocommerce product then change its * image src as desired
<?php
/**
* Filter image src if the attachment parent post is woocommerce product then change its
* image src as desired.
*
* @param array|false $image
* @param int $attachment_id
* @param string|array $size
* @param bool $icon
@daniloparrajr
daniloparrajr / functions.php
Created July 10, 2018 06:30
Wordpress Adding Custom Post Type on WP REST API
<?php
/**
* Add WCC contest details into the WP Rest API
*
* @param [class] $object Query Object.
* @return string Contest details.
*/
function get_wcc_contest_details( $object ) {
$wcc_contest_details = get_post_meta( $object['id'], '_wcc_contest_details', true );