Skip to content

Instantly share code, notes, and snippets.

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

Mira LeMiira

🏠
Working from home
View GitHub Profile
import { Component, ChangeDetectorRef } from '@angular/core';
import { Platform, AlertController } from '@ionic/angular';
import { InAppPurchase2, IAPProduct } from '@ionic-native/in-app-purchase-2/ngx';
const PRODUCT_GEMS_KEY = 'devgems100';
const PRODUCT_PRO_KEY = 'devpro';
@Component({
selector: 'app-home',
@LeMiira
LeMiira / capacitor commands.txt
Last active February 20, 2024 13:48
capicator commands
vue build
npx cap sync
npx cap update
npx cap open android
npm install -g cordova-res
cordova-res android --skip-config --copy
<?php
/**
* Order product collections by stock status, instock products first.
*/
class iWC_Orderby_Stock_Status
{
public function __construct()
{
@LeMiira
LeMiira / order-by.php
Created October 23, 2021 13:54
elementor-custom-order.php
add_action( 'elementor/query/eserlerQuery', function( $query ) {
$query->set('tax_query', $taxquery);
$postsID=get_post_meta(get_the_ID(),'karma_eserler');
$postIdArray=$postsID[0];
$postIdArray=((!isset($postIdArray) || empty($postIdArray)) ? array(-1) : $postIdArray);
@LeMiira
LeMiira / user-role-body-class.php
Created October 7, 2021 04:13
add user role and login state to body class wordpress
add_filter('body_class','add_role_to_body');
function add_role_to_body($classes) {
$current_user = new WP_User(get_current_user_id());
$user_role = array_shift($current_user->roles);
$classes[] = 'role-'. $user_role;
$classes[] = !is_user_logged_in() ? 'not-logged-in' : '' ;
return $classes;
}
@LeMiira
LeMiira / Convert Custom Taxonomy to Custom Post Type
Created August 20, 2021 12:21 — forked from Strap1/Convert Custom Taxonomy to Custom Post Type
A very hacky and quick way to transfer a Custom Taxonomy to Custom Post Type and transfer associated metadata to Custom Meta Fields. Note: You can use this if it fits your needs, but it is custom to my set up. Use in a testing environment. It's a plugin with no interface, runs on activation and depending on the amount of data, may hit PHP timeou…
<?php
/*
Plugin Name: Convert Custom Taxonomy to Custom Post Type
Plugin URI: N/A
Description: A plugin to convert a Custom Taxonomy to a Custom Post Type and transfer associated metadata.
Version: 0.1
Author: Strap1
Author URI: http:/www.hiphopinenglish.com
/** Convert Taxonomy '%name%' to CPT '%name%' **/
@LeMiira
LeMiira / rest-api-custom.php
Created August 16, 2021 10:16
Customize rest API Wordpress
<?php
add_action(
'rest_api_init',
function () {
register_rest_route('emin', '/city', array(
'methods' => 'GET',
@LeMiira
LeMiira / woocommerce-select2-selectwoo-remove
Last active July 16, 2021 09:36 — forked from ontiuk/woocommerce-select2-selectwoo-remove
Woocommerce Remove Select2 / SelectWoo
// Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting
/**
* Remove Woocommerce Select2 - Woocommerce 3.2.1+
*/
function woo_dequeue_select2() {
if ( class_exists( 'woocommerce' ) ) {
wp_dequeue_style( 'select2' );
wp_deregister_style( 'select2' );
@LeMiira
LeMiira / sidebar-cart.js
Created July 13, 2021 14:24
woocommerce sidebar cart opener JS
jQuery('.xoo-wsc-modal , body, html').toggleClass('xoo-wsc-active');
//elementor cart replacer
jQuery('#elementor-menu-cart__toggle_button').on('click',function(e){
e.preventDefault();
e.stopImmediatePropagation();
jQuery('.xoo-wsc-modal , body, html').toggleClass('xoo-wsc-active');
});