When upgrading to 1.4 fields are no longer shown on specified page with the exact same code.
This used to show the custom field for the page with the slug 'frontpage'.
Container::make('post_meta', 'Frontpage content')
->show_on_page('frontpage')
->add_fields(array(
Field::make('text', 'title')->set_default_value('Some text')
));
Changing it to
->show_on_page($id) or ->show_on_post_type('page')
displays the custom field on the page.
I tried this with several pages, and also checked that the query index.php?pagename=frontpage gave the desired page. So the path should be correct.
Further more, this actually works
->show_on_page(\get_page_by_path( 'frontpage' )->ID)
Hi @Jeger and thanks for the report. This is a bug that we fixed today. Try using a page id instead of a slug until we release the next version.
Duplicate of https://github.com/htmlburger/carbon-fields/issues/120.
Thanks!
Such awesome speed on resolution and answers!
And again, thanks for this awesome plugin :dancing_men:
You are welcome :)
Most helpful comment
Thanks!
Such awesome speed on resolution and answers!
And again, thanks for this awesome plugin :dancing_men: