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?
- Individual Widgets per Page
- Gutenberg add a custom metabox to default blocks
- ‘Preview Changes’ for custom meta boxes?
- Using TinyMce with textareas in meta boxes on custom post types
- add meta box – custom field : which to choose?
- Is it preferable to use custom code to create metaboxes instead of plugins (such as ACF) and if so why? [closed]
- Values entered in a meta box aren’t saved
- How add multiple wp_editor_box to new post
- 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
- Displaying pages with a specific custom meta
- 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?
- Enable a short code in the custom meta field
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- If metabox has content display content
- put saved metabox values back into fields and then display on the front end
- Custom meta boxes not saving
- HM CMB: Role Select
- Get meta field value of all catgories
- Custom metabox not working
- Trying to implement AJAX into my admin pages. Am I improperly enqueue and localizing my scripts?
- How to store meta field values
- Meta Box Plugin Cloned Fields – Multiple Foreach values
- Show array of meta_value in Edit Post Coloum
- How to Convert Custom Fields from Text to Array?
- How to display data from custom fields I created?
- Display metabox title for custom fields with values
- WP E-Commerce Custom Meta > Serialized array
- Custom Field & Gravity Forms [closed]
- Make separate text boxes for separate WordPress Custom Fields
- Working with multiple values and metaboxes
- show a specific metabox dependent on the page template
- Gutenberg add a custom metabox to default blocks
- Making custom meta box required (with error message if not filled in) on Gutenberg
- HTML for adding a meta box (basic text field) to page editor?
- Move the metaboxes to the very top of post editor
- How to improve my non-unique metadata MySQL entries?
- Set class if a meta value is set within post archive
- Adding text box with add_meta_box
- Add forms dynamically in admin pages?
- WordPress Blocks, setAttributes not saving
- Using Customizer API vs Custom Meta Box for custom content
- non-unique #_ajax_nonce id in browser console
- How can I ‘check’ the “custom fields” box from the Screen Options?
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- Problem with multi checkboxes value in metabox?
- 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?
- get wordpress post loop by meta box date
- Create Meta boxes dynamically
- Update custom table on metabox POST
- Sub Field of File Field
- 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?
- If metabox fields has content display content
- Append custom field items to content from plugin
- Get meta value when the page is a blog archive
- Can’t save meta field value if the title not set
- Display Data From This Custom Media Upload Meta Box?
- Search form to find custom meta box generated data
- When post is updated, custom metadata in text area field is overwritten
- Call the latest posts from a custom field group to be displayed on front-page
- Custom Meta Boxes and Fields for WordPress: Change directory upload based on user-edit page
- wp_postmeta are updated for only one page
- My meta boxes update wp_postmeta of posts but not of pages. What is wrong with the code?
- Meta Box Data added to header redirect
- Can i categorise my meta box?
- 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
- When editing a post with a custom meta box the values aren’t displaying correctly
- Use Metabox to enter Post Title
- Include custom fields into the content of a regular page
- Get fields from metabox array
- Creating an If/Else statement using WPAlchemy MetaBox radio boxs
- How to get the value of particular get $meta value in wordpress
- 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?
- Saving multiple custom meta box fields
- Custom fields empty after refreshing page
- doesn’t save custom meta box data wordpress