This file contains hidden or 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 | |
/** | |
* Takes any number of class names or arrays of class names and returns a string of unique class names. | |
* | |
* @param mixed ...$classnames Any number of class names or arrays of class names. | |
* | |
* @return string A string of unique class names. | |
*/ | |
function clsx( ...$classnames ) { | |
$classnames = array_filter( |
This file contains hidden or 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
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
This file contains hidden or 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
RewriteEngine On | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] | |
RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L] |
This file contains hidden or 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
RewriteEngine On | |
RewriteCond %{HTTPS} off [OR] | |
RewriteCond %{HTTP_HOST} ^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] |
This file contains hidden or 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 | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
This file contains hidden or 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 remove_admin_menus() { | |
remove_menu_page( 'index.php' ); // Dashboard | |
remove_menu_page( 'edit.php' ); // Posts | |
remove_menu_page( 'upload.php' ); // Media | |
remove_menu_page( 'edit.php?post_type=page' ); // Pages | |
remove_menu_page( 'edit-comments.php' ); // Comments | |
remove_menu_page( 'themes.php' ); // Appearance | |
remove_menu_page( 'plugins.php' ); // Plugins | |
remove_menu_page( 'users.php' ); // Users |
This file contains hidden or 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 custom_menu_order( $menu_order ) { | |
return array( | |
'index.php', // Dashboard | |
'separator1', // Separator 1 | |
'edit.php', // Posts | |
'upload.php', // Media | |
'edit.php?post_type=page', // Pages | |
'edit-comments.php', // Comments | |
'separator2', // Separator 2 |
This file contains hidden or 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 my_must_login_pages() { | |
if ( is_feed() ) // フィードの時は除外 | |
return; | |
$loginflg = false; // 条件が増えてもいいようにフラグを作っておく。 デフォルトはfalse | |
if ( is_singular( 'works' ) && has_term( 'private', 'category' ) ) { // カスタム投稿タイプ works の個別記事でかつカスタムタクソノミー works_cat で タームが private | |
$loginflg = true; |