Skip to content

Instantly share code, notes, and snippets.

View ulziibat-n's full-sized avatar
💭
Everyday Hard Working ...

Ulziibat Nansaltsog ulziibat-n

💭
Everyday Hard Working ...
  • Mongolia
View GitHub Profile
@ulziibat-n
ulziibat-n / gist:13e66a99842a57ae79a3b6c6192cfc53
Last active February 18, 2019 02:51
win 10+ deepin + PhoenixOS
menuentry 'Phoenix OS' --class android-x86 {
insmod part_gpt
set root='hd0,3'
search --file --no-floppy --set=root /PhoenixOS/system.img
linux /PhoenixOS/kernel root=/dev/sda3 androidboot.hardware=Android_x86 androidboot.selinux=permissive CMDLINE
initrd /PhoenixOS/initrd.img
}
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@ulziibat-n
ulziibat-n / elementor-controls.code-snippets
Last active September 10, 2019 10:56
Elementor Controls snippets for VS Code
{
"elementor control slider": {
"prefix": [
"elementor",
"control",
"slider"
],
"body": [
"$this->add_control(",
" '${1:value}',",
@ulziibat-n
ulziibat-n / elementor-condition-example.php
Created September 10, 2019 14:01 — forked from Sharifur/elementor-condition-example.php
elementor condition example, elementor multiple condition example
<?php
class Elementor_Custom_Widget extends \Elementor\Widget_Base {
/*=================================
Single condition:-
====================================*/
/*=================================
Credit: Eqbal Rony
original gist: https://github.com/iqbalrony/elementor-conditions/blob/master/conditions.php
====================================*/
// add_filter('show_admin_bar','codingeek_show_admin_bar');
function codingeek_check_user_validation(){
$current_user = wp_get_current_user();
if ( in_array('subscriber', $current_user)) {
//have to write code for subscriber
show_admin_bar( false ); // for hide adminbar
};
@ulziibat-n
ulziibat-n / polylang-elementor-conditions-compatibility.php
Created September 10, 2019 14:12 — forked from nicomollet/polylang-elementor-conditions-compatibility.php
Fix for Elementor template conditions not compatible with polylang (you need to save again one of your templates to make it work, after putting this function in your plugin/theme). Needs to be priority 1
<?php
/**
* Fix for Elementor template conditions not compatible with Polylang (you need to save again one of your templates to make it work, after putting this function in your plugin/theme)
* Needs to be priority 1, since Polylang uses the action parse_query which is fired before pre_get_posts
*
* @link https://github.com/polylang/polylang/issues/152#issuecomment-320602328
*
* @param WP_Query $query
*/
function polylang_elementor_library_conditions_parse_query( $query ) {
@ulziibat-n
ulziibat-n / wpseo-schema-webpage.php
Created September 10, 2019 14:12 — forked from nicomollet/wpseo-schema-webpage.php
Yoast Schema: Remove datePublished on WebPage
<?php
/**
* Yoast Schema: Remove datePublished on WebPage
*
* @param array $schema
*
* @return mixed
*/
function custom_wpseo_schema_webpage( $schema ) {
@ulziibat-n
ulziibat-n / wpseo_schema_organization.php
Created September 10, 2019 14:14 — forked from nicomollet/wpseo_schema_organization.php
Yoast SEO Organization Schema Replaced By LocalBusiness
<?php
/**
* Add LocalBusiness to schema Organization
*
* @api array $data The graph piece to filter.
*
* @return array
*/
function custom_wpseo_schema_organization($data){
@ulziibat-n
ulziibat-n / woocommerce_structured_data_product_brand.php
Created September 10, 2019 14:14 — forked from nicomollet/woocommerce_structured_data_product_brand.php
WooCommerce: Adds Brand attribute to "Product" Structured Data
<?php
/**
* WooCommerce: Adds Brand attribute to "Product" Structured Data
*
* @param array $data
*
* @return array
*/
function woocommerce_structured_data_product_brand ($data) {
global $product;
@ulziibat-n
ulziibat-n / woocommerce-sales-empty-cache.php
Created September 10, 2019 14:14 — forked from nicomollet/woocommerce-sales-empty-cache.php
WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
<?php
/**
* WooCommerce Scheduled Sales: everyday, sales start, cache should be emptied (WP Rocket)
*
* @since 1.0.9
*/
function woocommerce_scheduled_sales_empty_wprocket_cache(){
// Clear WP Rocket Cache (whole site)
if ( function_exists( 'rocket_clean_domain' ) ) {