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
global $wp_embed; | |
add_filter( 'widget_text', array( $wp_embed, 'run_shortcode' ) ); | |
add_filter( 'widget_text', array( $wp_embed, 'autoembed') ); |
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
if(!function_exists('get_permalink_by_slug')): | |
function get_permalink_by_slug($slug) { | |
global $locale; | |
$permalink = get_permalink(get_page_by_path($slug)); | |
if(function_exists('bogo_get_url_with_lang')) | |
return bogo_get_url_with_lang($permalink, $locale); | |
return $permalink; |
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
add_filter( 'option_blogname', function($blogname) { | |
return __($blogname, 'theme_textdomain'); | |
}); |
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
add_filter( 'option_blogdescription', function($blogdescription){ | |
return __($blogdescription, 'theme_textdomain'); | |
}); |
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
add_filter('admin_memory_limit', function($memory_limit){ | |
return '512M'; | |
}); |
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
add_filter("post_row_actions", function($actions, $post){ | |
if($post->post_status == "publish"){ | |
$num_comments = wp_count_comments($post->ID); | |
$actions['spam'] = sprintf('<a href="%s">' . __('Spam') . '(%s)</a>', sprintf(admin_url('edit-comments.php?comment_status=spam&p=%d'), $post->ID), $num_comments->spam); | |
} | |
return $actions; | |
}, 0, 2); |
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
function lfGetProductsFromProductStatus($name){ | |
$objQuery =& SC_Query_Ex::getSingletonInstance(); | |
$sql = <<< __EOS__ | |
SELECT | |
dtb_products.* | |
FROM dtb_products | |
JOIN dtb_product_status T1 | |
ON T1.product_id = dtb_products.product_id | |
WHERE T1.product_status_id = ( |
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
/** | |
* ポイント使用するかの判定 | |
* | |
* $status が null の場合は false を返す. | |
* | |
* @param integer $status 対応状況 | |
* @return boolean 使用するか(会員テーブルから減算するか) | |
*/ | |
function isUsePoint($status) { | |
if ($status == null) { |
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
wp_embed_register_handler( | |
'qiita', | |
'#http://qiita.com/(.*)/items/([a-z0-9]+)$#i', | |
function($m, $attr, $url, $rawattr){ | |
$url = sprintf("http://qiita.com/api/v2/items/%s", $m[2]); | |
$result = wp_remote_get($url); | |
if ( ! is_wp_error( $result ) && $result['response']['code'] === 200 ) { | |
$data = json_decode($result['body']); | |
return $data->rendered_body; | |
} |
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
wp_embed_register_handler( | |
'twitcasting', | |
'#http://twitcasting.tv/(.*)$#i', | |
function($m, $attr, $url, $rawattr){ | |
$width = 320; | |
$height = 198; | |
return <<< __EOS__ | |
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="{$width}" height="{$height}" id="livestreamer" align="middle"> | |
<param name="allowScriptAccess" value="always" /> | |
<param name="allowFullScreen" value="true" /> |