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

Conflict With Custom Field Suite Plugin #66

Open
jesserosenfield opened this issue Jul 18, 2013 · 1 comment
Open

Conflict With Custom Field Suite Plugin #66

jesserosenfield opened this issue Jul 18, 2013 · 1 comment

Comments

@jesserosenfield
Copy link

Adding the following code "breaks" the custom field suite plugin... any custom fields added with CFS disappear on that particular page editor (pages using the "landing.php" template) and you can't save new ones. Removing the following code makes the CFS fields visible again.

$featured_post_ids = new WPAlchemy_MetaBox(array
(
'id' => '_featured_posts',
'title' => 'Featured Blog Posts',
'context' => 'normal', // same as above, defaults to "normal"
'priority' => 'high', // same as above, defaults to "high"
'template' => get_stylesheet_directory() . '/metaboxes/full-meta.php',
'include_template' => array('landing.php')
));

@jesserosenfield
Copy link
Author

The issue was with the WP Alchemy repeating fields. Removing the the "foreach" loop solved the problem (but obviously took away the repeating fields). I set the "priority" to low and it solved the problem.

Although if I were to drag and drop the WP Alchemy meta box above the custom field suite boxes, the CFS boxes would break again.

So it appears there is a problem with the foreach() statement here: ( I also tried adding wp_reset_query() and rewind_posts() and no luck)

<a style="float:right; margin:0 10px;" href="#" class="dodelete-featured_posts button">Remove All</a>

<?php while($mb->have_fields_and_multi('featured_posts')): ?>
<?php $mb->the_group_open(); ?>

<label>Select a Post</label>
<?php $mb->the_field('featured_post'); ?>
<select name="<?php $mb->the_name(); ?>">

    <option value="">Select...</option>
    <option value="<?php echo $post->ID; ?>"<?php $mb->the_select_state($post->ID); ?>><?php the_title(); ?></option>
</select>

<?php $mb->the_group_close(); ?>
<?php endwhile; ?>

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