[wp-trac] [WordPress Trac] #35395: Provide a better gateway for code-based theme customizations with the Customizer

WordPress Trac noreply at wordpress.org
Tue Oct 25 06:18:41 UTC 2016


#35395: Provide a better gateway for code-based theme customizations with the
Customizer
-----------------------------------------+-------------------------
 Reporter:  celloexpressions             |       Owner:  johnregan3
     Type:  feature request              |      Status:  closed
 Priority:  normal                       |   Milestone:  4.7
Component:  Customize                    |     Version:
 Severity:  normal                       |  Resolution:  fixed
 Keywords:  has-screenshots needs-patch  |     Focuses:
-----------------------------------------+-------------------------

Comment (by sebastian.pisula):

 If user will want revisions then someone make a plugin. I think that
 default functionality should be minimalist.

 Better use as option with autoload off. We can have revisions. Add new
 option, 'custom_css_revisons' with md5 hash value. Custom styles will be
 in 'custom_css' option. And revisions in 'custom_css_[HASH]'

 this is better than CPT.

 '''custom_css''' -> hash latest version (autoload = yes)
 '''custom_css_revisons''' -> array of revisions (hash) (autoload = yes)
 '''custom_css_[HASH]''' -> custom css (autoload = off)

 for example:
 {{{
 get_option('custom_css_'.get_option('custom_css'));
 }}}

 Replying to [comment:74 westonruter]:
 > @sebastian.pisula a couple reasons why a custom post type. Theme mods
 are stored in options and they are autoloaded. If a large amount of CSS
 gets added, then this will increase the size of the `alloptions` cache.
 For sites that use Memcached object cache, the size of the `alloptions`
 cache and (especially on WordPress.com) the sum of all options must not
 approach 1MB or else the `alloptions` cache will cease to cache at all,
 and the site will crash if it is getting any traffic.
 >
 > A more positive reason for using a custom post type is that it allows us
 to make use of post revisions to do versioning of the CSS. Jetpack also
 used a custom post type for storing CSS.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35395#comment:75>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list