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 | |
global $WP_SiteManager; | |
if (is_object($WP_SiteManager) && isset($WP_SiteManager->instance->meta_manager)) { | |
$meta_manager = $WP_SiteManager->instance->meta_manager; | |
remove_action( 'wp_head', array( $meta_manager, 'output_meta' ), 0 ); | |
} |
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 | |
/* | |
Plugin Name: Force comments and pingback close | |
Author: Takuro Hishikawa | |
Version: 0.1 | |
*/ | |
add_filter('comments_open', '__return_false'); | |
add_filter('pings_open', '__return_false'); |
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 | |
/* | |
Plugin Name: My AdSense | |
Description: adsense表示 | |
Author: Takuro Hishikawa | |
Version: 0.2 | |
Author URI: http://notnil-creative.com/ | |
*/ | |
// add adsbygoogle.js to footer |
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
# パッケージ名 | |
PACKAGE = wp-total-hacks | |
# パッケージのタイプ。plugin または theme | |
PROJECT = plugin | |
# 本家 (url) より入手してインストールしておいたもの | |
MAKEPOT = $(HOME)/wordpress-i18n-tools/makepot.php | |
PHP = /usr/bin/php | |
MSGMERGE = /usr/bin/msgmerge |
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
/* The Grid ---------------------- */ | |
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row.large-collapse .column, | |
.lt-ie9 .row.large-collapse .columns { padding: 0; } | |
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
.lt-ie9 .row .row.large-collapse { margin: 0; } | |
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
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( 'wp_footer', 'pm_trace_included_files' ); | |
function pm_trace_included_files() { | |
$includeds = array_values( | |
str_replace( | |
get_theme_root() | |
, "" | |
, array_filter( | |
get_included_files() | |
, create_function( '$f', 'return 0 === strpos( $f, get_theme_root() );' ) |
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 attachment_link_convert($content){ | |
global $wpdb; | |
$upload_dir = wp_upload_dir(); | |
$pattern = '#(<a [^>]*href=[\'"])('.preg_quote($upload_dir['baseurl']).'/)([^\'"]*)([\'"][^>]*><img [^>]*></a>)#uism'; | |
if ( preg_match_all($pattern, $content, $matches, PREG_SET_ORDER) ) { | |
foreach ( $matches as $match ) { | |
$attachment_id = $wpdb->get_var($wpdb->prepare(" | |
select p.ID | |
from {$wpdb->posts} as p |
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
-- カテゴリー 4 の投稿を、カスタム投稿タイプ photo に | |
update wp_posts | |
set post_type = 'photo' | |
where post_type = 'post' | |
and exists | |
(select object_id | |
from wp_term_taxonomy as t | |
inner join wp_relationships as r on t.term_taxonomy_id = r.term_taxonomy_id | |
where t.term_id = 4 | |
and r.object_id = wp_posts.ID); |
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 thumbnail_noimage($html, $post_id, $post_thumbnail_id, $size, $attr) { | |
if (!empty($html)) | |
return $html; | |
$post_thumbnail_id = 1234; // default thumbnail image id | |
$html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); | |
return $html; | |
} |
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 | |
new disable_attachment_page(); | |
class disable_attachment_page { | |
function __construct() | |
{ | |
add_action("template_redirect", array(&$this, "template_redirect")); | |
add_action("admin_print_styles", array(&$this, "admin_print_styles")); |
NewerOlder