In you code you are passsing ‘Page’ as object types.
Please update your code as follows:
$cmb = new_cmb2_box( array(
'id' => $prefix . 'banner_media',
'title' => __( 'Banner media', 'foo' ),
'object_types' => array( 'post' , 'page' ),
'context' => 'advanced',
'priority' => 'default',
) );
When set object types to Post and Page both then it will be available to both post types. you can also include any custom post type as well.
Related Posts:
- Best way to manage a lot of pages in Wp Admin [closed]
- How can I show drafts in wp_dropdown_pages list?
- add_meta_box Callback not being called
- Add menu page issues (permissions & position)
- Price comparison table based on Custom Post Type?
- WordPress Plugin and other pages not opening
- How to stop showing admin notice after close button has been clicked
- How do I add to the list table a filter?
- Edit Imported advanced Custom Fields from wordpress Dashboard
- Pages with 2 Columns
- Add custom meta box on Post page
- how to display all posts Custom fields dynamically?
- Custom options page checkbox will not save, despite working with text
- How to show category images (from plugin) on a regular page (page-example.php)?
- How to create Repeater fields using Advanced Custom Fields?
- [Plugin: Posts 2 Posts] How does it work?
- Why would WP-CLI and WP Admin show different list of plugins with updates?
- After activating a Plugin, /wp-admin is no longer accessible
- Copyright messages for a particular set of pages
- Plugin not saving values when placed in a folder within /wp-content/plugins
- Security checking in meta_box save is reluctant?
- Add a plugin before main container
- Function to prevent users from trashing comments
- WordPress CMB2 – Run function on save
- Carbon Fields use in custom plugin class
- View Private Published Page with URL Code (no login required)
- WordPress takes too much time (100 seconds) to load – Front end and back end
- UnWanted Custom field added in the wp page edit area
- How to query the custom fields by language?
- Is there an easy way to flag posts in the admin area?
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Is it possible make a back-end for WordPress with WordPress?
- Changing page URL and connect newsletter to MailChip
- Dynamic admin submenu
- Remove ‘Check Compatibility’ from Plugins menu
- Can I allow certain people to add/edit pages within a parent?
- Unable to select image using custom image field type
- Cannot access my wp-admin after installing Gzip compression [closed]
- Plugin settings won’t save changes
- Odd /wp-admin/admin-ajax.php entries showing in Wassup
- Adding class to last list item? Not WP generated
- How to Resize the Custom Post Images?
- Display Plugin Panels Outside of Admin Areas
- Simulating a wp page – wp page load sequence
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How to remove a CPT Menu from the Root Admin only
- Mowing site to another domain in simplest way
- Custom form not showing in correct place on page
- Use jQuery Datepicker code from plugin
- Cannot access WP admin because plugin returns 204
- Install old version of plugin from admin panel?
- WordPress as heavily personalized content management portal, and somewhat like dropbox [closed]
- How to force load a page in plugin?
- Plugin that lets visitors Like a post (not facebook) and stores likes in custom meta?
- grab or load text on demand
- Is there a syntax highlighting plugin for HTML View? [duplicate]
- Can’t save changes or modify settings in Dashboard but Pages and Posts are fine
- Pass PHP variable to javascript
- How to permanently show Word Counter on Create/Edit Page. WordPress5.9.3
- Table of contents (TOC) plugin is not showing header tag
- Trigger jQuery to add events after AJAX-loading table in admin plugin
- Copy/paste local images not working in WordPress
- how to move a plugin-block in Edit Post page back to bottom area?
- wp_post not working, keeps redirecting to posts page
- WordPress fatal error from php protocol codes
- get_post_meta shortcode returns empty field
- create pages automatically and dynamically in wordPress
- Adding Custom Endpoint in WordPress Rest API
- General Term for this form Field
- How do I change the functionality of an image slider which is part of ACF?
- Make custom post types using ACF
- How to allow URL with filename & extension in wordpress?
- Get full URL of WP plugin admin page
- How to pass multiple custom fields as shortcode’s parameters
- WordPress Plugin PHP Not Calling Function
- Admin menu hilighting wrong item for CPT
- Is admin section completely customizable in terms of styling?
- Taxonomy question
- Add_Meta_box to custom page (formidable edit post)
- Add custom field for users
- Disable plugin on admin page
- Options page textarea to populate custom post select field
- Creating a user ‘add custom field’ section
- Ajax return 0 in plugin – ajax only used in wp-admin
- Restrict my pages from public
- Custom Field select list is truncated
- How to set different users for different pages?
- get_post_meta does not work
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- Get post id in Post Page within Wp-admin
- AdBlock blocks my non-advertising sidebar images [closed]
- Combining JS files to one script
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- ACF: Not displaying ACF data from another post
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- plugin translations not reflected in admin dashboard
- Attachement title in wpallimport
- Links not opening as they should. Custom WP plugin
- PHP FATAL ERROR
- additional fields based on the quantity of products selected