' . get_the_modified_date( __( 'M j, Y @ H:i', 'luxeritas') ) . ''; } else { $stamp = __( 'Modified on:', 'luxeritas' ) . ' ' . __( 'Not updated', 'luxeritas' ) .''; } $date = date_i18n( get_option('date_format') . ' @ ' . get_option('time_format'), strtotime( $post->post_modified ) ); ?>
0 ) { $tab_index_attribute = ' tabindex="' . $tab_index . '"'; } $jj_mod = mysql2date( 'd', $post->post_modified, false ); $mm_mod = mysql2date( 'm', $post->post_modified, false ); $aa_mod = mysql2date( 'Y', $post->post_modified, false ); $hh_mod = mysql2date( 'H', $post->post_modified, false ); $mn_mod = mysql2date( 'i', $post->post_modified, false ); $ss_mod = mysql2date( 's', $post->post_modified, false ); $year = '' . __( 'Year', 'luxeritas' ); $month = '' . __( 'Month', 'luxeritas' ); $day = '' . __( 'Day', 'luxeritas' ); $hour = ''; $minute = ''; printf( '%1$s %2$s %3$s @ %4$s : %5$s', $year, $month, $day, $hour, $minute ); echo ''; echo '' , '' , '' , '' , '' , ''; } endif; if( function_exists( 'thk_create_update_date' ) === false ): function thk_create_update_date( $data, $post_aa_mod, $post_mm_mod, $post_jj_mod, $post_hh_mod, $post_mn_mod, $post_ss_mod ) { $aa_mod = $post_aa_mod <= 0 ? date('Y') : $post_aa_mod; $mm_mod = $post_mm_mod <= 0 ? date('n') : $post_mm_mod; $jj_mod = $post_jj_mod > 31 ? 31 : $post_jj_mod; $jj_mod = $jj_mod <= 0 ? date('j') : $jj_mod; $hh_mod = $post_hh_mod > 23 ? $post_hh_mod -24 : $post_hh_mod; $mn_mod = $post_mn_mod > 59 ? $post_mn_mod -60 : $post_mn_mod; $ss_mod = $post_ss_mod > 59 ? $post_ss_mod -60 : $post_ss_mod; $modified_date = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa_mod, $mm_mod, $jj_mod, $hh_mod, $mn_mod, $ss_mod ); if ( ! wp_checkdate( $mm_mod, $jj_mod, $aa_mod, $modified_date ) ) { unset( $data['post_modified'] ); unset( $data['post_modified_gmt'] ); return $data; } $data['post_modified'] = $modified_date; $data['post_modified_gmt'] = get_gmt_from_date( $modified_date ); return $data; } endif; /* 「修正のみ」は更新しない。それ以外は、それぞれの更新日時に変更する */ add_filter( 'wp_insert_post_data', function( $data, $postarr ) { $mydata = isset( $_POST['update_level'] ) ? $_POST['update_level'] : null; if( $mydata === 'low' ) { /* unset( $data['post_modified'] ); unset( $data['post_modified_gmt'] ); */ $data = thk_create_update_date( $data, $_POST['aa_mod_h'], $_POST['mm_mod_h'], $_POST['jj_mod_h'], $_POST['hh_mod_h'], $_POST['mn_mod_h'], $_POST['ss_mod_h'] ); } elseif( $mydata === 'edit' ) { $data = thk_create_update_date( $data, $_POST['aa_mod'], $_POST['mm_mod'], $_POST['jj_mod'], $_POST['hh_mod'], $_POST['mn_mod'], $_POST['ss_mod'] ); } elseif( $mydata === 'del' ) { $data['post_modified'] = $data['post_date']; $data['post_modified_gmt'] = $data['post_date_gmt']; } return $data; }, 10, 2 ); /*--------------------------------------------------------------------------- * nofollow、noindex、noarchive のボックス追加 *---------------------------------------------------------------------------*/ /* ボックス追加 */ add_action( 'admin_menu', function() { add_meta_box( 'thk_robots', __( 'Search Engine Visibility', 'luxeritas' ), 'thk_robots_box', 'post', 'side', 'default' ); add_meta_box( 'thk_robots', __( 'Search Engine Visibility', 'luxeritas' ), 'thk_robots_box', 'page', 'side', 'default' ); }, 10, 2 ); if( function_exists( 'thk_robots_box' ) === false ): function thk_robots_box() { global $post; $disabled = ''; $page_template = get_post_meta( $post->ID, '_wp_page_template', true ); if( !empty( $page_template ) && stripos( $page_template, 'pages/wrapper-menu.php' ) !== false ) { /* カスタムグローバルメニューの場合は全部チェック( noindex, nofollow, noarchive, noimageindex ) */ $thk_noindex = 'enable'; $thk_nofollow = 'enable'; $thk_noarchive = 'enable'; $thk_noimageindex = 'enable'; $disabled = ' disabled'; $opacity = ' style="opacity:.7"'; } else { /* 既に値がある場合 */ $thk_robots = get_post_meta( $post->ID, 'thk_robots', true ); $thk_robots = explode( ',', $thk_robots ); $thk_noindex = isset( $thk_robots[0] ) && $thk_robots[0] == 1 ? 'enable' : 'disable'; $thk_nofollow = isset( $thk_robots[1] ) && $thk_robots[1] == 1 ? 'enable' : 'disable'; $thk_noarchive = isset( $thk_robots[2] ) && $thk_robots[2] == 1 ? 'enable' : 'disable'; $thk_noimageindex = isset( $thk_robots[3] ) && $thk_robots[3] == 1 ? 'enable' : 'disable'; } ?> >

ID, 'thk_disable_async_jquery', true ); $thk_disable_async_jquery = $thk_disable_async_jquery === 'disable' ? 'disable' : 'enable'; ?>

ID, 'thk_amp', true ); $thk_amp = $thk_amp === 'disable' ? 'disable' : 'enable'; ?>

ID, 'thk_hide_toc', true ); $thk_toc = $thk_toc === 'disable' ? 'disable' : 'enable'; ?>