mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
Rename wp_caption shortcode to caption. Allow themes to disable captioning. Use dashes instead of underscores in class names. Props azaozz. see #6812
git-svn-id: https://develop.svn.wordpress.org/trunk@8313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
},
|
||||
|
||||
_do_shcode : function(co) {
|
||||
return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){
|
||||
return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){
|
||||
b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"');
|
||||
c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"');
|
||||
var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i);
|
||||
@@ -101,8 +101,8 @@
|
||||
|
||||
var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp';
|
||||
|
||||
return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp_caption '+cls+'" style="width: '+(10+parseInt(w))+
|
||||
'px"><dt class="wp_caption_dt">'+c+'</dt><dd class="wp_caption_dd">'+cap+'</dd></dl></div>';
|
||||
return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+
|
||||
'px"><dt class="wp-caption-dt">'+c+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>';
|
||||
});
|
||||
},
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
cls = cls.match(/align[^ '"]+/) || 'alignnone';
|
||||
cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"');
|
||||
|
||||
return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]';
|
||||
return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]';
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user