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
/** | |
* Get All orders IDs for a given product ID. | |
* | |
* @param integer $product_id (required) | |
* @param array $order_status (optional) Default is 'wc-completed' | |
* | |
* @return array | |
*/ | |
public function getOrderIdsByProductId($product_id, $order_status = ['wc-completed', 'wc-processing']) { | |
global $wpdb; |
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 woo_scripts_cleaner() { | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); | |
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { | |
$woo_styles = [ | |
'woocommerce_frontend_styles', | |
'woocommerce-general', | |
'woocommerce-layout', | |
'woocommerce-smallscreen', | |
'woocommerce_fancybox_styles', | |
'woocommerce_chosen_styles', |
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
/* | |
📝 Remove "For Development Only" Watermark on GOOGLE MAP 😁 | |
👤 SCRIPT BY AmirhpCom ( https://amirhp.com/) 👑 | |
➕ Add this code on your project and edit langID,mapCanvas variables | |
*/ | |
var langID = "en-US", mapCanvas = "#map-canvas", $ = jQuery; | |
setInterval(function () {googlemap_remap();}, 10); | |
function googlemap_remap() { | |
$(`${mapCanvas}>div:last-of-type`).hide(); //hide top message says this is for dev only | |
var gimg = $(`img[src*="maps.googleapis.com/maps/vt?"]:not(.gmf)`); |
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 | |
/** | |
* Iran's province and city php class | |
* @author Amin Rasouli <amin@rasouli.me> | |
* @version 1.0 | |
*/ | |
class City | |
{ |
Flywheel Local has XDebug installed by default if you choose “Custom” instead of “Preferred” when setting up a new local environment. If you don’t know which your current site is running, you can detect it by going to ”Site Setup” tab. If you can change the PHP version there, you have the “Custom” environment running. If not, just export your site, import it back and choose “Custom”.
Now that we have the right environment, remember what PHP version you are running, open the right PHP settings file (for example /Local Sites/my_site/conf/php/7.0.3/php.ini
) and add these lines in the [Xdebug]
section:
xdebug.remote_enable=1
xdebug.remote_autostart=1
Save the php.ini and restart your site container in Flywheel to apply new settings.
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
// FTP access parameters | |
$host = 'xxx'; | |
$usr = 'xxx'; | |
$pwd = 'xxx'; | |
// file to move: | |
// $local_file = 'D:/xampp/htdocs/absen_folder/log_script.txt'; | |
// $local_file = 'D:\xampp\htdocs\absen_folder\log_script.txt'; | |
$local_file = 'cek.txt'; | |
$ftp_path = 'derta.co.id/htdocs/tes_derta/'.date('Y-m-d').'/cek.txt'; |
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 | |
/* | |
This script will allow you to send a custom email from anywhere within wordpress | |
but using the woocommerce template so that your emails look the same. | |
Created by craig@123marbella.com on 27th of July 2017 | |
Put the script below into a function or anywhere you want to send a custom email | |
*/ |
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 | |
$args = array( | |
'label' => '', // Text in Label | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, retrieved from post meta where id is the meta_key | |
'id' => '', // required | |
'name' => '', //name will set from id if empty |
NewerOlder