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 | |
/** | |
* Support for WEBP. | |
* | |
* @package myplugin | |
*/ | |
// Security. | |
if ( ! defined( 'ABSPATH' ) ) { | |
die( 'Sorry, you are not allowed to access this page directly.' ); |
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
Show hidden characters
{ | |
"presets": [ | |
"@babel/preset-env", | |
"@babel/preset-react" | |
] | |
} |
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 | |
/** | |
* Plugin Name: Unminify vendor scripts. | |
*/ | |
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { | |
add_action( 'admin_print_scripts', function () { | |
global $wp_scripts; | |
unminify_execute( [ | |
'react', |
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( 'after_setup_theme', function() { | |
add_theme_support('editor-font-sizes', [ | |
[ | |
'name' => 'Small', | |
'size' => 12, | |
'slug' => 'small' | |
], | |
[ |
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 | |
/* | |
* Plugin Name: MW WP Form Count Limiter | |
* Plugin URI: https://mt8.biz | |
* Description: MW WP Form のフォームごとに送信件数制限を設定できるようにするアドオン | |
* Version: 0.1 | |
* Author: mt8 | |
* Author URI: https://mt8.biz | |
* License: GPLv2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
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 | |
/** | |
* Adds a title attribute to iframe oembeds | |
* | |
* @since 1.0.0 | |
* | |
* @param string $html HTML | |
* @param string $url URL to embed | |
* @param array $attributes HTML Attributes | |
* @param int $post_id Post ID |
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 | |
/** | |
* Play YouTube video inline on iOS. | |
*/ | |
add_filter( 'oembed_dataparse', function ( $return, $data ) { | |
if ( is_object( $data ) && 'YouTube' === $data->provider_name && ! empty( $data->html ) && is_string( $data->html ) ) { | |
$return = preg_replace( '/src="([^"]+)"/', 'src="$1&playsinline=1"', $data->html ); | |
} | |
return $return; |
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
module.exports = { | |
plugins: ['stylelint-order', 'stylelint-scss'], | |
rules: { | |
indentation: 2, | |
'color-hex-case': 'lower', // hex値は小文字指定(大文字を禁止) | |
'color-hex-length': 'short', // hex値は短い表記(冗長な表記は禁止) | |
'color-named': 'never', // 名前付きカラー指定を禁止 | |
'color-no-invalid-hex': true, // 無効な16進数の色指定を禁止 | |
'function-comma-space-after': 'always-single-line', // 単一行のカンマ後には空白が必要 | |
'function-comma-space-before': 'never', // カンマ前の空白を禁止 |
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 | |
/** | |
* Regsiter script | |
*/ | |
add_action( 'wp_enqueue_scripts', function() { | |
// Set dependency to wp-api, which has nonce and endpoint root. | |
wp_enqueue_script( 'api-handler', '/path/to/api-handler.js', [ 'jquery', 'wp-adpi' ], '1.0', true ); | |
} ); |
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
#!/usr/bin/env bash | |
set -eu | |
wp @all core verify-checksums | |
wp @all vackup create | |
wp @all core update | |
wp @all core language update | |
wp @all plugin update --all |
NewerOlder