The very concept of HTTP API is to make sure transport will be done. It basically uses 5 different transport methods and it chooses the best one according to your server config. So it’s unlikely a compatibility issue with wp_remote_get()
and your server.
Plus if WP is not loaded, adding an action won’t help, it will fail the same with undefined function error but this time on add_action
.
So basically you’re missing WordPress, for test purpose you could do this (assuming your file is at the root of WP installation ) :
<?php
require_once( 'wp-load.php' );
$response = wp_remote_get( 'http://www.domain.com/mytest.php' );
print $response ['body']; ?>
Related Posts:
- How do I use the WP image functions in a page template?
- Conditional tag is_page with a custom post type
- What is the criteria for pluggable functions?
- How to overwrite / extent wordpress function is_email
- Use register_setting() in a loop
- How to edit the Tags within the image file URLs?
- the_posts_pagination() function returns missing page numbering on some blog pages
- Filter an WordPress Function in (general-template.php)
- Why There Is No “get content by ID” Function
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 9967617 bytes) in …\wp-includes\functions.php
- how get number of twitter followers in wordpress
- Login cookies blocked after customizing hashing method
- “Conditional query tags do not work before the query is run. Before > then, they always return false. “
- Override default password nag in WordPress
- is_preview() always return false
- plugins_url vs plugin_dir_url
- Get list of years when posts have been published
- Redeclare a function in a child theme
- Where and how to put inline js in pages
- Is it possible to remove the “standard” post format?
- Do WordPress’ cron’s clean up expired transients?
- How to add first name & last name to default registration form?
- Masking logout URL
- How can I programmatically create “child” pages on theme activation?
- Warning/Notice about functions.php
- How to include one class/instance without using global variables
- Is checking whether the blog is installed necessary?
- Replace Archive Widget Link Text
- How do I deactivate a plugin for some roles
- wp_enqueue_script add integrity parameter
- Passing arguments to my function with do_action and add_action is not working
- How to find the source of the text for wordpress website? I want to change that text
- Count total number of images in post and echo results as number
- change in form-checkout.php by using code in functions.php
- List child pages of specific page using shortcode
- How to make child theme inherit parent custom theme options [closed]
- when I fetch data from remote mysql database in wordpress built in wordpress function is not working?
- Adding HTML to the end of every post with the Block Editor
- Can I hide certain upload folders in media library [duplicate]
- Function issue with Walker_Nav_Menu [duplicate]
- Conditional read more adjustment
- wp_nav_menu, walker class, categories as classes of li
- Calling a Function in Functions.php from an external PHP script
- Including a specific Javascript Script in a template. Is my code correct?
- Custom shortcodes not inserting into visual composer columns
- Adding a colorbutton in tinymce dialog with current api
- Add custom function to a theme with child theme’s functions.php
- Post meta not updating
- append to existing parent theme function
- Get category URL for current post
- How can I get the post id from within functions.php
- Check if Page Slug Exists, then display that Page’s Title
- Why doesn’t is_page(id) work in functions.php?
- I have problems with loading javascripts
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Function to alphabetically sort custom post types creating duplicates
- Dropline menus — seperators between children only?
- Echoing function into WordPress NextGen gallery
- get_post_meta() problem again
- Update users custom profile fields
- does wp function the_content(); accept another tag inside
- How to parse a shortcode within a shortcode?
- Variables not showing in short code
- Add back in child theme what the parent theme removed with remove_action
- Prevent loading of functions
- WP Customizer API loaded into functions.php
- Get term slug by term id and then explode it
- Shortcode question
- call_user_func_array() expects parameter 1 to be a valid callback, function
- the_widget() inside functions.php
- loginout function customization
- define css class in functions.php
- Adding tables to the WordPress Editor
- Add Login and logout buttons to top menu bar
- Dashboard blocker on network multisite for specific user roles
- implementing a centralized content “show-do-not-show” toggle?
- Load templates, pass arguments, and render output from functions.php
- How to load a css file depending on the current role
- How to change images url in function.php?
- How to add HTML into error message
- Add a word after the post url if it is within a specific category
- Probleme shortcode with list author
- Security when outputing wp_oembed_get code
- How to show only specific category post by user role without plugin and restrict all other cats
- Function for Sticky Post on Categories causes issues with 404 behavior
- Unable to declare AOS library in functions
- Get value of pre-populated Gravity forms field as variable in my function
- Removing sanitize_title_with_dashes Function with The Real Title
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Graphic before title – Specific Category
- Edit meta fields from within template
- What to do to have access to WordPress functions
- Adding a meta box fields to child theme options page
- Changing the color of post title [closed]
- How to programmatically GET (to know) which Sidebar (or) which Menu is being used on Different Pages?
- WordPress not performing direct update
- Remove theme, change theme button and WP version on “Right Now” admin dashboard?
- Making an under maintenance page (without using plugins)
- Image width issue in IE [closed]
- woocommerce_sort_product_tabs() expects an array