Trigger the click event of the publish button instead, and let WP do the work.
<script>
jQuery(document).ready(function( $ ) {
$( "#secondary-publish" ).click(function () {
$( "#publish" ).click()
});
});
</script>
Don’t use language (it was deprecated in HTML 4.01!) – you can drop type too (WP now has an HTML5 doctype).
Related Posts:
- Only allow new subpages to be created
- How to make certain page templates visible to admin only
- Group Pages based on Parent in Admin Area
- Create a “Dummy” parent page for a hierarchy in page listing?
- Restrict admin access to certain pages for certain users
- Can I display the widget admin in the page admin?
- Change admin startpage to Pages-page?
- Restrict acceess of a page in backend
- Hide page visual editor if template is selected – redux
- Increment Page Order As Pages Are Created
- Is there a way to remove or hide individual pages on the Edit Pages screen?
- Add custom admin menu item for pages using a certain template
- Too many pages causes WordPress admin to be unusable
- Hide pages depending on role
- Hide Visibility Option From WordPress Publish Metabox
- How to disable Page Attributes dropdown in wp-admin
- How to change redirect after moving a page to trash?
- Backend option to include a javascript file on specific pages?
- Dashboard–> All Pages “How to create folders?”
- Change the Default Pages Menu View in wp-admin
- Can I set a timer for pages to be published?
- Add a Menu Link (to a WordPress Page) in the Admin Menu/Sidebar
- Remove pages from backend list *and* update counter accordingly
- WordPress Admin – Add Edit link to specific page under Pages Menu
- How to use the same code for multiple pages?
- Problem With Pages Displaying
- Edit page’s “Restore the backup” link does nothing
- Removing the TinyMCE editor for a given page template
- Dash after page title
- Missing ‘Page Attributes’ in page edit
- Admin pages, edit notes of the title of posts and pages
- Can’t locate a hidden private page
- Redirect to page list when page published
- Role – edit page but not publish
- Ad custom admin page like WordPress customizer [closed]
- Adding Page URL to the Pages Admin Table
- How to use is_admin in page content?
- Disable ADD PDF media button on rich text editor
- Change page name in admin list
- How to disable delete option for a specific page? [closed]
- logout redirect only from admin page
- Need to create a custom page on a website
- How to exclude authors from get_pages()
- Is it possible to restrict access to specific pages in the admin area based on the page slug?
- Order by modified date working in POSTS but not PAGES
- way to make all pages with certain tags public?
- accessing the Admin page
- Translate dashboard metabox
- Custom user tables not working after migration
- remove “Edit” from select pages
- Page and admin doesnt load – i tried everything
- Pages in wp-admin is not found 404
- Front Page post mirroring revisions to other pages, constantly updating itself
- How do I locate a third party page represented as a slug in my WordPress website?
- Customise the_title in admin area
- Creating content using wp-admin pages
- My page won’t publish
- Adding CSS styles to Admin Area PAGES only (not POSTS or CPT)
- Firing page_publish where page is child page
- disable trashability for certain pages
- Custom admin menu for a selection of pages
- Pages redirect me to the homepage
- How to align bold,italic and underline in wp-admin?
- How to access variables from one plugin in another
- Default pages to be unpublished – possible?
- Output the published date / last modified date of specific page
- How to make a secondary Pages Screen
- Remove element from admin page editing part
- Change the color of one or more specific items on the Pages list (Admin)
- Using pre_get_posts on true pages and static front pages
- How to get page title with the page ID?
- Is there a way to change the default page template selection?
- Can I have two child pages of different parents with the same name?
- Can initial focus be set to search field in WordPress Media Library?
- foreach error on false boolean from get_terms
- Overview with latest edited posts and pages
- Export only pages and posts with mysql dump
- How can I schedule a PAGE to go live at a future date/time?
- Why do pages in WordPress have a hierarchy but menu’s also have a hierarchy?
- Custom page template with entirely different design. Is it possible in?
- My custom template page not loading content inside it?
- Is it possible to activate page template without manually selecting it in wp-admin?
- Excerpt Now Showing on the Post Page
- Add Password Generator on password protected page
- How to detect when admin user is on the All Posts page?
- Link to Particular Page Within Template PHP Code
- If I use a static page-slug.php for a page, is the database still queried?
- Admin: Custom Query Returning Permissions Error
- What’s the section of code (or loop) which retrieves the Page title and description?
- How to backup just pages from my site, but not posts with other post_type values
- Access to “My Site” is missing from the admin bar
- Put page on Archived statut after end of publication date
- Display grandchild page content on parent page
- Category Page Custom Layout [closed]
- How to copy specific page content and create child page?
- Previewing Draft shows white page, publishing works fine?
- Fresh WordPress installation not able to simply show page content
- Best approach to create a customized page
- How do you add a filter to wp-block-page-list?
- Remove 3rd party plugin notices from within own plugin