###現状
下記のソースだと、全ての文字が表示されます。
if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } require_once vc_path_dir( 'SHORTCODES_DIR', 'vc-gitem-post-data.php' ); class WPBakeryShortCode_VC_Gitem_Post_title extends WPBakeryShortCode_VC_Gitem_Post_Data { protected function getFileName() { return 'vc_gitem_post_data'; } /** * Get data_source attribute value * * @param array $atts - list of shortcode attributes * * @return string */ public function getDataSource( array $atts ) { $title = 'post_title'; $result = mb_substr ($title, 0, 10, 'UTF-8'); return $result; } }
###やりたいこと
post_titleというテキストが10文字だけ取得されるようにしたい
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/06/23 02:28 編集
退会済みユーザー
2016/06/23 02:44 編集