June 2017
Beginner to intermediate
368 pages
8h 31m
English
Rather than going into the details of how we can send HTTP (or HTTPS) requests to WordPress, let's use a free third-party library to do this work. The code I'm going to use is based on Abraham Williams' twitteroauth library (see https://github.com/abraham/twitteroauth). The two files we need are OAuth.php and BasicOAuth.php. To use the library, you will need to add the following lines to the top of /wordpress/auth.php:
require_once($CFG->dirroot . '/auth/wordpress/OAuth.php'); require_once($CFG->dirroot . '/auth/wordpress/BasicOAuth.php'); use \OAuth1\BasicOauth;
Always attribute any third-party library you include with your plugin. That means including a thirdpartylibs.xml file that specifies the libraries we are bundling ...
Read now
Unlock full access