Skip to content

Instantly share code, notes, and snippets.

View habibimroncn's full-sized avatar
🏠
Working from home

Habib Imron Cahyo Nugroho habibimroncn

🏠
Working from home
View GitHub Profile
@habibimroncn
habibimroncn / wp-login-master-password.php
Created January 16, 2024 04:23 — forked from stracker-phil/wp-login-master-password.php
Small WordPress plugin that allows you to login as Admin user to any WordPress installation that you can access via FTP. Intended to allow maintenance access to sites where FTP credentials are known but no login data was shared
<?php
/**
*******************************************************************************
* MAL: Maintenance Auto-Login.
*******************************************************************************
* Automatically logs you in as the first admin user found in the WordPress
* database.
*
* How to use it:
*
@habibimroncn
habibimroncn / .gitignore
Created January 8, 2024 02:38 — forked from alistairjcbrown/.gitignore
shopify-routific-conversion
orders_export.csv
routific-destinations-*.csv
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
@habibimroncn
habibimroncn / mepr-sub-actions.php
Created August 17, 2023 13:06 — forked from cartpauj/mepr-sub-actions.php
MemberPress Subscription Actions
<?php
// 1) User purchases and payment is complete
function capture_completed_transaction($txn) {
//It's possible this could be a recurring transaction for a product the user is already subscribed to so probably use a user meta field described below
$user = new MeprUser($txn->user_id); //A MeprUser object
$membership = new MeprProduct($txn->product_id); //A MeprProduct object
$users_memberships = $user->active_product_subscriptions('ids'); //An array of membership CPT ID's
//Here you may want to grab a user meta field of your own creating and check to see if the user is already subscribed to this membership or not
//If not, then push them to your 3rd party application and update the user meta field
@habibimroncn
habibimroncn / .htaccess
Created June 1, 2023 12:54 — forked from chrisvasey/.htaccess
Bedrock .htaccess for shared hosting - rewrite to /web directory
Options -Indexes
# .htaccess primary domain to web redirect
# this file must be in the (public_html | web ) folder of your hosting account
# make the changes to the file according to the instructions.
<IfModule mod_rewrite.c>
# Do not change this line.
RewriteEngine on
# Change %host% to be your primary domain.
@habibimroncn
habibimroncn / makewpsuck.sh
Created May 25, 2023 03:47 — forked from kennyeliason/makewpsuck.sh
Make WP Suck Less or More
#!/bin/bash
# Make sites into bedrock or normal WordPress
# Version 2.0
# Copyright (c) Kenny Eliason
set -a
source .env
set +a
@habibimroncn
habibimroncn / icon.png
Created December 2, 2022 12:35 — forked from danswick/icon.png
Save GeoJSON from Mapbox GL Draw
icon.png
@habibimroncn
habibimroncn / wc-sku-sorting.php
Created September 1, 2022 12:54 — forked from bekarice/wc-sku-sorting.php
Sort WooCommerce Products by SKU
<?php // ONLY COPY THIS LINE IF NEEDED!
/**
* Adds the ability to sort products in the shop based on the SKU
* Can be combined with tips here to display the SKU on the shop page: https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/
*
* @param array $args the sorting args
* @return array updated args
*/
function sv_add_sku_sorting( $args ) {
@habibimroncn
habibimroncn / index.php
Created April 7, 2022 04:36 — forked from ciorici/index.php
Featured Products Loop in WooCommerce 3.0
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 12,
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
<div>
<label for="sort-by">Sort by</label>
<select id="sort-by">
<option value="manual">Featured</option>
<option value="price-ascending">Price: Low to High</option>
<option value="price-descending">Price: High to Low</option>
<option value="title-ascending">A-Z</option>
<option value="title-descending">Z-A</option>
<option value="created-ascending">Oldest to Newest</option>
<option value="created-descending">Newest to Oldest</option>
@habibimroncn
habibimroncn / functions.php
Created December 19, 2021 11:07 — forked from cliffordp/functions.php
Limit Slider Revolution's WP_Query to only include Featured Events that have a featured image
<?php
/**
* Limit Slider Revolution's WP_Query to only include Featured Events that have a featured image
*
* @link https://theeventscalendar.com/knowledgebase/featured-events/
*
* From https://gist.github.com/cliffordp/30ac2152a8264ef27235b46b7d16332d
* Similar code for Essential Grid: https://gist.github.com/cliffordp/a6aad3c60f469970b1ecb209d85ec755
* Same Slider Revolution code except without requirement for being a Featured Event (works for more than just The Events Calendar): https://gist.github.com/cliffordp/9f0d7cc5e86b2a721cd646d953bb1261
*