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 multiple_filter_at_cpt() { | |
global $typenow; | |
$args = array( | |
'public' => true, | |
'_builtin' => true, | |
); | |
$custom_post_types = get_post_types( $args ); | |
$custom_post_types = array_values( $custom_post_types ); |
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 | |
/** | |
* ブロックエディタのoEmbedへcss追加 | |
* wp-content/themes/snow-monkey/vendor/inc2734/wp-oembed-blog-card/src/App/View/View.php | |
* apply_filters( 'inc2734_wp_oembed_blog_card_block_editor_template', $template, $url ); | |
*/ | |
add_filter( | |
'inc2734_wp_oembed_blog_card_block_editor_template', | |
function ( $template, $url ) { | |
$template .= sprintf( |
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 | |
// 実際のページ用の CSS 読み込み | |
add_action( | |
'wp_enqueue_scripts', | |
function() { | |
wp_enqueue_style( | |
'my-snow-monkey', | |
MY_SNOW_MONKEY_URL . '/style.css', | |
[ Framework\Helper::get_main_style_handle() ], | |
filemtime( MY_SNOW_MONKEY_PATH . '/style.css' ) |
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 | |
// addtoany ショートコードを追加 | |
add_filter( | |
'snow_monkey_template_part_render_template-parts/common/page-header', | |
function ( $html, $name, $vars ) { | |
$html .= do_shortcode( '[addtoany]' ); | |
return $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 | |
/** | |
* Embed ブログカードをカスタマイズ | |
* https://snow-monkey.2inc.org/manual/manual-advanced/customize-blog-card/ | |
*/ | |
add_filter( | |
'snow_monkey_oembed_blog_card_template', | |
function( $template, $cache ) { | |
$template = ''; |
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 | |
global $current_user; | |
$user_info_obj = wp_get_current_user(); | |
//var_dump( $user_info_obj ); | |
//var_dump( $user_info_obj->data->user_login ); | |
$spesific_user = $user_info_obj->data->user_login; | |
if ( is_user_logged_in() && $spesific_user === 'xxxxx' ) { | |
var_dump($wp_query->found_posts); | |
} |
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 | |
/** | |
* Get works relational post. | |
* | |
* @return mixed | |
*/ | |
function all_posts_relational_post( $post, $taxonomy, $num, $orderby = 'rand' ) { | |
$post_type = get_post_type( $post ); | |
$post_type_obj = get_post_type_object( $post_type ); |
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
{ | |
"name": "task-runner-for-wordpress-theme", | |
"version": "1.1.0", | |
"description": "new task runner for hibou build themes :)", | |
"scripts": { | |
"lint": "eslint ./js || true", | |
"scss": "node-sass --output-style expanded --indent-type tab --indent-width 2 -o ./ ./sass/style.scss", | |
"autoprefixer": "postcss -u autoprefixer --autoprefixer.browsers '> 5%, ie 9' -r ./style.css", | |
"imagemin": "imagemin ../../../../dist/* -o ./common/img", | |
"icons": "svgo -f ./common/img && mkdir -p ./common/img && svg-sprite-generate -d ../../../../dist/ -o ./common/img/icons.svg", |
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/sh | |
# Check the baggage with the baggage inquiry system of Kuroneko Yamato. :) | |
echo 'Enter the number.' | |
read KURONEKONUM | |
open http://jizen.kuronekoyamato.co.jp/jizen/servlet/crjz.b.NQ0010?id=${KURONEKONUM} |
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/sh | |
# "../Movefil" : Set the path to Movefile in each project. Rewrite it accordingly. | |
# This command needs to be executed in the directory where the WordPress core is located. | |
# --skip-columns=guid | |
# @see https://developer.wordpress.org/cli/commands/search-replace/ | |
wp search-replace $(grep "vhost:" ../Movefile | sed -e s/vhost://g | tr -d '\"\ ' | sed -n 2p) $(grep "vhost:" ../Movefile | sed -e s/vhost://g | tr -d '\"\ ' | sed -n 1p) --skip-columns=guid |
NewerOlder