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
/** | |
* 말단 텀 이외에 찍힌 것 제거 | |
* | |
* @param int $post_id | |
* @param string $taxonomy | |
* | |
* @return WP_Term[] | |
*/ | |
function get_mid_terms( int $post_id, string $taxonomy = 'category' ): array { | |
$terms = wp_get_object_terms( $post_id, $taxonomy ); |
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: Race Cond | |
* Plugin URI: https://gist.github.com/chwnam/c441ca20952856ca0e1a9cd0d657fac9 | |
* | |
* @link https://blog.changwoo.pe.kr/option-race-condition/ | |
*/ | |
add_action( 'admin_menu', 'rcond_admin_menu' ); | |
function rcond_admin_menu() { |
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: cpt-study | |
* Description: 커스텀 포스트 스터디 플러그인. 역할, 다시쓰기 등 세부 파라미터를 빠짐없이 디테일하게 정리한 코드. | |
*/ | |
/** | |
* @link https://developer.wordpress.org/reference/functions/register_post_type/ | |
*/ | |
function cpt_study_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
<?php | |
/** | |
* Plugin Name: Blade Test | |
*/ | |
/* | |
# composer.json | |
{ | |
"name": "naran/experimental", | |
"autoload": { |
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: 워드프레스 로그인 스터디 | |
* Description: WordPress Core #3 용 데모 플러그인 | |
*/ | |
function phs_dump_obj( $obj, $title = '' ) { | |
if ( $title ) { | |
echo '<h3>' . esc_html( $title ) . '</h3>'; | |
} |
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: Cron Study | |
* Description: WP 크론 API 동작을 위한 실험 플러그인. | |
*/ | |
register_activation_hook( __FILE__, function () { | |
if ( ! wp_next_scheduled( 'cron-study', [ 'time' => 'Next Thursday' ] ) ) { | |
$time = new DateTime( 'now', wp_timezone() ); | |
$time->setTime( |
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: Always Logged In | |
* Description: Make you logged in, always. | |
* Author: changwoo | |
* Author URI: mailto://[email protected] | |
*/ | |
add_action( 'init', 'ali_init' ); |
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: WordPress Clean Startup | |
* Description: Really clean WordPress Startup. | |
* Author: Changwoo Nam | |
* Author URI: [email protected] | |
* Version: 1.0.0 | |
* License: Public domain | |
* | |
* - 허가되지 않은 모든 플러그인과 테마를 사용하지 않고 코어를 동작시킵니다. |
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 python3 | |
import time | |
from http.cookiejar import Cookie | |
from re import search, findall | |
from urllib.parse import urlencode | |
from urllib.request import ( | |
HTTPCookieProcessor, | |
HTTPRedirectHandler, | |
Request, |
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 | |
function wlan_id() { | |
echo $(rfkill -nr | grep phy | cut -f 1 -d ' ') | |
} | |
function wait_a_moment() { | |
local time=3 | |
echo "약 ${time}초간 대기합니다..." | |
sleep ${time} |