Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Portfolio, Posts & Image Gallery を有効にしていると固定ページをプレビュー時にメモリオーバーエラーになる #98

Open
kimipooh opened this issue May 31, 2023 · 0 comments

Comments

@kimipooh
Copy link

解決策
smart-custom-fields/classes/class.scf.php
public static function get_field( $object, $field_name ) {
if ( '_locale' === $field_name || '_original_post' === $field_name ) {
return null;
}

の部分に、Visual Portfolio, Posts & Image Galleryが読み込むメタフィールド(_vp_post_type_mapped)を除外する設定を追加うること

if ( '_locale' === $field_name || '_original_post' === $field_name || '_vp_post_type_mapped' === $field_name ) {
return null;
}

です。

これは Visual Portfolio, Posts & Image Gallery の
classes/class-archive-mapping.php
add_action( 'pre_get_posts', array( $this, 'maybe_override_archive' ) );
public function maybe_override_archive( $query ) {

において、下記のget_post_metaの部分をコメントすることで問題の解決はできたのですが、2つのプラグインを共存するためには、Smart Custom Field のほうで除外設定をするほうが影響が少ないだろうという判断です。ご一考いただければと思います。

if ( is_page() ) {
$object_id = get_queried_object_id();
$post_meta = get_post_meta( $object_id, '_vp_post_type_mapped', true );
if ( ! $post_meta && get_query_var( 'paged' ) ) {
return;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant