How to have meta boxes save via REST in Gutenberg?
How to have meta boxes save via REST in Gutenberg?
How to have meta boxes save via REST in Gutenberg?
That global_box_meta_box_callback() is a class method (i.e. a function inside a class) and not a globally defined function, so you need to use [ $this, ‘global_box_meta_box_callback’ ] (or array( $this, ‘global_box_meta_box_callback’ )) when supplying the class method to add_meta_box(): class Foo { … function wpd_add_meta_box() { $screens = get_post_types(); foreach ( $screens as $screen ) … Read more
Remove metabox from WordPress menu editor page?
Adding meta box without add_meta_box – is this bad?
Getting Custom Post Type Meta on Publish
Add custom links like functionality
So, it appears that I was correct that the issue was that the id “page_template” was no longer being passed. To solve this, all I have done is applied some Javascript (using the admin_enqueue_scripts function) which adds the id “page_template” to the radio button that has been selected.
Use something like this after you foreach loop. In this example link is saved in new meta field. You can overwrite document_overview_document-link, but then you will get combined html code as link value when open your document in editor. foreach { … } if ( isset( $_POST[ ‘document-link’ ] ) ) { $html=”<a class=”btn btn-outline-info … Read more
Prepending your metakey with an underscore _ makes it private and prevents the data from showing up in the default metabox. So instead of this, update_post_meta( $post_id,’product_desc_en’, wp_kses_post( $_POST[‘product_desc_en’] ) ); do this, update_post_meta( $post_id,’_product_desc_en’, wp_kses_post( $_POST[‘product_desc_en’] ) ); and your custom meta shouldn’t show up in the default metabox. P.s. And of course, when … Read more
snippet code of notification display when check notify checkbox and display message in Update and Publish post or page in admin function cabtv_add_post_options() { // Add our meta box for the “post” post type (default) $post_types = array(“post”, “page”); foreach ($post_types as $post_type) { add_meta_box(‘cabtv_notif_on_post’,’Notifications’,’cabtv_notif_on_post_html_view’,$post_type,’side’,’high’); } } add_action(‘add_meta_boxes’, ‘cabtv_add_post_options’); function cabtv_notif_on_post_html_view($post) { wp_nonce_field( ‘cabtv_notif_metabox’, ‘cabtv_notif_metabox’ … Read more