This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('init', 'set_allow_origins_header'); | |
| function set_allow_origins_header(){ | |
| // You can change the origin domain by removing * and replacing it with a valid domain. | |
| header( 'Access-Control-Allow-Origin: *' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2 | |
| $ tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2 | |
| $ mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf | |
| // In case you got the issue | |
| // wkhtmltopdf: error while loading shared libraries: | |
| // libfontconfig.so.1: cannot open shared object file: No such file or directory | |
| // | |
| // run the command below: | |
| $ yum install urw-fonts libXext libXrender fontconfig libfontconfig.so.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require( 'Client.php' ); | |
| require( 'GrantType/IGrantType.php' ); | |
| require( 'GrantType/AuthorizationCode.php' ); | |
| const CLIENT_ID = 'o1456R0uz7yv7C48wAgHdNogBF48oL3MN8STZSnz0W47z8g5Iw'; | |
| const CLIENT_SECRET = 'MWjbcUQh2e361QeUJeN7NN3SVD0bIJHuF1FSVw9YLd5N3jHNyu'; | |
| const OAUTH_SERVER = 'http://wordpress.dev/'; | |
| const REDIRECT_URI = 'http://oauth.dev/oauth2-client/index.php'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class onx_childpage_widget extends WP_Widget { | |
| function __construct() { | |
| parent::__construct( | |
| 'onx_childpage_widget', | |
| 'Child List Widget', | |
| array( | |
| 'description' => 'Presents a list of children and grandchildren pages on any given page that has children or is a child.' | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'init', 'update_wo_custom_type', 99 ); | |
| function update_wo_custom_type() { | |
| global $wp_post_types; | |
| if ( post_type_exists( 'wo_client' ) ) { | |
| $wp_post_types['wo_client']->exclude_from_search = true; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function wo_public_insert_client( $client_data = null ) { | |
| do_action( 'wo_before_create_client', array( $client_data ) ); | |
| $client_id = wo_gen_key(); | |
| $client_secret = wo_gen_key(); | |
| $grant_types = isset( $client_data['grant_types'] ) ? $client_data['grant_types'] : array(); | |
| $user_id = isset( $client_data['user_id'] ) ? intval( $client_data['user_id'] ) : 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'wo_scopes', 'modify_wo_scopes' ); | |
| function modify_wo_scopes( $scopes ) { | |
| // Unset a scope | |
| if ( isset( $scopes['openid'] ) ) { | |
| unset( $scopes['openid'] ); | |
| } | |
| // Add a scope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'aioi_template_redirect_allow_bypass', 'aioi_test_function' ); | |
| function aioi_test_function( $allows ) { | |
| $allows['oauth'] = 'token'; | |
| return $allows; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class core_all_in_one_intranet { | |
| protected function __construct() { | |
| $this->add_actions(); | |
| } | |
| // PRIVATE SITE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $curl_post_data = array( | |
| 'grant_type' => 'password', | |
| 'username' => $_POST['username'], | |
| 'password' => $_POST['password'], | |
| 'client_id' => $client_id, | |
| 'client_secret' => $client_secret | |
| ); | |
| $curl = curl_init($server_url.'/oauth/token'); | |
| //curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); |