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
// accessing the window and changing the root view controller property | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// getting access to the window object from SceneDelegate | |
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, | |
let sceneDelegate = windowScene.delegate as? SceneDelegate | |
else { | |
return | |
} | |
let viewcontroller = UIViewController() |
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 the data of a block | |
wp.data.select( 'core/block-editor' ).getBlocks()[0] | |
// Update attributes of another block | |
// wp.data.dispatch( 'core/editor' ).updateBlockAttributes( clientID, attributes ) | |
wp.data.dispatch( 'core/block-editor' ).updateBlockAttributes( '10d88a6d-95d6-4e07-8293-5f59c83a26c0', { heading: 'New Heading' } ) | |
// Get currently selected block. | |
wp.data.select( 'core/block-editor' ).getBlockSelectionStart() |
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
const mix = require('laravel-mix'); | |
const url = 'http://lab.tinypixel.test'; | |
const app = './src'; | |
const config = './config'; | |
const resources = './resources'; | |
const assets = './resources/assets'; | |
const dist = './dist'; | |
const externals = { |
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 | |
/** | |
* Register custom rest fields | |
*/ | |
add_action( 'rest_api_init', 'register_custom_fields' ); | |
/** | |
* Register rest fields and endpoint | |
* |
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 | |
if ( isset( $_GET['wc-ajax'] ) && 'get_refreshed_fragments' === $_GET['wc-ajax'] && ( !isset( $_COOKIE['woocommerce_cart_hash'] ) || empty( $_COOKIE['woocommerce_cart_hash'] ) ) && ( !isset( $_COOKIE['woocommerce_items_in_cart'] ) || empty( $_COOKIE['woocommerce_items_in_cart'] ) ) ) { | |
$data = get_transient( 'rocket_get_refreshed_fragments_cache' ); | |
if ( ! empty( $data ) ) { | |
$data = json_decode( $data ); | |
wp_send_json( $data ); | |
} | |
ob_start(); |
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 | |
/** | |
* WooCommerce template overriding class | |
* | |
* @author obiPlabon | |
*/ | |
class WC_Template_Override { | |
/** |
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 | |
/** | |
* Restrict category term relation to only parent-child | |
* | |
* @see https://wpseek.com/hook/post_edit_category_parent_dropdown_args/ | |
* @see https://wpseek.com/hook/taxonomy_parent_dropdown_args// | |
* | |
* @param array $args | |
* @return array Modified arguments | |
*/ |
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 Input from './components/Input.es6'; | |
const { __ } = wp.i18n; | |
const { registerBlockType } = wp.blocks; | |
const el = wp.element.createElement; | |
registerBlockType( 'learn-gutenberg/ex2-react', { | |
title: __( 'Learn Gutenberg Example 2: React', 'learn-gutenberg' ), | |
category: 'widgets', | |
supportHTML: false, |
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( wp ) { | |
var el = wp.element.createElement; | |
var __ = wp.i18n.__; | |
wp.blocks.registerBlockType( 'learn-gutenberg/ex2-vue', { | |
title: __( 'Learn Gutenberg Example 2: VueJS', 'learn-gutenberg' ), | |
category: 'widgets', | |
supportHTML: false, | |
attributes: { | |
who: { |
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
#! /bin/bash | |
# The Purpose of this Script is to batch convert and compress any video file to mp4 format | |
# | |
# WARNING: LOSSY COMPRESSION !!! | |
# Variable used: | |
# sourcedir is the directory where to be converted videos are. Converted video will be saved in the same folder | |
# usage: |
NewerOlder