Plugin Directory

Changeset 3481638


Ignore:
Timestamp:
03/13/2026 03:49:23 AM (3 weeks ago)
Author:
ondoku3
Message:

v1.0.28: ACFフィールドグループ等の非公開投稿タイプ保存時のAPI発火を防止

Location:
ondoku
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ondoku/tags/1.0.28/classes/hooks.php

    r3452493 r3481638  
    6666     */
    6767    public function handle_status_transition( $new_status, $old_status, $post ) {
     68        // 非公開の投稿タイプ(ACFフィールドグループ等)はスキップ
     69        $post_type_obj = get_post_type_object( $post->post_type );
     70        if ( ! $post_type_obj || ! $post_type_obj->public ) {
     71            $this->write_log( sprintf(
     72                '非公開投稿タイプのためスキップ: post_id=%d, post_type=%s',
     73                $post->ID,
     74                $post->post_type
     75            ) );
     76            return;
     77        }
     78
    6879        // future -> publish の遷移(予約投稿の公開)を検出
    6980        if ( $new_status === 'publish' && $old_status === 'future' ) {
     
    8596    public function read_ondoku( $post_id, $from_transition = false ) {
    8697
     98        // オートセーブ時はスキップ
     99        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
     100            return;
     101        }
     102
    87103        $post = get_post( $post_id );
     104
     105        // 投稿が取得できない場合はスキップ
     106        if ( ! $post ) {
     107            return;
     108        }
     109
     110        // 非公開の投稿タイプ(ACFフィールドグループ等)はスキップ
     111        $post_type_obj = get_post_type_object( $post->post_type );
     112        if ( ! $post_type_obj || ! $post_type_obj->public ) {
     113            $this->write_log( sprintf(
     114                '非公開投稿タイプのためスキップ: post_id=%d, post_type=%s',
     115                $post_id,
     116                $post->post_type
     117            ) );
     118            return;
     119        }
    88120
    89121        // 自動保存と非公開では音読データを作らない
  • ondoku/tags/1.0.28/ondokusan.php

    r3453470 r3481638  
    44Description: Text to Speech (TTS) plugin. Automatically convert posts to MP3 audio. 音読さん - ブログ読み上げ・音声化プラグイン。
    55Author: Ondoku
    6 Version: 1.0.27
     6Version: 1.0.28
    77Text Domain: ondoku3
    88Domain Path: /languages/
     
    1313
    1414define( 'ONDOKUSAN', __FILE__ );
    15 define( 'ONDOKUSAN_VERSION', '1.0.27' );
     15define( 'ONDOKUSAN_VERSION', '1.0.28' );
    1616define( 'ONDOKUSAN_DIR', untrailingslashit( dirname( __FILE__) ) );
    1717define( 'ONDOKUSAN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
  • ondoku/tags/1.0.28/readme.txt

    r3453470 r3481638  
    55Requires at least: 5.1
    66Requires PHP: 8.0
    7 Stable tag: 1.0.27
     7Stable tag: 1.0.28
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • ondoku/trunk/classes/hooks.php

    r3452493 r3481638  
    6666     */
    6767    public function handle_status_transition( $new_status, $old_status, $post ) {
     68        // 非公開の投稿タイプ(ACFフィールドグループ等)はスキップ
     69        $post_type_obj = get_post_type_object( $post->post_type );
     70        if ( ! $post_type_obj || ! $post_type_obj->public ) {
     71            $this->write_log( sprintf(
     72                '非公開投稿タイプのためスキップ: post_id=%d, post_type=%s',
     73                $post->ID,
     74                $post->post_type
     75            ) );
     76            return;
     77        }
     78
    6879        // future -> publish の遷移(予約投稿の公開)を検出
    6980        if ( $new_status === 'publish' && $old_status === 'future' ) {
     
    8596    public function read_ondoku( $post_id, $from_transition = false ) {
    8697
     98        // オートセーブ時はスキップ
     99        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
     100            return;
     101        }
     102
    87103        $post = get_post( $post_id );
     104
     105        // 投稿が取得できない場合はスキップ
     106        if ( ! $post ) {
     107            return;
     108        }
     109
     110        // 非公開の投稿タイプ(ACFフィールドグループ等)はスキップ
     111        $post_type_obj = get_post_type_object( $post->post_type );
     112        if ( ! $post_type_obj || ! $post_type_obj->public ) {
     113            $this->write_log( sprintf(
     114                '非公開投稿タイプのためスキップ: post_id=%d, post_type=%s',
     115                $post_id,
     116                $post->post_type
     117            ) );
     118            return;
     119        }
    88120
    89121        // 自動保存と非公開では音読データを作らない
  • ondoku/trunk/ondokusan.php

    r3453470 r3481638  
    44Description: Text to Speech (TTS) plugin. Automatically convert posts to MP3 audio. 音読さん - ブログ読み上げ・音声化プラグイン。
    55Author: Ondoku
    6 Version: 1.0.27
     6Version: 1.0.28
    77Text Domain: ondoku3
    88Domain Path: /languages/
     
    1313
    1414define( 'ONDOKUSAN', __FILE__ );
    15 define( 'ONDOKUSAN_VERSION', '1.0.27' );
     15define( 'ONDOKUSAN_VERSION', '1.0.28' );
    1616define( 'ONDOKUSAN_DIR', untrailingslashit( dirname( __FILE__) ) );
    1717define( 'ONDOKUSAN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
  • ondoku/trunk/readme.txt

    r3453470 r3481638  
    55Requires at least: 5.1
    66Requires PHP: 8.0
    7 Stable tag: 1.0.27
     7Stable tag: 1.0.28
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.