Changeset 697354
- Timestamp:
- 04/14/2013 03:08:12 PM (13 years ago)
- Location:
- post-thumbnail-extras/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (1 diff)
-
php/options.php (modified) (2 diffs)
-
post-thumbnail-extras.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
post-thumbnail-extras/trunk/README.txt
r696871 r697354 39 39 40 40 == Screenshots == 41 42 41 1. In Settings → Media, click the plus sign to add a new post thumbnail. 43 42 2. Update the width/height and whether or not the post-thumbnail should be cropped to an exact size. (If the width or height is set to 0, that boundary constraint is not enforced). Make sure you click the "save" button so that the changes are stored in the database. -
post-thumbnail-extras/trunk/php/options.php
r696870 r697354 38 38 (function($){ 39 39 $(function(){ 40 var post_template = $('#ptx-template').html() ;40 var post_template = $('#ptx-template').html(), counter = 0; 41 41 $('.ptx-add-thumb').click(function(e){ 42 42 e.preventDefault(); 43 $(this).parents('tr').siblings().last().after($(post_template)); 43 var html = post_template.replace(/new-name/g, 'new-name-' + counter++); 44 $(this).parents('tr').siblings().last().after($(html)); 44 45 }); 45 46 $('body').delegate('.ptx-delete-thumb', 'click', function(e){ … … 130 131 $pattern = "/[^[:alnum:]-]+/"; 131 132 foreach ( $input as $name => $thumbnail ) { 132 if ( !isset( $thumbnail['name'] ) || $thumbnail['name'] == "" ) 133 if ( $name == "new-name" )133 if ( !isset( $thumbnail['name'] ) || $thumbnail['name'] == "" ) { 134 if ( preg_match( "/^new-name-[0-9]{1,2}/", $name ) ) { 134 135 $thumbnail['name'] = 'new-name-' . preg_replace( $pattern, "", uniqid() ); 135 else136 } else { 136 137 $thumbnail['name'] = $name; 138 } 139 } 137 140 138 141 //add_settings_error( 'ptx-post-thumbnails' 139 142 // , NULL, "'$thumbnail[name]'"); 140 143 // Validate the name 141 if ( preg_match( "$pattern", $thumbnail['name'] ) ) {144 if ( preg_match( $pattern, $thumbnail['name'] ) ) { 142 145 add_settings_error( 'ptx-post-thumbnails' 143 146 , NULL -
post-thumbnail-extras/trunk/post-thumbnail-extras.php
r696870 r697354 5 5 Author: sewpafly 6 6 Author URI: http://sewpafly.github.io/post-thumbnail-editor/ 7 Version: 2. 07 Version: 2.1 8 8 Description: Little things that make using post thumbnails easier 9 9 */
Note: See TracChangeset
for help on using the changeset viewer.