Actually all you have to do is changing the script part to this:
<script type="text/javascript">
(function($){
try {
$('#post-visibility-display').text('<?php echo $visibility_trans; ?>');
$('#hidden-post-visibility').val('<?php echo $visibility; ?>');
$('#visibility-radio-<?php echo $visibility; ?>').attr('checked', true);
} catch(err){}
}) (jQuery);
</script>
You see there is an additional line compared to your code. I’m referring you to my original answer for more information, this is element of the second – 2. – part of the answer.
Related Posts:
- Set posts of a custom post type to be private by default?
- Redeclare/Change Slug of a Plugin’s Custom Post Type
- Sort search results by post type
- Display a query with multiple post types and same relationship on a single page
- echo value from ‘select’ field type into page template using cmb2?
- Exclude add_filter from the admin
- How do I add a custom post type to the Featured Content in twenty fourteen theme?
- Saving multiple Metabox contents
- Is it possible to insert text into an html tag using functions.php?
- Custom user role not working as expected
- Custom post type loops with different page templates
- Limit Authors to their Own Posts on front-end excluding admins
- Multiple Content Block
- Unable to save or update postmeta for custom post type via action using save_post hook
- How to: add option to add more checkboxes on custom post type
- Allow Users Access to Custom Post Type Only
- How do you output custom code between posts in the loop?
- Disable comments from showing up public for Custom Post Type
- How to get Custom Post ID by adding filter to child theme’s function
- Making a Custom Post type only visible to non-users via a specific link
- Output custom post shortcode. Help spot the error.
- When ‘is_post_type_archive()’ return true?
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- How To Enable Block Editor (Gutenberg) for Existing Post Type via functions.php
- Modifying Custom Post Type after registration (will it affect content?)
- Create a post in custom post type using field in registration form after users submit form
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- right_now_content_table_end function not working?
- wp_insert_post generates endless posts
- How to customize a permalink (URL) structure?
- Can’t edit custom post type
- How do I display content to users who are not logged in instead of 404 on Private custom posts?
- PHP variable not regenerating when publishing multiple posts at the same time
- How to target a specific custom post type post and its all children and grandchildren?
- get_post_meta not working on publishing
- WordPress wrapped added a span tag to every single p tag
- ACF field key/value to show on taxonomy list
- Re-registering a custom post type not working (not showing up)
- Best way to style first post differently?
- How to make custom posts types display when published for the future
- CPT archive admin menu label
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Add term to custom post type on draft
- How to assign classes to all elements?
- Different Category system needed for the Custom Post Type
- Template not working for the custom Post type
- Featured Image field not appearing in Custom post type
- Loop increase number
- ACF in wordpress
- Change Slug of a Custom Post Type
- List of all entries of custom-post-type: Add year-parameter?
- Add an Outside Wrapper to my Header and Make it Full Width
- How to inherit field value from parent post into in child / sub post
- Custom post type’s posts are not showing anywere but in xml sitemap
- Removing full title and breadcrumb header container for a specific post type
- Show current user posts in custom post type query
- Rewrite permalink for multiple post types (CPT) with taxonomy term
- Custom post type in Custom widget – $listItem
- Meta box not appearing in my custom post type
- Function to erase every post from a taxonomy
- Redirect to URL if x number of days passed
- Display author box on just certain category posts?
- Function to allow single post template based on custom taxonomy?
- redirect after submiting post for review
- How to divide Subcategories into pages of parent category wordpress
- how to achieve this permalink abc.com/CPTName/CustomPostTypeCategorySlug/categoryname
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom Form / Search with Custom Post Type Data
- Create WordPress User in backend, and automatically create a new post in Custom Post Type with user uame as the Title in the post
- update custom taxonomy custom fields
- Different number posts per page based on custom post type term id
- how to display author name in custom post type
- Forcing two or more custom post type to be private
- Persist meta box choices throughout all posts of same post type
- How to get current post type?
- How to convert Post Object Custom Field into Tags
- Why is wp_list_authors not picking up Authors from CPT’s?
- Change Search display for Custom Post Type
- Create dynamic logo carousel without using any plugin
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom Function to redirect singular post if specific meta field is empty
- fusion builder missing from custom post editor
- Stored meta from attachment, video length?
- Duplicate posts in my custom loop
- Featured image in custom post is being disabled
- custom post type does not working when adding in child theme function
- call_user_func_array() error after moving to another server
- How can i call a custom method on submission of a custom plugin post type?
- Updating User Meta from Custom Post Field Upon Publish Not Working
- I want to split this into two functions
- Generate daily archive whenever any post type is added
- Invalid Taxonomy in template
- Custom post type functions.php if statement on action
- Add HTML before a specific div?
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- How to make a non-public post on wordpress approval?
- add_rewrite_rule not working with custom post type
- I want to show a list of post with title that have link goes to that post and icon under the specific category to which it belongs