9cc82988e2
・ソートのカスタムフィールドのメタボックスを追加 ・共通nameタグが更新されないバグ対策としてフォームタグを共通化 ・ファイル名をクラス名に合わせるよう変更
55 lines
2.1 KiB
PHP
55 lines
2.1 KiB
PHP
<?php
|
||
/*
|
||
Plugin Name: Archive Post Order Plus
|
||
Plugin URI: https://www.n-k-y.net/wp_plugin_apop/
|
||
Author: Nobuhiro Kimura
|
||
Author URI: https://www.n-k-y.net
|
||
Description: アーカイブのタクソノミー毎に投稿の表示順を設定するプラグイン
|
||
Version: 1.0.0
|
||
License: GPLv2
|
||
*/
|
||
|
||
/* Copyright 2021 Nobuhiro Kimura (email : big-me@n-k-y.net)
|
||
This program is free software; you can redistribute it and/or modify
|
||
it under the terms of the GNU General Public License, version 2, as
|
||
published by the Free Software Foundation.
|
||
This program is distributed in the hope that it will be useful,
|
||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
GNU General Public License for more details.
|
||
You should have received a copy of the GNU General Public License
|
||
along with this program; if not, write to the Free Software
|
||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||
*/
|
||
|
||
/**
|
||
* TODO:
|
||
1)カテゴリーのソート用カスタムフィールド取得と設定
|
||
・保存しているタームIDと投稿が属するタームIDが一致する場合、管理画面に表示する
|
||
class.apop.apop_post.php、setting_post_custom_field.php
|
||
* 2)uninstall.php
|
||
* 投稿とタクソノミーのカスタムフィールド削除方法修正
|
||
* ・delete_post_meta_by_key()を廃止し、WP_QUERYに変更する
|
||
*/
|
||
|
||
define( 'APOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
||
define( 'APOP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
|
||
|
||
//メイン処理のクラスをインスタンス化
|
||
require_once __DIR__ . '/class/class.apop.order.php';
|
||
require_once __DIR__ . '/class/class.apop.apop_ui.php';
|
||
require_once __DIR__ . '/class/class.apop.apop_post.php';
|
||
|
||
$APOP = new APOP;
|
||
new APOP_POST;
|
||
|
||
//CSS, JSの読み込み
|
||
add_action( 'admin_enqueue_scripts', 'register_my_styles' );
|
||
function register_my_styles() {
|
||
wp_enqueue_style( 'hrc_post_style', APOP_PLUGIN_URL . 'css/apop-style.css' );
|
||
wp_enqueue_script( 'jquery-ui-sortable' );
|
||
wp_enqueue_script( 'post-sort-cat-order_js', APOP_PLUGIN_URL . 'js/apop-style.js' );
|
||
}
|
||
|
||
$APOP->set_query();
|