",$str); return $str; } //-------------------------------------------------- // 記事のmoreを前と後ろに分ける function get_the_divided_content( $more_link_text = null, $stripteaser = 0, $more_file = '' ) { $regex = '#(

|)#'; $content = get_the_content( $more_link_text, $stripteaser, $more_file ); $content = apply_filters( 'the_content', $content ); $content = str_replace( ']]>', ']]>', $content ); if ( preg_match( $regex, $content ) ) { list( $content_array['before'], $content_array['after'] ) = preg_split( $regex, $content, 2 ); } else { $content_array['before'] = ''; $content_array['after'] = $content; } return $content_array; } //-------------------------------------------------- // ビジュアルエディタ用CSS add_editor_style('editor_style.css'); function custom_editor_settings( $initArray ) { $initArray['body_class'] = 'editor-area'; return $initArray; } add_filter( 'tiny_mce_before_init', 'custom_editor_settings' ); //-------------------------------------------------- //更新順 function newlist_fnc($atts) { require_once locate_template('tmp_newlist.php'); extract ( shortcode_atts ( array ( 'cnt' => '0' ), $atts ) ); @$html = tmp_newlist($cnt); return $html; } add_shortcode('newlist', 'newlist_fnc'); //------------------------------------------- //フォントサイズ% if ( ! function_exists( 'extend_mce_button' ) ) { function extend_mce_button( $buttons ) { array_unshift( $buttons, 'fontsizeselect' ); return $buttons; } } add_filter( 'mce_buttons_2', 'extend_mce_button' ); add_filter( 'tiny_mce_before_init', 'my_mce_before_init',5 ); function my_mce_before_init( $settings ) { $settings['fontsize_formats'] = "100% 125% 150% 175% 200% 250% 300% 400% 500%"; return $settings; } //------------------------------------------- //投稿一覧に商品コード列追加 function manage_posts_columns($columns) { $columns['商品名'] = "商品名"; return $columns; } function add_column($column_name, $post_id) { if( $column_name == '商品名' ) { $stitle = get_post_meta($post_id, '商品名', true); } if ( isset($stitle) && $stitle ) { echo attribute_escape($stitle); } else { echo __('None'); } } add_filter( 'manage_posts_columns', 'manage_posts_columns' ); add_action( 'manage_posts_custom_column', 'add_column', 10, 2 ); ?>