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
- Show only those pages that are created by the specific logged in user in WordPress
- I found this in a plugin. What does it do? is it dangerous?
- Disable /wp-admin/plugin-install.php
- Is There a WordPress Hook to Filter the Edit Posts View?
- Reordering themes in admin panel
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- WordPress admin notice in plugin function
- Using tabs for wordpress plugin
- How can I save repeatable fields with one value inside an array?
- WP-PageNavi plugin doesn’t work with multiple pages of search results
- How to make a WP admin button/menu similar to Jetpack Notifications?
- Advanced Custom Fields query
- Plugin allowing for artists, events and venues
- Show a special message for private page?
- How to Sort the Favorite Plugins Screen Alphabetically?
- Hide extra menus from WordPress Dashboard
- ‘wp_login’ action hook not working with wp-login.php file
- All Users > User List > Update User Meta Field Inline
- Default WordPress WP Editor removing style tags and html tag
- Assign / update custom field value for all posts (How can I assign only to posts without custom field value?)
- Custom User meta field display
- 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
- How to have sample page for each new register users in a membership website
- 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
- Huge number of 404 pages getting spawned
- 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?
- Adding a pagenavi to function for displaying bookmarks
- grab or load text on demand
- Is there a syntax highlighting plugin for HTML View? [duplicate]
- Adding custom Field To The Posts Listing
- Can’t save changes or modify settings in Dashboard but Pages and Posts are fine
- 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
- How to properly enqueue jQuery knob on WordPress without conflict?
- Adding Custom Endpoint in WordPress Rest API
- Automatic chage password of pages after some time
- General Term for this form Field
- How do I change the functionality of an image slider which is part of ACF?
- Add custom WordPress admin page with pretty url via code
- 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 Disable Auto Executing Script in A Particular Page Only
- How to pass multiple custom fields as shortcode’s parameters
- WordPress Plugin PHP Not Calling Function
- Is admin section completely customizable in terms of styling?
- catch urls with specific pattern and show specific content for them by plugin
- Not able to upload Plugins/ Theme from Admin backend
- 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
- Restrict my pages from public
- Custom Field select list is truncated
- 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]
- Screen Options drop-down does not show
- 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
- Update title field while listing wordpress page titles in Elementor selector
- Allow direct access to files/folders within WordPress to replace wp-admin
- How to access the page without registering in wordpress
- Fatal Error in my WP “Call to undefined function get_option()”
- Issue using form in Google app in mobile
- Secure way to add JS Script to WordPress filesystem
- Not applying update field (acf) in my plugin
- How to filter posts with a wp query by a custom dropdown type field with the magic fields plugin