Changeset 1225425
- Timestamp:
- 08/19/2015 05:49:09 PM (11 years ago)
- Location:
- wp-cors/trunk
- Files:
-
- 3 edited
-
build.xml (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
wp-cors.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-cors/trunk/build.xml
r1002068 r1225425 5 5 <property name="project.name" value="wp-cors"/> 6 6 <property name="src" value="${basedir}"/> 7 <property name="version" value="0.2. 0"/>7 <property name="version" value="0.2.1"/> 8 8 <property name="zipName" value="${project.name}.zip"/> 9 9 -
wp-cors/trunk/readme.txt
r1002068 r1225425 3 3 Tags: CORS, REST, AJAX 4 4 Requires at least: 3.6 5 Tested up to: 4. 06 Stable tag: 0.2 5 Tested up to: 4.3 6 Stable tag: 0.2.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 45 45 == Changelog == 46 46 47 = 0.2.1 = 48 Tested up to WordPress 4.3 49 Minor fixes to avoid 404 on (unnecessary) files. 50 47 51 = 0.2.0 = 48 52 -
wp-cors/trunk/wp-cors.php
r1002068 r1225425 3 3 * Plugin Name: WP-CORS 4 4 * Plugin URI: http://knowprocess.com/wp-plugins/wp-cors 5 * Description: Simply allows you to control which external domains may make AJAX calls to integrate your content using the CORS standard. 5 * Description: Simply allows you to control which external domains may make 6 * AJAX calls to integrate your content using the CORS standard. 6 7 * Author: Tim Stephenson 7 * Version: 0.2 8 * Version: 0.2.1 8 9 * Author URI: http://knowprocess.com 9 10 * License: GPLv2 or later … … 11 12 12 13 define("CORS_ID", 'wp-cors'); 13 define("CORS_VERSION", "0. 1.1");14 define("CORS_VERSION", "0.2.1"); 14 15 define("CORS_NAME", 'CORS'); 15 16 define("CORS_DEBUG", false); … … 20 21 add_action( 'admin_init', 'register_cors_admin_settings' ); 21 22 } else { 22 // non-admin enqueues, actions, and filters23 // Not sure of the rights and wrongs but wp_enqueue_styles did not work24 add_action( 'wp_head', 'cors_load_styles' );25 add_action( 'wp_enqueue_scripts', 'cors_load_scripts' );26 23 add_action( 'send_headers', 'add_cors_header' ); 27 24 } … … 54 51 } 55 52 56 function cors_load_styles() {57 if ( is_admin() ) {58 wp_enqueue_style(59 CORS_ID.'-admin',60 plugins_url( 'css/admin-'.CORS_VERSION.'.css', __FILE__ ),61 array(),62 null /* Force no version as query string */63 );64 } else {65 wp_enqueue_style(66 CORS_ID.'-frontend',67 plugins_url( 'css/frontend-'.CORS_VERSION.'.css', __FILE__ ),68 array(),69 null /* Force no version as query string */70 );71 }72 }73 74 function cors_load_scripts() {75 if ( is_admin() ) {76 /*77 wp_enqueue_script(78 'syncapt-plugin-admin',79 plugins_url( 'js/admin.js', __FILE__ ),80 array( 'jquery' ),81 CORS_VERSION82 );83 */84 } else {85 wp_enqueue_script(86 CORS_ID.'-ui',87 plugins_url( 'js/'.CORS_ID.'-'.CORS_VERSION.(CORS_DEBUG ? '' : '.min').'.js', __FILE__ ),88 array( 'jquery' ),89 null, /* Force no version as query string */90 true /* Force load in footer */91 );92 }93 }94 95 53 /** Render the settings / options page in the admin dashboard */ 96 54 function cors_options_page() { … … 101 59 <h2><?php echo CORS_NAME; ?> Settings</h2> 102 60 <p>You may enter one or more comma-separated domains to allow access to this site using the CORS standard for authorizing cross site requests.</p> 61 <p>To allow <em>any</em> site to access yours via CORS put a *, though explicitly listing domains is a better practice for production sites.</p> 103 62 <form method="post" action="options.php"> 104 63 <table class="form-table">
Note: See TracChangeset
for help on using the changeset viewer.