The problem was with this line:
if(!$related_resources OR $related_resources == '') return;
I changed it to:
if($related_resources == '') return;
And it started working properly. I hope others can make use of the code too. Thanks!
Related Posts:
- Passing error/warning messages from a meta box to “admin_notices”
- Metabox of one post influence setting on other
- unable to save post meta on single field with multiple selects
- Save meta data with post, Without using any plugin [closed]
- save radio button selection in post-meta on submit
- Add “upload media” button in meta box field
- Metabox with checkbox is not updating
- get registered metaboxes by post type or post ID
- How to get meta box data to display on a page
- esc before saving or before displaying does it matter?
- Add a meta description to home page?
- Why can’t I hook into save_posts after admin_init?
- Check if meta key value already exists
- get_post_meta doesn’t work
- Save checkboxes of a metabox with a foreach loop (invalid argument)
- prevent post submission
- How to store multiple input values with same meta_key
- Consolidate Metaboxes into 1 Big Metabox
- metabox upload file
- Why is variable value emptry in $_POST but available in $_REQUEST?
- Why does get_post_meta not work with the posts page?
- How to get meta box values – WP tuts tutorial
- Change the post date from a meta box
- Undefined ‘post_type’ error on Add new page
- update_post_meta and get_post_meta not working
- Repeatable custom meta fields
- Metabox saves on Update or Publish, but not on Saving Draft
- how to save multiple checkboxes value in wordpress dynamically
- Using WYSIWYG In custom meta boxes
- save_post action to include wp_insert_post_data filter, gathering meta field info & prevent infinite loop
- Multiplicate entry on update_post_meta
- Meta box html is not updating after saving
- Getting gutenberg (WordPress 5) to save TInymce data?
- Undefined index error in custom post metabox
- Custom Meta box only returns most recent value on page
- How to prevent further updates of custom meta when using actions to set one meta based on another
- Stop saving process when metabox is invalid [duplicate]
- How to create a button click counter meta box?
- meta box & callback function
- $_GET & $post_ID
- get_post_meta as a list for drop down search filter
- Why does not my metabox save?
- How to validate select field in post meta?
- Migrating from metaboxes to wp_editor()
- Parse a text area custom meta box and assign as value to existing meta keys
- Getting metabox value?
- Hide Page Title with Post Meta
- How can i get multi checkboxes value in metbox?
- Show value of select dropdown in meta box
- remove a single post_meta
- Echo 2 values from one key in Array with get_post_custom
- post meta – problem : copy the same meta for all the articles
- Custom Meta Data is not being saved
- Post and Pages section inside WordPress admin are completely blank
- Saving multiple fields (dropdown and text) in custom metabox
- Update Post Meta in Front End with a form
- Update Post meta with custom variable
- get_post_meta not working on my custom-function page
- update_post_meta doesn’t work
- Custom meta box data not saving
- Removing Meta Generator
- Meta Box – Javascript Datatable
- Only allow one meta key value per post in a category
- use post meta in add_meta_boxes action
- Problem with ‘save_post’ hook not running
- A correct hook for saving meta boxes data
- Custom meta box not saving values of radio buttons in WordPress
- Can’t save drop down select date in meta boxes
- update_post_meta does not work
- add_post_meta not saved
- when saveing $meta_box i get Undefined index error
- Updating post meta and Meta Box plugin
- Related posts and custom meta_box?
- Select Options Meta Data is Not Updating in Edit Meta Box
- Metaboxes not saving data
- How to display meta box data using “Meta boxes as needed”
- Metadata in loops
- Allow iframe in custom meta box
- Calling Data from Custom Meta Box
- How can i remove blank area caused by theme’s post meta boxes?
- Datepicker altField and altFormat to save a new meta key/value in a post?
- My meta box don’t want to save value
- CPT posts in drop downed in meta box on page doesn’t return post ID
- Add a Meta Box for uploading a SECOND Featured Image?
- Sample code for validating custom metabox?
- update_post_meta() not working in save_post
- Adding uploaded images to editor from metabox instead of default popup uploader
- Create meta boxes that don’t show in custom fields
- Choosing a default page tempate (Classic => Gutenberg)
- Customize WordPress Media Upload and New Media Manager Menu in add post Metabox
- Remove meta box for specific page
- Visual/Text tabs in wp editor Not Showing
- Change the context of excerpt metabox for the ‘New Post’ page
- How to have meta boxes save via REST in Gutenberg?
- Get updated meta value after post update or published (custom post type) using hook
- custom-meta-box checkboxes from loop won’t save
- Dynamic number of fields in a meta box
- unable to save custom taxonomy terms in a custom-built metabox in wp-admin
- Tags meta box don’t show when creating a new post type
- Custom select box meta field