ホーム

新しいサイトへようこそ。

カバーイメージの更新または新しいコンテンツの追加から始めます。

/**

  • Plugin Name: 【Catch the Plugin】LPtools体験版(作ったLPはご利用になれません)
  • Plugin URI:
  • Description:
  • Version: 1.8.0
  • Author: Catch the Web
  • Requires at least: 5.8
    • @package catch_the_lptools
      */

defined( ‘ABSPATH’ ) || exit;

function get_lptools_plugin_path(){
return plugin_dir_path(FILE);
}

function get_lptools_plugin_url(){
return plugin_dir_url(FILE);
}

// ——————————————–
// 定数
// ——————————————–
define( ‘CTW_LPTOOLS_TEMPLATE_SLUG’, ‘../template/lptools_lp.php’ );

// ——————————————–
// ファンクション
// ——————————————–
require_once get_lptools_plugin_path().’lib/functions.php’;

// ——————————————–
// 管理画面
// ——————————————–
require_once get_lptools_plugin_path().’lib/admin.php’;

// ——————————————–
// カスタム投稿
// ——————————————–
require_once get_lptools_plugin_path().’lib/custom_post.php’;

// ——————————————–
// ブロック関連
// ——————————————–
require_once get_lptools_plugin_path().’lib/block.php’;

// ——————————————–
// パターン登録
// ——————————————–
//require_once get_lptools_plugin_path().’lib/block_pattern.php’;

// ——————————————–
// 固定ページテンプレート登録
// ——————————————–
require_once get_lptools_plugin_path().’lib/page_template.php’;

// ——————————————–
// ブロックパターンギャラリー
// ——————————————–
require_once get_lptools_plugin_path().’lib/lptools_templates.php’;

// ——————————————–
// テンプレートエクスポート
// ——————————————–
require_once get_lptools_plugin_path().’lib/export_template.php’;

// ——————————————–
// バージョンチェック
// ——————————————–
function ctw_lptools_check_wp_ver() {
if( version_compare(get_bloginfo(‘version’),’5.8′, ‘>=’) ) {
return true;
} else {
return false;
}
}

function lptools_admin_notices() {
?>

LPtoolsからのお知らせ
<?php
}
if( !ctw_lptools_check_wp_ver() ) {
add_action( ‘admin_notices’, ‘lptools_admin_notices’ );
}

// ——————————————–
// CSS調整
// ——————————————–
function ctw_lptools_enqueue_styles() {
global $post_type;
global $post;
if( isset($post->ID) ) { $slug = get_page_template_slug( $post->ID ); }if( ( 'clp' == $post_type || 'lptools_template' == $post_type || ( 'page' == $post_type && $slug == CTW_LPTOOLS_TEMPLATE_SLUG ) ) && get_option('lptools_use_other_blocks') != 1 ) { wp_dequeue_style( 'theme-editor-style' ); // アルバトロス wp_dequeue_style( 'cocoon-gutenberg' ); // Coccoon wp_dequeue_style( 'cocoon_blocks-cgb-style-css' ); // Coccoon wp_dequeue_style( 'cocoon_blocks-cgb-block-editor-css' ); // Coccoon wp_dequeue_style( 'cocoon-css-cache-style' ); // Coccoon wp_dequeue_style( 'cocoon-gutenberg-content' ); // Coccoon wp_dequeue_style( 'st-block-editor-style' ); // AFFINGER wp_dequeue_style( 'keni_block-cgb-style-css' ); // 権威8.0 wp_dequeue_style( 'keni_block-cgb-block-editor-css' ); // 権威8.0 wp_dequeue_style( 'keni-advanced-css' ); // 権威8.0 wp_dequeue_style( 'acf-global' ); // Colorful wp_dequeue_style( 'acf-input' ); // Colorful wp_dequeue_style( 'select2' ); // Colorful wp_dequeue_style( 'acf-datepicker' ); // Colorful wp_dequeue_style( 'acf-timepicker' ); // Colorful wp_dequeue_style( 'my_admin_style' ); // Colorful wp_dequeue_style( 'myOptionsCSS' ); // Colorful }

}
add_action( ‘admin_print_styles-post.php’, ‘ctw_lptools_enqueue_styles’, 9999 );
add_action( ‘admin_print_styles-post-new.php’, ‘ctw_lptools_enqueue_styles’, 9999 );

// ——————————————–
// カスタム投稿clpで特定ブロック削除&LPtoolsテンプレート以外ではLPtoolsブロック削除
// ——————————————–
function ctw_lptools_dequeue_script() {
global $post_type;
global $post;
if( isset($post->ID) ) { $slug = get_page_template_slug( $post->ID ); }if( ( 'clp' == $post_type || 'lptools_template' == $post_type || ( 'page' == $post_type && $slug == CTW_LPTOOLS_TEMPLATE_SLUG ) ) && get_option('lptools_use_other_blocks') != 1 ) { wp_dequeue_script( 'cocoon-blocks-js' ); // Cocoon } if( ('clp' != $post_type && 'lptools_template' != $post_type) && $slug != CTW_LPTOOLS_TEMPLATE_SLUG ) { wp_dequeue_script( 'ctw-lptools' ); // LPtools }

}
add_action( ‘admin_print_styles-post.php’, ‘ctw_lptools_dequeue_script’, 9999 );
add_action( ‘admin_print_styles-post-new.php’, ‘ctw_lptools_dequeue_script’, 9999 );

// ——————————————–
// フッターで読み込み
// ——————————————–
function lptools_custom_admin_footer() {
global $post_type;
global $post;
$slug = ”;if( isset($post->ID) ) { $slug = get_page_template_slug( $post->ID ); } if( 'clp' == $post_type || 'lptools_template' == $post_type || ( 'page' == $post_type && $slug == CTW_LPTOOLS_TEMPLATE_SLUG ) ) { wp_enqueue_style( 'ctw-lptools' ); wp_enqueue_style( 'ctw-lptools-editor' ); }

}
add_action(‘admin_print_styles’, ‘lptools_custom_admin_footer’);

// ——————————————–
// テンプレートを1つずつエクスポート
// ——————————————–
function lptools_add_lptools_template_posts_columns($columns) {
$columns[ ‘lptools_template_export’ ] = ”;return $columns;

}
function lptools_add_lptools_template_posts_columns_row( $column_name, $post_id ) {
if ( $column_name == ‘lptools_template_export’ ) {
echo ‘このLPをエクスポート‘;
}
}
add_filter( ‘manage_lptools_template_posts_columns’, ‘lptools_add_lptools_template_posts_columns’ );
add_action( ‘manage_lptools_template_posts_custom_column’, ‘lptools_add_lptools_template_posts_columns_row’, 10, 2 );

WordPress.com で次のようなサイトをデザイン
始めてみよう