// edit.js
import { __ } from '@wordpress/i18n';
import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
import { TextControl, TextareaControl, PanelBody, ToggleControl } from '@wordpress/components';
import { useState, useEffect } from '@wordpress/element';
import './editor.scss';
export default function Edit({ attributes, setAttributes }) {
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
workflows: | |
version: 2 | |
build_and_test: | |
jobs: | |
- test_code: | |
filters: | |
branches: | |
only: /(feature|bugfix|hotfix)\/?(.*)/ | |
- build_assets: | |
filters: |
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
aliases: | |
restore_cache: &restore_cache | |
restore_cache: | |
name: Restore Npm Package Cache | |
keys: | |
- v{{ .Environment.versionCache }}-deps-{{ .Branch }}-{{ checksum "package-lock.json" }}-{{ checksum ".circleci/config.yml" }} | |
install_node_modules: &install_node_modules | |
run: | |
name: Install NPM dependencies |
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
@ECHO OFF | |
php "c:/wp-cli/wp-cli.phar" %* |
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 removeQueryVar = (key, url) => { | |
let rtn = url.split('?')[0] | |
let param | |
let params = [] | |
let queryString = (url.indexOf('?') !== -1) ? url.split('?')[1] : '' | |
if (queryString !== '') { | |
params = queryString.split('&') | |
for (var i = params.length - 1; i >= 0; i -= 1) { | |
param = params[i].split('=')[0] |
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 | |
add_action( 'enqueue_block_assets', 'example_block_assets'); | |
function example_block_assets() { | |
global $post; | |
$has_your_own_blocks = false; | |
if ( ! is_admin() && is_singular() ) { | |
$wp_post = get_post( $post ); |
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 | |
// Example User-Agent: WordPress 5.7.1; http://domain.com | |
$request_user_agent = $_SERVER['HTTP_USER_AGENT'] ?? false; | |
preg_match('/(WordPress\/\d\.\d.\d;)[ ]{1,}(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?((?:[\w-]+\.)+[\w-]+)/', $request_user_agent, $matches); | |
var_dump($matches[3]); // domain.com |
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 | |
git submodule foreach --recursive 'git fetch origin && git checkout master && git reset --hard origin/master' |
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
git add wp-admin/ wp-includes/ xmlrpc.php wp-trackback.php wp-signup.php wp-settings.php wp-mail.php wp-login. | |
php wp-load.php wp-links-opml.php wp-includes/ wp-cron.php wp-config-sample.php wp-comments-post.php wp-blog-header.php wp-activate.php index.p | |
hp |
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 codetot_is_localhost() { | |
return !empty($_SERVER['HTTP_X_CODETOT_HEADER']) && $_SERVER['HTTP_X_CODETOT_HEADER'] === 'development'; | |
} |
NewerOlder