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 save_image( $base64_img, $title ) { | |
require_once( ABSPATH . 'wp-admin/includes/image.php' ); | |
// Upload dir. | |
$upload_dir = wp_upload_dir(); | |
$upload_path = str_replace( '/', DIRECTORY_SEPARATOR, $upload_dir['path'] ) . DIRECTORY_SEPARATOR; | |
$img = str_replace( 'data:image/png;base64,', '', $base64_img ); | |
$img = str_replace( ' ', '+', $img ); | |
$decoded = base64_decode( $img ); |
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 | |
function create_posttype() { | |
register_post_type( 'movies', | |
// CPT Options | |
array( | |
'labels' => array( | |
'name' => __( 'Movies' ), | |
'singular_name' => __( 'Movie' ) | |
), |
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
import csv | |
import json | |
# Function to convert a CSV to JSON | |
# Takes the file paths as arguments | |
def make_json(csvFilePath, jsonFilePath): | |
# create a dictionary | |
data = {} |
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 | |
/** | |
* Plugin Name: Run Action User | |
* Description: | |
* Version: 1.0 | |
* Copyright: 2022 | |
* Text Domain: run-action-user | |
* Domain Path: /languages | |
*/ |
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
add_action( 'woocommerce_order_status_split-order', 'bbloomer_status_custom_notificationa', 20, 2 ); | |
function bbloomer_status_custom_notificationa( $order_id, $order ) { | |
$mailer = WC()->mailer()->get_emails(); | |
$mailer['wc_order_status_email_107387']->trigger( $order_id ); | |
} |
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 | |
$product = new WC_Product( 5 ); | |
$product->set_price( 10 ); | |
$product->set_stock_quantity(3 ); | |
$product->save(); |
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
#for create | |
schtasks /create /tn "XamppCron" /tr "D:\xampp\php\php.exe D:\xampp\htdocs\cron.php" /sc minute /mo 1 | |
#for delete | |
schtasks /delete /tn "XamppCron" | |
#for status check | |
schtasks /Query /TN "XamppCron" |
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
index.php?fc=module&module=MODULE_NAME&controller=CONTROLLER_NAME |
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
$product = new Product(3); | |
$product->price = 30; | |
$product->save(); |
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
$combination = new Combination(20);//id_product_attribute add there | |
$combination->price = (float)20; | |
$combination->save(); |
OlderNewer