This file contains 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 | |
/* | |
* dl-file.php | |
* | |
* Protect uploaded files with login. | |
* | |
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in | |
* | |
* @author hakre <http://hakre.wordpress.com/> | |
* @license GPL-3.0+ |
This file contains 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 | |
/* | |
* Notes: | |
* | |
* activate the json-rest-api plugin - then add this code to your functions.php file | |
* | |
* now the following ajax call should work: | |
* | |
jQuery.ajax({ |
This file contains 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
class MAP_API_DemoItemType extends WP_JSON_CustomPostType { | |
protected $base = '/map/demo'; | |
protected $type = 'demo'; | |
public function register_routes( $routes ) { | |
$routes = parent::register_routes( $routes ); | |
return $routes; | |
} | |
} |
This file contains 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
@-webkit-keyframes fadeIn { | |
0% { | |
opacity: 0; | |
transform: translate(0, 20px); | |
} | |
100% { | |
opacity: 1; | |
transform: translate(0, 0); | |
} | |
} |
This file contains 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
@media screen { | |
html { | |
-webkit-font-smoothing: antialiased; | |
} | |
} |
This file contains 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
/** | |
* bitflower: Activate CORS for WP-API (JSON REST API) | |
*/ | |
do_action("json_api", $controller, $method); | |
add_action( 'json_api', function( $controller, $method ) | |
{ | |
# DEBUG | |
// wp_die( "To target only this method use <pre><code>add_action('$controller-$method', function(){ /*YOUR-STUFF*/ });</code></pre>" ); | |
header( "Access-Control-Allow-Origin: *" ); | |
}, 10, 2 ); |
This file contains 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
/*! | |
* classie - class helper functions | |
* from bonzo https://github.com/ded/bonzo | |
* | |
* classie.has( elem, 'my-class' ) -> true/false | |
* classie.add( elem, 'my-new-class' ) | |
* classie.remove( elem, 'my-unwanted-class' ) | |
*/ | |
/*jshint browser: true, strict: true, undef: true */ |
This file contains 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
// Stop scroll bouncing | |
document.ontouchmove = function(e) { | |
e.preventDefault(); | |
}; |
This file contains 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
// First line of first PHP file | |
header( "Access-Control-Allow-Origin: *" ); |
This file contains 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
1. npm install cors | |
2. then in the app module: | |
var cors = require('cors'); | |
//add cors to do the cross site requests | |
app.use(cors()); |
OlderNewer