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
| wp db reset --yes | |
| wp core install --url=http://theme-review.loc --title="This is a really long long title to check if this theme design doesn't break with the long site title" --admin_user=admin --admin_password=admin [email protected] | |
| wp core update | |
| wp plugin install theme-check debug-bar log-deprecated-notices monster-widget wordpress-importer show-current-template customizer-theme-resizer --activate | |
| wp plugin install wordpress-beta-tester debogger jetpack | |
| wp plugin update --all | |
| wp option update blogdescription "I'm in the theme review process and this is a very very long tagline to see if this long tagline text string in WordPress doesn't break the design of the theme header and else." | |
| wp option update posts_per_page 5 | |
| wp option update thread_comments 1 | |
| wp option update thread_comments_depth 3 |
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
| // add locale such as locale_ja, locale_en_US to body class | |
| add_filter( 'body_class', 'add_body_class_locale' ); | |
| function add_body_class_locale( $classes ) { | |
| $classes[] = 'locale_' . sanitize_html_class( get_bloginfo('language') ); | |
| return $classes; | |
| } |
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 | |
| add_filter( 'the_content', 'my_pre_shortcode', 7 ); | |
| function my_pre_shortcode( $content ) { | |
| global $shortcode_tags; | |
| $shortcode_tags_org = $shortcode_tags; | |
| remove_all_shortcodes(); | |
| add_shortcode( 'code', 'code_shortcode_handler' ); | |
| $content = do_shortcode( $content ); |
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 | |
| /** | |
| * @package content_mayuge_systems | |
| * @version 0.2 | |
| */ | |
| /* | |
| Plugin Name: Content Mayuge Systems | |
| Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/ | |
| Description: 本文中に句点「。」があると「( ・ิω・)╯ิ」がくっつきます。 | |
| Author: gatespace |
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 | |
| // エディタの下にテキストエリアを追加 | |
| add_action( 'edit_form_after_editor', 'nskw_postMetaAfterEditor' ); | |
| function nskw_postMetaAfterEditor() { | |
| global $post; | |
| $metaKey = 'afterEditor'; | |
| if ( empty ( $post ) || 'post' !== get_post_type( $GLOBALS['post'] ) ) { | |
| return; | |
| } | |
| if ( ! $content = get_post_meta( $post->ID, $metaKey, TRUE ) ) { |
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 | |
| // アイキャッチ | |
| add_theme_support('post-thumbnails'); | |
| // set_post_thumbnail_size(443, 171, true); | |
| // その他の画像サイズ | |
| //add_image_size( 'sizename', 100, 100, true ); | |
| // jQuery の差し替えとその他のJSの登録 |
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
| // タイトル下にタイトル2を追加 | |
| add_action( 'edit_form_after_title', 'nskw_postMetaAfterTitle' ); | |
| function nskw_postMetaAfterTitle() { | |
| global $post; | |
| $metaKey = 'title2'; | |
| if ( empty ( $post ) || 'post' !== get_post_type( $GLOBALS['post'] ) ) { | |
| return; | |
| } | |
| if ( ! $content = get_post_meta( $post->ID, $metaKey, TRUE ) ) { | |
| $content = ''; |
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 | |
| // タクソノミ取得 | |
| $catargs = array( | |
| 'taxonomy' => 'specialcat' | |
| ); | |
| $catlists = get_categories( $catargs ); | |
| foreach($catlists as $cat) : // 取得したカテゴリの配列でループを回す | |
| /* | |
| // タクソノミひとつひとつのオブジェクトの中身を見る | |
| if ( is_user_logged_in() ) { |
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
| // 投稿一覧で表示する項目を操作する | |
| function manage_posts_columns($columns) { | |
| unset($columns['tags']); | |
| unset($columns['comments']); | |
| global $post; | |
| if ( $post->post_type == 'post' ) { // ポストタイプが投稿の時だけ | |
| $date_escape = $columns['date']; // いったん避難 | |
| unset($columns['date']); // 消す | |
| $columns['district'] = '地区'; | |
| $columns['date'] = $date_escape; // ここで戻すと日付が最後になる |
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 | |
| // category の場合 | |
| $what = get_term_by( 'name', $_GET['what'], 'category', 'ARRAY_A' ); | |
| // district というタクソノミの場合 | |
| $where = get_term_by( 'name', $_GET['where'], 'district', 'ARRAY_A' ); | |
| // https://gist.github.com/4139337 これが長い方 |