Forum Replies Created

Viewing 1 replies (of 1 total)
  • 私も同様の問題が起こりましたので調べてみましたが「Bogo」のプラグイン自体有効にしたらwp_unique_post_slugは動作しないようです。

    プラグイン内のincludes/post.php内にpre_wp_unique_post_slugが使用されているのでwp_unique_post_slugの処理がスキップされているようですね。

    なので私の環境ではpre_wp_unique_post_slugを使うように以下のように修正することで動作しました。

    function auto_post_slug( $override_slug, $slug, $post_ID, $post_status, $post_type ) {
    if ( preg_match( '/(%[0-9a-f]{2})+/', $slug ) ) {
    $override_slug = utf8_uri_encode( $post_type ) . '-' . $post_ID;
    }
    return $override_slug;
    }
    add_filter( 'pre_wp_unique_post_slug', 'auto_post_slug', 10, 5 );
Viewing 1 replies (of 1 total)