Here you go:
class UrlToTitleConverter{
public function convert($Url){
$response = wp_remote_get($Url);
if ( is_array( $response ) ) {
$body = $response['body'];
$title = substr($body, strpos($body, '<title>')+7);
$title = substr($title, 0, strpos($title, '</title>'));
}
return $title;
}
}
Related Posts:
- register_rest_route, Compare purchase codes and send a response
- What’s the net::ERR_HTTP2_PROTOCOL_ERROR about?
- Uploading media with the REST API
- cURL 28 error after switch from to brew php 7.2 on localhost
- Metabox repeating fields – radio buttons not saving correctly
- Creating a post with the REST API, curl and oauth returning 401 error
- How to remove a metabox from menu editor page?
- Why is my custom meta box input not saving
- add_meta_boxes action with refresh on save
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Second select list values are not saved after clicking update
- Saving metabox repeatable fields
- Use wp_remote_get to get JSON instagram feed from public profile
- Browser title script ignoring is_page /else conditional [closed]
- wp_editor and WPAlchemy messes up tags when updating
- Creating login session via CURL
- Register non hierarchical taxonomy and the show meta box in the post type
- Customize Plugin
- Where Does WordPress Make cURL Requests? How To Add cURL Option
- How to select the contents in the text view textrea in wp_editor?
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Image media upload metabox
- Loop with slider (slider not loading)
- Linking text within textarea of custom meta box
- export a csv file from the database with a cronjob
- Programmatic Login from 3rd Party site
- Need Help Fixing My Iframes [closed]
- Remove metabox from WordPress menu editor page?
- MetaBox body is not showing (the callback function)
- get post content of particular post by url
- Trying to retrieve post meta
- can i fetch a custom metabox data in another page or post type?
- Limit checklist by the current user
- How to convert select to HTML with PHP tags inside of it [closed]
- Sanitizing text fields in array
- Saving zero in meta box
- Show meta box only for default page template
- Illegal string offset in PHP function
- Find a way to retrive data updated through metabox plugin to web page
- REQUIRED: get_bloginfo(‘template_url’) was found in the file search.php. Use get_template_directory_uri() instead
- Why does this update_post_meta function not delete the custom field itself?
- Metabox Not saving data
- meta box not display data input in the textarea
- Usage of call back function of add_meta_box()
- WordPress transient not working with WP Engine
- How to send a HTTP Post request using PHP Curl and WordPress
- How to store multiple custom meta box
- Show metabox only for homepage
- SOAP Request/Parsing XML From wp_send_json_success
- Add editor toolbar to Metabox
- REST API works in browser and via AJAX but fails via cURL
- cURL error 6 on news area, and also won’t auto update
- Warning: call_user_func() expects parameter 1 to be a valid callback, function
- Post to WordPress from another Server via PHP
- How do I make this Metabox show current DB value?
- How to insert data from metabox to custom table
- save metabox with new values _wp_page_template
- Accessing an API with jQuery and AJAX
- Unable to Call More than One Meta Box Output
- Dynamically replicate custom metabox in custom post type
- Post meta select input, if statement
- calling admin-ajax.php from admin-ajax.php
- Display background color or image with custom meta box?
- save_post action inside a custom metabox class not working
- Meta boxes only displayed when editing normal (default wp post_type) posts
- Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page
- Checkbox doesn’t save inside metabox
- Can’t put a hyperlink on Featured Post’s Image
- Rewriting to a different page based on existence of query string?
- Custom meta box save values issues – Deprecated: Function ereg() and more
- custom field meta-box with dropdown/autocomplete
- Display a post based on its metabox selection
- Save data of select list after clicking save
- Repeatable field within repeatable group of fields
- Help with my first Metabox helper class
- Custom Meta Boxes and Fields Multicheck Issue
- If custom field doesn’t exist, or exists and it’s true show title?
- Hide sharing box and author box with a metabox on WordPress
- Metabox Input Not saving
- Creating a function that sanitizes the custom metabox excerpt
- How to callback custom field text
- How to Publish WP original Source metabox value on front-end webpage
- Where can I find the code for the menu page meta boxes?
- Custom Meta Box If Else Statement
- PHP Puzzle: Unique Styles with PHP loop
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- Display custom meta box in my template file
- send meta box input data without publish button
- metabox displaying on incorrect page
- get_page_by_title() doesn’t return the post object if the title has inverted comma (‘)
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- if is specific custom post in cpt
- Warning: Illegal string offset ‘post’ and ‘page’
- REST API custom endpoints for metaboxes
- Save Edit button then disabled readonly metabox
- How to get meta box labels?
- What is different about using admin-ajax.php in an endpoint and just submitting a form from the front end?
- cURL running slow in WordPress
- Trouble Sending Elementor Form Data via cURL in WordPress
- Authorization and execution of the link