prefix . 'aagl_main_keywords'; // 総数取得 $total_keywords = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}aagl_main_keywords"); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $total_pages = ceil($total_keywords / $items_per_page); // データ取得 $keywords = $wpdb->get_results($wpdb->prepare( "SELECT * FROM {$wpdb->prefix}aagl_main_keywords ORDER BY created_at DESC LIMIT %d OFFSET %d", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $items_per_page, $offset ), ARRAY_A); ?>

AI記事生成 - キーワード管理

新しいキーワードを追加

登録済みキーワード (件)

まだキーワードが登録されていません。

キーワード カテゴリー 優先度 ステータス 登録日 操作
'高', 2 => '中', 3 => '低'); echo esc_html($priority_labels[$keyword['priority']] ?? $keyword['priority']); ?> 'アクティブ', 'inactive' => '無効', 'completed' => '完了' ); echo esc_html($status_labels[$keyword['status']] ?? $keyword['status']); ?>
1): ?>
項目 add_query_arg('paged', '%#%'), 'format' => '', 'prev_text' => '«', 'next_text' => '»', 'current' => $current_page, 'total' => $total_pages, 'type' => 'array' )); if ($page_links) { $allowed_html = array( 'a' => array( 'href' => array(), 'class' => array(), ), 'span' => array( 'class' => array(), 'aria-current' => array(), ), ); echo '' . wp_kses(implode('', $page_links), $allowed_html) . ''; } ?>

メインキーワードを選択

0): // サブキーワード用の処理 $sub_table = $wpdb->prefix . 'aagl_sub_keywords'; $sub_per_page = 20; $sub_page = isset($_GET['sub_paged']) ? max(1, intval($_GET['sub_paged'])) : 1; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $sub_offset = ($sub_page - 1) * $sub_per_page; // 選択されたメインキーワード情報 $selected_main = $wpdb->get_row($wpdb->prepare( "SELECT * FROM {$wpdb->prefix}aagl_main_keywords WHERE id = %d", $selected_main_id // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared )); // サブキーワード総数取得 $total_sub_keywords = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}aagl_sub_keywords WHERE main_keyword_id = %d", $selected_main_id // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared )); $total_sub_pages = ceil($total_sub_keywords / $sub_per_page); // サブキーワード取得 $sub_keywords = $wpdb->get_results($wpdb->prepare( "SELECT * FROM {$wpdb->prefix}aagl_sub_keywords WHERE main_keyword_id = %d ORDER BY created_at DESC LIMIT %d OFFSET %d", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $selected_main_id, $sub_per_page, $sub_offset ), ARRAY_A); ?>

「keyword ?? '' )); ?>」のサブキーワードを追加

複数のサブキーワードを登録する場合は、カンマ(,)で区切って入力してください。
例: キーワード1, キーワード2, キーワード3

「keyword ?? '' )); ?>」のサブキーワード一覧 (件)

まだサブキーワードが登録されていません。

サブキーワード ステータス 登録日 操作
'アクティブ', 'inactive' => '無効', 'used' => '使用済み' ); echo esc_html($sub_status_labels[$sub_kw['status']] ?? $sub_kw['status']); ?>
1): ?>
項目 add_query_arg(array('sub_paged' => '%#%', 'main_keyword_id' => $selected_main_id)), 'format' => '', 'prev_text' => '«', 'next_text' => '»', 'current' => $sub_page, 'total' => $total_sub_pages, 'type' => 'array' )); if ($sub_page_links) { $allowed_sub_html = array( 'a' => array( 'href' => array(), 'class' => array(), ), 'span' => array( 'class' => array(), 'aria-current' => array(), ), ); echo '' . wp_kses(implode('', $sub_page_links), $allowed_sub_html) . ''; } ?>
document.addEventListener('DOMContentLoaded', function() { // タブ切り替え機能 const tabs = document.querySelectorAll('.nav-tab'); const tabContents = document.querySelectorAll('.tab-content'); tabs.forEach(tab => { tab.addEventListener('click', function(e) { e.preventDefault(); // 全てのタブからアクティブクラスを削除 tabs.forEach(t => t.classList.remove('nav-tab-active')); tabContents.forEach(content => content.classList.remove('active')); // クリックされたタブをアクティブにする this.classList.add('nav-tab-active'); // 対応するコンテンツを表示 const targetId = this.getAttribute('href').substring(1); const targetContent = document.getElementById(targetId); if (targetContent) { targetContent.classList.add('active'); } // URLハッシュを更新 window.location.hash = this.getAttribute('href'); }); }); // ページロード時のタブ設定。 // サブキーワード操作(削除・編集・メインKW選択・ページ送り)の後はURLに main_keyword_id が // 残るため、ハッシュが無くてもサブキーワードタブを維持する(メインタブへ勝手に戻る不具合の防止)。 if (/[?&]main_keyword_id=\d+/.test(window.location.search)) { const subTab = document.querySelector('a[href="#sub-keywords"]'); if (subTab) { subTab.click(); } } else if (window.location.hash) { const hash = window.location.hash; const targetTab = document.querySelector(`a[href="${hash}"]`); if (targetTab) { targetTab.click(); } } // サブキーワード一覧: 全選択チェックボックスで全行をトグル const subSelectAll = document.getElementById('sub-select-all'); if (subSelectAll) { subSelectAll.addEventListener('change', function() { document.querySelectorAll('.sub-cb').forEach(function(cb) { cb.checked = subSelectAll.checked; }); }); } });