We can improve a little bit with :
function specific_enqueue($hook_suffix) {
if( 'post.php' == $hook_suffix || 'post-new.php' == $hook_suffix ) {
wp_enqueue_script( 'custom_js', get_template_directory_uri() . '/inc/meta/custom.js', array( 'jquery' ));
wp_enqueue_style( 'custom_css', get_template_directory_uri() . '/inc/meta/custom.css')
}
}
add_action( 'admin_enqueue_scripts', 'specific_enqueue' );
Related Posts:
- How to validation for sanitize_URL?
- Custom field/meta populated by dropdown of existing posts?
- What is the index [0] for on post meta fields?
- Gutenberg add a custom metabox to default blocks
- ‘Preview Changes’ for custom meta boxes?
- Add metabox to document tab in gutenberg
- Custom field metabox not showing in back-end
- How to hide meta box values from custom fields list?
- How can I avoid re-inventing the Custom Fields wheel in my Plugin’s Metabox?
- Unable to get Preview of Uploaded image within a Custom Meta box
- Using media-upload.php to upload mp3 via custom fields
- How to store the value of a custom field dropdown select for post referencing?
- Only show metabox when date-value in other metabox is over?
- Custom Meta Boxes: Store two values in one repeatable field
- Problem in custom meta boxes
- Multiplile values checkbox or select in custom meta box
- Adding a custom field or metabox to the post-thumbnail widget?
- Custom fields to save multiple values
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- My metabox class
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- wp_editor() usage in custom meta box
- Woocommerce with metabox plugin
- wp_editor removes paragraph from custom meta box
- Understanding and using metaboxes in posts
- How to check for specific meta box value on front end and output accordingly
- Where did the Add New Custom Field go?
- How Meta Data is different from Custom Fields of POST/PAGE in WordPress
- Admin meta Image Path
- Tweak Meta for Post to work it for Pages also
- Users Select inside custom metabox
- Custom Metabox Not Saving
- how to fetch the meta field keys/meta boxes from a post type?
- Should custom meta boxes be able to output shortcodes the same as WordPress’ native post editor?
- Can’t get metabox value (a url) returned using WPAlchemy
- Custom Field created in add_meta_boxes reappearing itself again in the default Custom Metabox
- Custom Meta Box (SELECT) Not Saving
- Get updated meta value after post update or published (custom post type) using hook
- Why is my Custom Meta Box Field Inputs NOT saving?
- custom-meta-box checkboxes from loop won’t save
- Outputing a metabox textarea and avoid line breaks inside li tags
- Display Custom Meta Box Field Only If Value is Present
- shortcode in a custom metabox
- Problem with saving large amount of data in postmeta/usermeta
- Move Title and the Content WYSIWYG editor position
- How to use media upload on metabox post page without breaking TinyMCE?
- Displaying Meta-Box Data Properly
- Let’s Create Custom Field Template Documentation
- Scripts and tags will not save or output from my custom meta box
- Using WP Color Picker in Repeatable Fields
- MetaBox not saving after empty
- Can I save post meta programatically without setting metaboxes?
- How do I save Multiple fields in a meta box?
- How to load script conditionally on custom field in wp_postmeta?
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- Custom meta boxes not saving
- Get meta field value of all catgories
- How to store meta field values
- Show array of meta_value in Edit Post Coloum
- How to display data from custom fields I created?
- Custom Field & Gravity Forms [closed]
- Working with multiple values and metaboxes
- Move the metaboxes to the very top of post editor
- Set class if a meta value is set within post archive
- WordPress Blocks, setAttributes not saving
- Using Customizer API vs Custom Meta Box for custom content
- non-unique #_ajax_nonce id in browser console
- Allow HTML in Custom Metabox area
- Metabox/Custom fields are not saving input data
- add meta box considers the selected option as post parent
- Custom field metabox not showing in back-end
- Issue on Creating Checkbox Field On Custom Post type
- WordPress admin area: select box with 12.000+ options
- How do I display a custom field in an existing form on the front end?
- How to display selected option from dropdown list in a metabox
- Save, update, get and sanitize post meta as HTML not plain
- Why does this javascript search function in the WordPress Admin not work?
- Create Meta boxes dynamically
- Update custom table on metabox POST
- Save input form on custom field
- Metabox value for post loop?
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Get meta value when the page is a blog archive
- Search form to find custom meta box generated data
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- wp_postmeta are updated for only one page
- Meta Box Data added to header redirect
- Add custom field to existing meta box?
- Custom metaboxes not saving after switching themes
- Custom Metaboxes, multiple post selection
- I want my post to republish again after adding a custom field
- added a meta box to post however when saving menu while debug on throws a warning
- Get fields from metabox array
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- Display custom field value into content with hyperlink
- Using CMB2 Plugin to create text_date metabox (datepicker) How do I save multiple dates? [closed]
- Dynamic background image used in css after selector
- How to add new Metadata options (Date, Author, etc.) for Posts?