[wp-trac] [WordPress Trac] #22790: Duplicating Embed-Codes

WordPress Trac noreply at wordpress.org
Fri Dec 7 04:17:11 UTC 2012


#22790: Duplicating Embed-Codes
--------------------------+-----------------------
 Reporter:  Bichareh      |       Owner:  ryan
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  3.5
Component:  TinyMCE       |     Version:  trunk
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+-----------------------

Comment (by nacin):

 You can include [attachment:tinymce-schemas.php] into a PHP file and
 you'll end up with two arrays: $html4 and $html5. These both represent the
 schemas in
 https://github.com/tinymce/tinymce/blob/master/jscripts/tiny_mce/classes/html/Schema.js.
 I took that file and executed it, then logged the two function returns as
 JSON, and there you are.

 The format is as follows:
 {{{
     element => object(
           attributes => object(
                (attribute1) => {}
                (attribute2) => {}
                (attribute3) => {}
                (attribute4) => {}
           ),
           attributeOrder => array( attribute1, attribute2, attribute3,
 attribute4 ),
           children => object(
                (element) => {}
                (element) => {}
                (element) => {}
           ),
     ),
     element => object( ...
 }}}

 So, if you pluck the attributeOrder key, you'll end up with all valid
 attributes for that object. This is the primary focus.

 You can also look at the children key for elements that are valid
 immediately inside this element.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22790#comment:24>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list