This is a javascript issue. on line 52:
$ret .= '<script>jQuery(document).ready(function(){ jQuery("#videotype").val(' . get_video_field("videotype") . ') });</script></div>';
In this specific bit:
.val(' . get_video_field("videotype") . ')
The value isn’t quoted, so it’s trying to reference a variable named youtube
or vimeo
, which doesn’t exist, instead of a literal text value.
If you add quotes it’ll work, note the addition of double quotes before and after the single quotes:
.val("' . get_video_field("videotype") . '")
So the whole line will be:
$ret .= '<script>jQuery(document).ready(function(){ jQuery("#videotype").val("' . get_video_field("videotype") . '") });</script></div>';
EDIT-
In your template, these two lines:
$videotype = get_post_meta($post->ID, 'Video Type', single);
$videoid = get_post_meta($post->ID, 'Video ID', single);
Should be:
$videotype = get_post_meta($post->ID, 'videotype', true);
$videoid = get_post_meta($post->ID, 'videoid', true);
Related Posts:
- How do I ensure that post_type and Taxonomy use the same slug?
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- what is the correct way to compare dates in a WP query_posts meta_query
- don’t publish custom post type post if a meta data field isn’t valid
- WordPress Custom Post Types with a page as a parent?
- Search multiple custom fields by using meta_query
- Custom post status not working
- Search that will look in custom field, post title and post content
- Get custom post type by category in a page template
- Add custom field to media attachment image attribute in post editor
- How to select one major category (or custom taxonomy) for a custom post type?
- Custom Post Type with Custom Title
- How can I customize “Pages” admin (edit.php) and “Edit Page” admin (post.php) for bulk edit of custom content type?
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- WP insert post PHP function dynamically generated Custom Fields
- Error after deleting Custom Post Type with a function (no trash used)
- How do you output custom code between posts in the loop?
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- Related links – from other sites
- Saving repeated option values in a custom query
- Conditional to modify query results
- Create a random unique 6 digit number as custom field for custom post type
- Assigning the same custom meta box to multiple post types
- Dynamically add / duplicate custom meta in custom post types
- How to insert content from another Custom Post type into Post?
- Using several custom fields as custom post title
- Get rewrite slug of custom post type in template
- Weird problem happening with custom taxonmy when creating/updating posts
- How to structure a site with product variations pages?
- How to customize a permalink (URL) structure?
- Replace text in post from cvs
- Why is my select meta data not saving?
- Query & Order posts by custom fields
- get_post_meta not working on publishing
- Using custom field content as expression in IF statement [closed]
- Cannot save CPT meta box
- Displaying custom field according to date
- don’t publish custom post type post if a meta data field isn’t valid
- Redirect to another page using contact form 7? [closed]
- Add additional field to custom post_type
- custom post data – how to
- How to customize work area / admin area in a custom post type without plugins?
- How to display custom field value on page?
- finding and using post type fields in WordPress
- echo selected value from dropdown
- Get data from PHP to JavaScript to set position of each post on front page
- Creating a non-hierarchical Taxonomy that behaves like categories
- Display custom post type for specific user
- post_content is stripping HTML when adding a new post? [closed]
- How do I show my containing my custom field ONLY if there is a set value on that custom field? [closed]
- CPT Repeatable Fields + Undefined Index
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Need to have an archive widget which organizes and displays a custom post type using a custom date field
- Let users upload image(s) to the post from front end
- How to hide a custom field from admin?
- How to keep a record of changes to a custom field?
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate [closed]
- How can I sort the order of multiple custom field values in a custom post type?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- Custom Form / Search with Custom Post Type Data
- Custom fields array to display it monthly
- Adding a location field to buddypress activity
- Why is my custom post content only viewable when signed into WordPress?
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- Auto update publish date of CPT Post if default post custom field value match to cpt post CF Value
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Sort custom post column by generated value?
- when looping through custom post data not appearing
- How to limit the number of custom posts certain users can publish in WordPress using php script?
- How can I fetch all the dates from custom fields from various different custom post types and show / list them at one place in ascending order?
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- Displaying posts inside table having issues
- Automatic Set Category For A Custom Post Type
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- Stored meta from attachment, video length?
- PHP Notice: Unidentified index
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- WordPress query posts by custom post type not workng
- Can’t pick up a field created with Advanced Custom Fields
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Get month and day from a Date Picker custom field
- Function not pulling image or text from custom post type
- Show Custom Post Type taxonomy term that matches custom field
- Order by custom field attribute
- Repeatable custom meta select boxes
- How can i display on front page a movie that is atached in a post type
- Inserting two categories
- How do I filter a custom post type loop by a field?
- Get custom post fields and display them
- Exposing custom fields to the user in custom type post
- Creating post custom field text area
- Send email on creation of custom post type and use get_post_meta()
- Sort CPT by taxonomy AND THEN by custom field
- How to display *block number* instead *date value* on WordPress posts?
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- is therer any wordpress function to retrieve a specific html element from post content
- Custom Sort Order for Custom Post Type Taxonomy