Skip to content

Instantly share code, notes, and snippets.

View akshuvo's full-sized avatar

Akhtarujjaman Shuvo akshuvo

View GitHub Profile
@akshuvo
akshuvo / woorommerce-customfield-and-email.php
Created January 28, 2019 07:44
Add a custom field and email it to below product name
<?php
/**
* Display the custom text field
* @since 1.0.0
*/
function cfwc_create_custom_field() {
$args = array(
'id' => 'custom_text_field_title',
'label' => __( 'Product Name In Thai', 'cfwc' ),
'class' => 'cfwc-custom-field',
@akshuvo
akshuvo / class-wc-query.php
Created May 6, 2019 21:38 — forked from saimonh3/class-wc-query.php
Sort product by popularity with price greater than zero
add_action( 'woocommerce_product_query', function( $qeury ) {
if ( empty( $qeury->query_vars['orderby'] ) || 'popularity' !== $qeury->query_vars['orderby'] ) {
return;
}
add_filter( 'posts_clauses', function( $args ) {
$args['orderby'] = ' CASE wc_product_meta_lookup.min_price WHEN 0 THEN 1
ELSE -1
END ASC, wc_product_meta_lookup.total_sales DESC, wc_product_meta_lookup.product_id DESC
';
@akshuvo
akshuvo / ThzelGetElementSettings.php
Created May 22, 2019 08:32 — forked from danyj/ThzelGetElementSettings.php
Pull any Elementor options outside of Elementor
/**
* @package Thz Framework
* @author Themezly
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
* @websites http://www.themezly.com | http://www.youjoomla.com | http://www.yjsimplegrid.com
*/
class ThzelGetElementSettings {
@akshuvo
akshuvo / Create a post WP REST API with Framework7.js
Created June 1, 2019 15:11
Create a post WP REST API with Framework7
// Create post WP REST API with Framework7
app.request({
url: 'https://example.com/wp-json/wp/v2/posts',
dataType: 'json',
crossDomain: true,
contentType: 'application/json',
data: {
title: 'The title for the object.',
content: 'The content for the object.',
status: 'publish',
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
// Extend jQuery addClass function to accept callback function
var oAddClass = $.fn.addClass;
$.fn.addClass = function () {
for (var i in arguments) {
var arg = arguments[i];
if ( !! (arg && arg.constructor && arg.call && arg.apply)) {
arg();
delete arg;
}
}
@akshuvo
akshuvo / custom-css.php
Created August 4, 2019 18:23 — forked from iqbalrony/custom-css.php
How to add custom css field with elementor free version.
<?php
use Elementor\Controls_Manager;
use Elementor\Element_Base;
use Elementor\Core\Files\CSS\Post;
use Elementor\Core\DynamicTags\Dynamic_CSS;
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
@akshuvo
akshuvo / regular_expression_cheatsheet.md
Created September 3, 2019 04:57 — forked from jonlabelle/regular_expression_cheatsheet.md
Regular Expression Cheatsheet

Regular Expression Cheatsheet

Anchors

^   Matches at the start of string or start of line if multi-line mode is
	enabled. Many regex implementations have multi-line mode enabled by
	default.

$ Matches at the end of string or end of line if multi-line mode is enabled.

To install macOS High Sierra 10.13.5 on a virtual machine using VMware:

  1. If you have not installed VMware Workstation on a Windows operating system before, please refer to the following video.

https://www.youtube.com/watch?v=-Uf9-6SPiMY

  1. After installing VMware Workstation, you need the VMware Unlocker program to create a new virtual machine for the MacOS High Sierra 10.13.5 installation. To download the VMware Unlocker program to your computer, visit the link below.

Article ➦ https://www.sysnettechsolutions.com/en/vmware/download-vmware-unlocker-2-1-1/