You have to use $_REQUEST
instead of $_GET
, because when an user saves a post the POST
request will be send to the server. It means that there is no $_GET['post']
argument and your meta boxes won’t be registered. And if they are not registered, then nothing will be saved.
// Only shows for the admin front-page assigned page.
$front_page_id = get_option( 'page_on_front' );
$post_id = (empty($_REQUEST['post'])) ? NULL : $_REQUEST['post'];
if (is_admin() && $front_page_id == $post_id) {
........
}
Related Posts:
- Select input in metabox not updated
- How to remove admin menu pages inserted by plugins?
- How to use more than 256MB of memory in the admin?
- Make Custom Metaboxes Collapse by Default
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- What is the best way to customise admin files so they survive future upgrades?
- Creating my own Admin Forms in a WordPress CMS?
- How to build custom WP admin with custom URLs
- WordPress prompt checklist before publish?
- Adding an email column to a Custom Post Types Admin Screen?
- Custom Dashboard Home Screen Options
- Add custom column to Users admin panel with Types user custom fields?
- Add ‘Right Now’ widget to custom dashboard
- Hide upload image fields for the different media upload popups
- How can I create a custom meta box to add an mp4 video to a page?
- Adding all sub-pages to the menu manager
- Preserve custom URL parameter after saving post
- The Best Way to always load the newest version of 3rd party code
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- How to get custom page template being edited in gutenberg editor
- Change the Labels of Users to Customers in Admin
- custom meta box for page default template
- Organizing the position of widgetized areas in the backend
- Admin search post meta
- I need a “Choose from existing content” popin
- Customizing Users in Admin Area
- Simplify the admin end
- What is the best way to modify Admin Panel on WordPress?
- Stop Expansion of Top Level Menu in the WordPress Admin Sidebar
- How to create “custom page types” with different custom fields in them?
- Let author add field to metabox by pressing a button
- Meta Tags by Meta Box
- Showing Meta Box via Jquery Checkbox
- Usage of custom post types in a custom admin menu
- problem saving/ retrieving custom meta with wp alchemy metabox
- WordPress 3.1.2 Bug: add_theme_support() and video post format registering twice
- Multiple header style under meta box
- How to create custom backend admin menu in different languages?
- remove screenshot.png via dashboard
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- POST 429 Error when trying to place more than 20 images into post at once
- Adding more than one WordPress Gutenburg block type?
- Change meta-box title- “LearnDash Quiz Settings” to “Quiz Settings”
- Embedded Options in a Custom Metabox
- duplicate featured image functionality in custom meta box
- Custom Admin Section
- How to add custom Author Info Box to blog posts “only” and NOT custom post templates
- how to hard link to the posts page?
- issue with saving custom metaboxes fields
- after checked the checkbox in backend, dont show social link on frontend
- Admin menu disable new/delete page
- Change post template the proper way
- Adding pages to the Admin panel
- Customize Admin Section
- Get a different size of Image thumbnail while working with custom metabox
- Need Advice to Working with Custom Post Meta
- How to create functions that affect only a specific user
- Remove “minor-publishing” div from Publish admin metabox
- Create users via PHP
- How can I get the Media Library backend to show larger thumbnails?
- I want to force secondary rows using WP_List_Table
- Best collection of code for your 'functions.php' file [closed]
- How to: Easily Move a WordPress Install from Development to Production?
- Organizing Code in your WordPress Theme's functions.php File?
- Is there a flowchart for WordPress loading sequence?
- Essential technical features for high-end WordPress web hosting? [closed]
- How to put logs in WordPress
- How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?
- How to get the Date Format and Time Format settings for use in my template?
- Where are Additional CSS files stored
- Best Practices for Regression Testing WordPress Websites?
- Remove wrapping div and ul from output of wp_nav_menu
- What Is The Use Of map_meta_cap Filter?
- get post author id outside loop
- Custom Walker: how to get ID in function start_lvl
- Disable dragging of meta boxes?
- Creative uses of WordPress [closed]
- How to *remove* a parent theme page template from a child theme?
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Update widget form after drag-and-drop (WP save bug)
- Data sanitization: Best Practices with code examples
- How to benchmark a WordPress installation? [closed]
- Should I delete the default themes?
- Moving WP install from local to live, what about wp_posts GUID?
- Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
- Running Gutenberg React in Development Mode
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Setting admin edit panels & metaboxes positions and visibility for ALL users and admins
- Plugin SVN & update API – how are plugins identified?
- Users with custom roles not showing in post author select box
- How to display by default only published posts/pages in the admin area?
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- How do register_sidebar() and get_sidebar() work together?
- How do you get formatted content of a post using the WordPress API?