Changeset 1136125
- Timestamp:
- 04/16/2015 11:57:31 AM (11 years ago)
- Location:
- multiple-content-blocks
- Files:
-
- 21 added
- 4 edited
-
tags/3.2.1 (added)
-
tags/3.2.1/README.md (added)
-
tags/3.2.1/assets (added)
-
tags/3.2.1/assets/css (added)
-
tags/3.2.1/assets/css/admin.css (added)
-
tags/3.2.1/assets/inc (added)
-
tags/3.2.1/assets/inc/class-mcb-settings.php (added)
-
tags/3.2.1/assets/inc/class-mcb.php (added)
-
tags/3.2.1/assets/inc/template-tags.php (added)
-
tags/3.2.1/assets/js (added)
-
tags/3.2.1/assets/js/admin.js (added)
-
tags/3.2.1/assets/languages (added)
-
tags/3.2.1/assets/languages/mcb-da_DK.mo (added)
-
tags/3.2.1/assets/languages/mcb-da_DK.po (added)
-
tags/3.2.1/assets/languages/mcb-nl_NL.mo (added)
-
tags/3.2.1/assets/languages/mcb-nl_NL.po (added)
-
tags/3.2.1/composer.json (added)
-
tags/3.2.1/multiple-content-blocks.php (added)
-
tags/3.2.1/readme.txt (added)
-
tags/3.2.1/screenshot-1.png (added)
-
tags/3.2.1/screenshot-2.png (added)
-
trunk/README.md (modified) (2 diffs)
-
trunk/assets/inc/class-mcb.php (modified) (4 diffs)
-
trunk/multiple-content-blocks.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multiple-content-blocks/trunk/README.md
r1132124 r1136125 9 9 If you're using Composer to manage WordPress, add this plugin to your project's dependencies. Run: 10 10 ```sh 11 composer require trendwerk/multiple-content-blocks 3.2. 111 composer require trendwerk/multiple-content-blocks 3.2.2 12 12 ``` 13 13 … … 15 15 ```json 16 16 "require": { 17 "trendwerk/multiple-content-blocks": "3.2. 1"17 "trendwerk/multiple-content-blocks": "3.2.2" 18 18 }, 19 19 ``` -
multiple-content-blocks/trunk/assets/inc/class-mcb.php
r1132124 r1136125 20 20 //Admin CSS 21 21 add_action( 'admin_enqueue_scripts', array( $this, 'add_css' ) ); 22 23 //Allow auto-draft to be previewed 24 add_action( 'wp_loaded', array( $this, 'auto_draft_preview' ) ); 22 25 } 23 26 … … 76 79 77 80 if( 'one-liner' == $type ) 78 echo '<input type="text" name=" ' . $id . '" value="' . htmlentities( get_post_meta( $post->ID, '_mcb-' . $id, true ), ENT_COMPAT, 'UTF-8', false ) . '" />';81 echo '<input type="text" name="_mcb_' . $id . '" value="' . htmlentities( get_post_meta( $post->ID, '_mcb-' . $id, true ), ENT_COMPAT, 'UTF-8', false ) . '" />'; 79 82 else 80 83 wp_editor( get_post_meta( $post->ID, '_mcb-' . $id, true ), '_mcb_' . $id, array( … … 225 228 $type = get_post_type_object( $post->post_type ); 226 229 227 if( 'publish' == $post->post_status &&$type->public ) {230 if( $type->public ) { 228 231 $args = array(); 232 229 233 $request_url = get_permalink( $post_id ); 230 234 235 /** 236 * Preview link (for drafts and auto-drafts) 237 */ 238 $request_url = apply_filters( 'preview_post_link', add_query_arg( '_mcb_preview', 'true', add_query_arg( 'preview', 'true', $request_url ) ) ); 239 240 /** 241 * Send (auth) cookies 242 */ 243 if( 0 < count( $_COOKIE ) ) { 244 $args['cookies'] = array(); 245 246 foreach( $_COOKIE as $name => $value ) 247 $args['cookies'][] = new WP_Http_Cookie( array( 248 'name' => $name, 249 'value' => $value, 250 ) ); 251 } 252 253 /** 254 * Basic HTTP authentication 255 */ 231 256 if( isset( $_SERVER['PHP_AUTH_USER'] ) && 0 < strlen( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) && 0 < strlen( $_SERVER['PHP_AUTH_PW'] ) ) 232 257 $args['headers'] = array( … … 273 298 return $inactive_blocks; 274 299 } 300 301 /** 302 * Allow auto-draft to be previewed when MCB makes a request 303 */ 304 function auto_draft_preview() { 305 if( ! is_user_logged_in() ) 306 return; 307 308 if( ! isset( $_GET['p'] ) && ! isset( $_GET['page_id'] ) ) 309 return; 310 311 if( ! current_user_can( 'edit_post', isset( $_GET['p'] ) ? absint( $_GET['p'] ) : absint( $_GET['page_id'] ) ) ) 312 return; 313 314 if( ! isset( $_GET['_mcb_preview'] ) || 'true' !== $_GET['_mcb_preview'] ) 315 return; 316 317 global $wp_post_statuses; 318 319 if( ! isset( $wp_post_statuses['auto-draft'] ) ) 320 return; 321 322 $wp_post_statuses['auto-draft']->protected = true; 323 } 324 275 325 } new MCB; -
multiple-content-blocks/trunk/multiple-content-blocks.php
r1132124 r1136125 9 9 * Author URI: https://github.com/trendwerk/ 10 10 * 11 * Version: 3.2. 111 * Version: 3.2.2 12 12 * 13 13 * @package MCB -
multiple-content-blocks/trunk/readme.txt
r1132124 r1136125 29 29 == Changelog == 30 30 31 = 3.2.2 = 32 * Improvement: Support for drafts and auto-drafts, thanks for testing [Luuk de Vlieger](https://github.com/luukdv) 33 * Bugfix: Fix one-liners not being saved properly in 3.2.1, props [Ross Grant](https://github.com/iamrossgrant) 34 31 35 = 3.2.1 = 32 36 * Feature: Added basic HTTP auth support
Note: See TracChangeset
for help on using the changeset viewer.