How to Hit External REST POST API in WordPress? [closed]

WordPress has several functions for sending requests via PHP, including wp_remote_post(), which you can use to send a POST request to an API. Then you can use wp_remote_retrieve_body() to handle the response. It would look something like: $response = wp_remote_post( ‘http://example.org/api’ ); $api_response = json_decode( wp_remote_retrieve_body( $response ), true ); If you need to interact … Read more

How to get title tag of an external page with http api?

here is a function i have for that: function get_page_title($url){ if( !class_exists( ‘WP_Http’ ) ) include_once( ABSPATH . WPINC. ‘/class-http.php’ ); $request = new WP_Http; $result = $request->request( $url ); if( is_wp_error( $result ) ) return false; if( preg_match(“#<title>(.+)<\/title>#iU”, $result[‘body’], $t)) { return trim($t[1]); } else { return false; } } Usage: $title = get_page_title(‘http://www.google.com’); … Read more

API for Post Stats for Self-Hosted WordPress using JetPack [closed]

There is indeed a Stats API that will allow you to access stats from a WordPress.com or a Jetpack site. You can read more about it here: http://stats.wordpress.com/csv.php http://phoxis.org/2011/04/24/wordpress-com-stats-api/ http://wpgr.org/2013/03/02/rendering-jetpack-stats/ Jetpack uses this API to populate the Top Posts widget: http://plugins.trac.wordpress.org/browser/jetpack/tags/2.5/modules/widgets/top-posts.php#L223

Stuck with wp_remote_post sending data to an external api on user registration

I recommend only setting the arguments you absolutely need to change from defaults, to eliminate potential issues while testing. It’s best to only add additional arguments as they are needed. All arguments can be found here: https://developer.wordpress.org/reference/classes/WP_Http/request/ If possible also remove the required authentication at first to just test the POST before adding in security/authentication. … Read more

how to get nonce using json api

You need to call like below. API call:- http://78.47.177.214/blog/api/get_nonce/?json=get_nonce&controller=posts&method=create_post Responce:- {“status”:”ok”,”controller”:”posts”,”method”:”create_post”,”nonce”:”92f31d49b5″}

API in numbers?

From quick run of phploc as of current stable version (4.0) there are 2662 functions in WordPress core. Structure Namespaces 0 Interfaces 1 Traits 0 Classes 241 Abstract Classes 4 (1.66%) Concrete Classes 237 (98.34%) Methods 2842 Scope Non-Static Methods 2552 (89.80%) Static Methods 290 (10.20%) Visibility Public Methods 2571 (90.46%) Non-Public Methods 271 (9.54%) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)