Skip to content

Instantly share code, notes, and snippets.

View orangerdev's full-sized avatar
🏠
busy mending broken

Ridwan Arifandi orangerdev

🏠
busy mending broken
View GitHub Profile
@orangerdev
orangerdev / caldera-form-data-entry.php
Created August 5, 2021 04:08
Save caldera form entry programmatically
$form_id = 'CF610b605dd7710';
$form = Caldera_Forms_Forms::get_form($form_id);
//Basic entry information
$entry_detail = new Caldera_Forms_Entry_Entry();
$entry_detail->form_id = $form['ID'];
$entry_detail->datestamp = current_time('mysql');
$entry_detail->status = 'pending';
$entry_detail->user_id = get_current_user_id();
@orangerdev
orangerdev / 99.co.json
Created July 30, 2021 12:21
99.co lighthouse
This file has been truncated, but you can view the full file.
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4420.0 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
"benchmarkIndex": 1390,
"credits": {
"axe-core": "4.1.3"
}
@orangerdev
orangerdev / rest.php
Last active February 13, 2019 10:31
REST MVC for WordPress
<?php
namespace QMQUOTE\Admin;
class Rest
{
private $key = 'quoteme'; // change this prefix
private $script = 'quoteme-action'; // change this script action
/**
* Construction
@orangerdev
orangerdev / request.php
Last active January 29, 2019 08:09
Class to create basic controller on request
<?php
namespace YOUR_PLUGIN;
class Request
{
private $url;
/**
* private variable
* make sure that the value of the properity is unique, lowercase, non whitespace and
@orangerdev
orangerdev / wordpress-custom-endpoint.php
Created January 29, 2019 07:37
basic wordpress custom endpoint
<?php
/**
*
* Change 'custom-request' to anything you want
*
* Register custom rules
* Hooked via filter generate_rewrite_rules, priority 999
* @param Object $wp_rewrite
*/
function set_custom_rules($wp_rewrite)
@orangerdev
orangerdev / override-woocommerce-templates.php
Created January 2, 2019 07:41
Function to override woocommerce template with your plugin templates
<?php
/**
* Return with custom template path
* Hooked via filter wc_get_template, priority 100
* @param string $located [description]
* @param string $template_name [description]
* @param string $args [description]
* @param string $template_path [description]
* @param string $default_path [description]
* @return string [description]
@orangerdev
orangerdev / variation-price-label.php
Created June 26, 2018 09:39
Display variation value in variation dropdown (Woocommerce)
<?php
/**
* Plugin Name: WooCommerce - Display Variation Price in Dropdown
* Plugin URI: https://ridwanarifandi.com
* Description: Display price in variation dropdown
* Version: 1.0.0
* Author: Ridwan Arifandi
* Author URI: https://ridwanarifandi
* Text Domain: woocommerce
*
@orangerdev
orangerdev / taxonomy.php
Created May 29, 2018 16:16
Library to register wordpress taxonomy easier
<?php
namespace JBSF\Admin;
class Taxonomy
{
private $label = [];
/**
* Construction
*/
@orangerdev
orangerdev / post-type.php
Last active January 4, 2018 04:57
Wordpress Chained Class to register post type
<?php
namespace sejoli;
Class PostType
{
protected static $labels = [];
protected static $args = [];
protected static $post_type = '';
protected static $valid = true;
protected static $exists = true;
@orangerdev
orangerdev / ridwan-wp-query.php
Last active January 4, 2018 05:33
Remodel WP_Query with chunked posts
<?php
namespace Ridwan;
class WP_Query
{
protected static $chunk = 10;
protected static $args = [];
protected static $posts = [];
protected static $respond = [];