Use the following code into your functions.php
file.
function change_title_yt( $post_id ) {
$current_title = $_POST['post_title'];
$doc = new DOMDocument();
$doc->preserveWhiteSpace = FALSE;
$doc->loadHTMLFile($current_title);
$title_div = $doc->getElementById('eow-title');
$title = $title_div->nodeValue;
$my_args = array(
'ID' => $post_id,
'post_title' => $title
);
if ( ! wp_is_post_revision( $post_id ) ){
// unhook this function so it doesn't loop infinitely
remove_action('save_post', 'change_title_yt');
// update the post, which calls save_post again
wp_update_post( $my_args );
// re-hook this function
add_action('save_post', 'change_title_yt');
}
}
add_action('save_post', 'change_title_yt');
Related Posts:
- Add Link Text Back to Insert/edit link Box
- plugin admin subpage title and links in menu not highlited at current page
- Change description of my Jetpack facebook shared links [closed]
- Add the title attribute to links
- remove the title attribute from links [closed]
- Disable title link in the backend for non-admins
- Why is there a link tag with rel “profile” pointing to gmpg.org?
- Wondering how to turn your firefox bookmarks into a WordPress blog?
- How can I link to the most recent post in a category?
- How can I find all internal links that are pointing to post/page?
- Creating a Link Directory using WordPress?
- How to splice in wp_links links into the loop?
- widget to output a link to archive view
- Is there an easy way to create a links index page?
- how can i add a menu link that goes to an external page
- Retrieving all Links from a Post?
- Open link in a new tab checked by default when adding a new link in visual post editor
- Setting a page link in the footer?
- Generate Random Post Links Somewhere in the post
- Getting only the most recent bookmark?
- WordPress links/bookmarks – need to urlencode because spaces are getting stripped
- Plugin that inserts favicon next to links
- Create anchor from Wysiwyg editor
- Get post / page ID from ACF Link field
- Can I generate then display a mixed list of linked and unlinked terms
- Make page tab link to pdf
- How to change server name on WordPress Installation?
- How to prevent a page from being linked in the menu/crossbar
- Automaticly replace a link with other “new link”
- Is there a way to hide WordPress behind a web visible directory?
- Links in nonalphabetic order
- Copy button for anchor link
- Removing Title From Links to Site
- How to automatically nofollow a set domains? (I seem to have half of the answer)
- My custom link works only on home page
- Default Link for TinyMCE “Add Link”
- How to apply default post categories to link manager plugin
- How do I get link URLs from the WordPress links backend into an array?
- Is there anyway to use relative link instead of absolute link?
- How can I show different image links for different languages with qTranslate?
- How do I hide the ‘Edit’ link in publshed posts
- WP Method `get_theme_file_uri()` Doesn’t Seem To Be Working Properly When Used In The Head Section Of A Site
- how do I get rid of the links and all the links related menu items on the admin ui?
- How do I make WordPress “Page” link in the top nav bar go to an external URL?
- How to deal with internal links in blog while developing new site in WordPress?
- How to remove massive link in WordPress content
- Delete all href attribute in WordPress posts
- Alternative to rb-internal-links to implement [intlink tag?
- How to remove a link of date archive
- Button linking to an unique link
- Highlight archive link on single.php
- Dynamic logo/banner depending on affiliate link
- Add class to all links created by tinyMCE
- How do i remove all Bit.ly shortened links from site?
- Converting a hierarchy of off-site web-links to Word-Press
- How to make a random dynamic url?
- How to find what pages are internally linking to a page?
- WordPress does not show correct page
- Bulk change link to pdf’s
- How can I automatically display the section link on my one-page Elementor website?
- White image when I share my site
- How to track which users click link/button?
- Disable automatic embed links
- How to add a column into the link manager?
- Link Dont work in first page Hero image
- Getting duplicate homepage links | Even if there is only one page in Dashboard Please Help
- How to change the canonical link from a category or taxonomy archive?
- Add Developer Link on Homepage Only
- How to add a target to a link
- How to mask external download links to be only accessible by logged-in users?
- Content -> Post is easy, but Post -> Content is hard
- How to use the WordPress API to get links and scripts in and
- how to link local pages with flags in submenu
- Best practice and technology to Offset anchor links
- Unwanted Autogenerated Link
- My home page is still showing link “localhost” [duplicate]
- List pages including both parent and child pages
- Anchor link on single.php
- Unable to create hyperlink after WordPress updated
- Anchor doesn’t work if it’s given in the url
- Adding Edit subnav link to Custom Buddypress Profile Tab [closed]
- What could interfere with changing iframe contents with href?
- Link rewrite to https (NOT URL rewrite)
- random characters on links
- Detect what page was linked-from
- link header to homepage (for wp multisite)
- Logout link not working
- WordPress is adding rel=”nofollow” and target=”_blank” to internal links in posts and pages
- insert link in wordpress editor greyout whole screen?
- External Link issue in Visual Form Builder Pro
- Link to Portfolio page by id instead of name
- How to Link to WP Pages Internally and Extenally
- permalink and $_GET
- What is the right way to code links for WordPress pages?
- pictures does not apeare in posts
- Access the article edit page from the web address bar?
- Is there any way to display the link of a WordPress page without relying in its slug (or full path)?
- What is making these links open as new windows?
- Trying to chance my link style
- How to have all RSS feed entries linking to the same specific page