Add a meta box to your custom post type edit screen to contain your markup. Check the $pagenow
global to only show it on post.php
, not post-new.php
, and check $current_user
global for administrator role to exclude other user roles.
Also, if you aren’t familiar, check out the $wpdb
class for your queries, and read up on using AJAX in WordPress.
EDIT use get_current_screen
and current_user_can
rather than dirty, dirty globals, as @TheDeadMedic suggested in comment below.
Related Posts:
- Customizer field value into functions.php variable
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- How would I correctly implement a new if statement in a child functions file?
- How To Show Shortcodes In WordPress Custom Fields?
- Cannot save CPT meta box
- Default Custom Field Value Automatically Update
- Move Custom Fields on General Settings Page to New Location
- Skeleton Child Theme Add Icon Bar to Header Flex Grid
- WordPress function saves a post twice and updates all posts
- Redirect to another page using contact form 7? [closed]
- ACF not showing
- different style sheet for just one page template
- How to retrieve the values of a sub-field in the first and last row of an (ACF) repeater inside function?
- Condition OR for current user ID
- How to get correct value from checked()?
- How to retrieve the current post’s generated featured image size?
- Prevent custom field from being updated after first publish
- Where do I store custom functions that call custom page template files?
- Why There Is No “get content by ID” Function
- Custom HTML markup
- Use a shortcode to display custom meta box contents
- Wp-query Order By problem
- Create custom function for hero image
- Randomizing wp_tag_cloud() in child theme
- login_headertitle is deprecated since version 5.2.0
- How to append classname to body tag if guest user
- Programmatically add Yoast meta description after post save
- Where do I go to edit this area? [closed]
- Replace plugin function with a custom function?
- Add attribute only to first image of every post via functions.php
- Different favicon on different pages
- The_content and Preg_replace in loaded Iframe [closed]
- Insert Address fields into function
- How to make custom comment fields required
- Problem with images URL after filter applying
- How add body_class from wp_termmeta
- two search forms on the same page
- Function to replace comment’s accented characters before posting
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- Sort and display pages with specific custom field (not tag)
- shorthand syntax for custom fields
- Insert a field with PREG_REPLACE – strange behaviour
- Fill empty custom field with other custom field
- How to echo Widget Title in Custom Frontend-Template Box
- New checkbox in custom widget isn’t saving data
- Linking Javascript in functions.php file
- how to display a page before the home page
- loginout function customization
- Perform function on publish AND save (not just save)
- Function to check if custom page is used by page?
- implementing a centralized content “show-do-not-show” toggle?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- Odd functions.php issue in WordPress
- How to display this meta data (an array) in form of a function (created with a custom write panel)?
- WordPress – using sessions?
- Customise Grouped Product display in Woocommerce with custom column
- How to Display WooCommerce Product Price in WooCommerce Archive
- How to change text color depending on the number value (Using javascript)
- Custom Form / Search with Custom Post Type Data
- How to remove font awesome from loading in wp theme
- wp_set_object_term via js btn frontend
- Trying to update Woocommerce meta values
- How to replace ACTION url from original wordpress login form?
- Populate Product Regular Price with a calculated ACF Field Value
- Header menu aligned right on all pages except for single-post page [closed]
- Save_post – Warning: Cannot modify header information
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- Modifying a WordPress Plugin
- CF7 select value get to function and reciept value from function
- Hide author info in single posts by certain users
- External api call and make global variable for any page visitor enters , page-home, page, single etc
- CSS style and app.js not loading
- Parent category as WOOCommerce Categories widget title
- Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
- Shortcode to insert default text and change one word throughout it?
- I want to customize the_posts_navigation function by replacing prev and next with images
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- Create New User Custom Field not Saving
- Creating a “Related Meta” type field?
- Hide empty custom field
- Woocommerce custom calculation function
- Remove all video attachment, both files and post/postmeta from database?
- WordPress Ajaxifying not working properly
- WordPress function with attribute pass to template
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- True email confirmation for registration (keeping unvalidated users from user table)
- Replace image attributes for lazyload plugin on image elements with specific class
- Adding A New Widget to WordPress Disables the Existing Widgets
- Help! Need a different logo on my main page from my other pages
- Display page number on custom page title function
- How to echo the translated custom field?
- How to add function to custom fields when page/post has a password?
- How to make an If Else on Excerpt Filter
- How to exclude posts with empty and non-existent relational custom field with meta_query?
- How to replace words in my posts and saved new words
- Post date on Custom field
- How do I integrate my Child Theme into a Custom Template?
- Shortcode to eliminate and replace with
- Dynamically generated Navigation Diagram using Custom Fields
- Add functionality to post editor