├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── inc └── ps-auto-loader.php ├── js └── plugin-customizer-init.js ├── plugin-customizer-demo.php ├── readme.txt ├── src ├── Blank_Slate.php ├── Plugin_Customizer.php ├── Plugin_Customizer_Interface.php └── assets │ ├── js │ ├── plugin-customizer-blank-slate.js │ └── plugin-customizer-preview-templates.js │ └── twentysixteen │ ├── 404.php │ ├── archive.php │ ├── comments.php │ ├── css │ ├── editor-style.css │ ├── ie.css │ ├── ie7.css │ └── ie8.css │ ├── footer.php │ ├── functions.php │ ├── genericons │ ├── COPYING.txt │ ├── Genericons.eot │ ├── Genericons.svg │ ├── Genericons.ttf │ ├── Genericons.woff │ ├── LICENSE.txt │ ├── README.md │ └── genericons.css │ ├── header.php │ ├── image.php │ ├── inc │ ├── back-compat.php │ ├── customizer.php │ └── template-tags.php │ ├── index.php │ ├── js │ ├── color-scheme-control.js │ ├── customize-preview.js │ ├── functions.js │ ├── html5.js │ ├── keyboard-image-navigation.js │ └── skip-link-focus-fix.js │ ├── page.php │ ├── readme.txt │ ├── rtl.css │ ├── screenshot.png │ ├── search.php │ ├── searchform.php │ ├── sidebar-content-bottom.php │ ├── sidebar.php │ ├── single.php │ ├── style.css │ └── template-parts │ ├── biography.php │ ├── content-none.php │ ├── content-page.php │ ├── content-search.php │ ├── content-single.php │ └── content.php └── templates ├── content.php ├── newsletter.php └── title.php /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Change Log 2 | 3 | ### 1.1.4 (2017/01/12 22:20 +00:00) 4 | - [1dc38fa](https://github.com/soderlind/plugin-customizer/commit/1dc38fa1aa217b7d0152bd9faf45e6110339f5d5) Version 1.1.4 (@soderlind) 5 | - [425dfa7](https://github.com/soderlind/plugin-customizer/commit/425dfa7e1bc3e925cdf21822841cc782f516baa6) Fix relative path to assets (@soderlind) 6 | - [0993f3f](https://github.com/soderlind/plugin-customizer/commit/0993f3fbdf8ab725caeb41faa8c034b6c2fa4d72) Fix comment (@soderlind) 7 | - [b1af8cd](https://github.com/soderlind/plugin-customizer/commit/b1af8cd8de1b06c55991e5bc259d2045a5a2eb23) Update changelog (@soderlind) 8 | 9 | ### 1.1.3 (2017/01/11 15:50 +00:00) 10 | - [7976ff1](https://github.com/soderlind/plugin-customizer/commit/7976ff18c04cead5e82729e970e45688f7fbb43a) Version 1.1.3 (@soderlind) 11 | - [6b566a6](https://github.com/soderlind/plugin-customizer/commit/6b566a634899bea33e9f3318c780dfda9c718060) Add comment (@soderlind) 12 | - [04f6cdc](https://github.com/soderlind/plugin-customizer/commit/04f6cdc3ee6b04cd66bef519e110c72dd5384b90) Add missing stylesheet_uri filter in change theme root (@soderlind) 13 | - [c09c437](https://github.com/soderlind/plugin-customizer/commit/c09c437c151e293394cc16a44da333fa4d65c557) Update code example (!!) (@soderlind) 14 | - [0d86b0c](https://github.com/soderlind/plugin-customizer/commit/0d86b0cecfd032aab6bd94c767ab078654c70c51) Update changelog (@soderlind) 15 | 16 | ### 1.1.2 (2017/01/09 19:09 +00:00) 17 | - [b06f606](https://github.com/soderlind/plugin-customizer/commit/b06f606914e8df69653ac835681a64c5fed6ad41) Version 1.1.2 (@soderlind) 18 | - [bff70e3](https://github.com/soderlind/plugin-customizer/commit/bff70e3bc5f1f2554d06b7af84e644758874a556) Add plugin description file for WordPress plugin repository (@soderlind) 19 | - [65738d2](https://github.com/soderlind/plugin-customizer/commit/65738d218c3a3ba90e5ecee1c0afdbc998932b48) Add deployment tools (@soderlind) 20 | - [f326601](https://github.com/soderlind/plugin-customizer/commit/f32660183916b785e182d8370c94859785c8c36a) Add plugin banner and icon (@soderlind) 21 | - [ed9b17b](https://github.com/soderlind/plugin-customizer/commit/ed9b17bf75a2b60e1f512f8cd5a968ebfaeb1e1d) Add missing change theme directory URI (@soderlind) 22 | - [959e1f4](https://github.com/soderlind/plugin-customizer/commit/959e1f4855b090a2a900e70b16b7e513b9e5e137) Minor bug fix (@soderlind) 23 | - [3853f52](https://github.com/soderlind/plugin-customizer/commit/3853f52b44a97ca3fe1f07fd7a82df035f5795e0) Update init code (@soderlind) 24 | - [9c8ebff](https://github.com/soderlind/plugin-customizer/commit/9c8ebff72b00fd01b50da5600a59320ccbb2b469) Remove unneeded code (@soderlind) 25 | - [1925001](https://github.com/soderlind/plugin-customizer/commit/1925001f96651452b61e6fa64d34772da3831a45) no message (@soderlind) 26 | - [47ae0c6](https://github.com/soderlind/plugin-customizer/commit/47ae0c6a4b76432ed0205cbbee0dae879190955b) Add CHANGELOG (@soderlind) 27 | - [aad5679](https://github.com/soderlind/plugin-customizer/commit/aad5679faef54a78244395ed714574863f8eefc4) exclude twentysixteen from rules check (@soderlind) 28 | - [bc549d4](https://github.com/soderlind/plugin-customizer/commit/bc549d4573fc00c5139b88c1ab0074309e50d0cd) Add link to download and example (@soderlind) 29 | - [fd01190](https://github.com/soderlind/plugin-customizer/commit/fd01190e62c1c4560fcd47202601bfff92457cd8) Add twentysixteen theme (@soderlind) 30 | - [4e0dc9d](https://github.com/soderlind/plugin-customizer/commit/4e0dc9d8d7e2d549218f01d5be055e1e71dc2ecd) Rewrite: (@soderlind) 31 | - [3078745](https://github.com/soderlind/plugin-customizer/commit/3078745c5f6bed5b3ddd0682ed444c1ed3a8d6c7) Add Interface (@soderlind) 32 | - [5f2a2e2](https://github.com/soderlind/plugin-customizer/commit/5f2a2e21afacd6e562de5f42a427ae85f1d19c6f) Update rules (@soderlind) 33 | - [3a2df95](https://github.com/soderlind/plugin-customizer/commit/3a2df9553cd7a26401a2682662845f6e29632143) Allow PSR-4 since I’m using an PSR-4 autoloader (@soderlind) 34 | - [1b745ee](https://github.com/soderlind/plugin-customizer/commit/1b745eefe4b32d5338627534a8bb0ac8e4f5558d) Rewrite code: (@soderlind) 35 | - [c7d54dd](https://github.com/soderlind/plugin-customizer/commit/c7d54ddc19ebfab92a318ffa119fd2d816fb2245) Add simple preview templates (@soderlind) 36 | - [be639aa](https://github.com/soderlind/plugin-customizer/commit/be639aab35a13226aab96e6fb4d0e9f86a5e5ca4) Update README with examples (@soderlind) 37 | - [9f5652e](https://github.com/soderlind/plugin-customizer/commit/9f5652e51e0162484f79af334e33f7256b75244d) Add autoloader (@soderlind) 38 | - [3012204](https://github.com/soderlind/plugin-customizer/commit/301220477d2c4e9714d589d0c632eb29f08f91ca) Add logo (@soderlind) 39 | - [924a458](https://github.com/soderlind/plugin-customizer/commit/924a4582e0dab9c32a6dc067ecfe737b000d339c) Rename and move file (@soderlind) 40 | - [11c279d](https://github.com/soderlind/plugin-customizer/commit/11c279d2c7c90619ce2ea5871bb27da239703f63) Merge branch 'master' of https://github.com/soderlind/plugin-customizer (@soderlind) 41 | - [0fd7bb2](https://github.com/soderlind/plugin-customizer/commit/0fd7bb2875537d153615ef3b35afc0a13a453f8c) Add JavaScript rules (@soderlind) 42 | - [80af3a6](https://github.com/soderlind/plugin-customizer/commit/80af3a6b93eae75be1969ca52c02c58eae682055) Abstract class, rename file (@soderlind) 43 | - [0b270fb](https://github.com/soderlind/plugin-customizer/commit/0b270fbd1ae5475940c5f9d9880fa58cdcd09c25) Update code according to WPCS (@soderlind) 44 | - [5bcc2cb](https://github.com/soderlind/plugin-customizer/commit/5bcc2cb51c1a6ebe9ad65baf476e89fd90b0e4b5) Rename file (@soderlind) 45 | - [0457dde](https://github.com/soderlind/plugin-customizer/commit/0457dde4c02f65f08573f7c815657c7b7377030d) Update README.md (@soderlind) 46 | - [ad49d80](https://github.com/soderlind/plugin-customizer/commit/ad49d805a8b2bbdbea7f2fe02e14db7ca66d4cdd) Update README.md (@soderlind) 47 | - [d8cb6c7](https://github.com/soderlind/plugin-customizer/commit/d8cb6c77248696110291ec3c18c3d5d946528ee5) Add notice about bug in Twenty Seventeen (@soderlind) 48 | - [a071b81](https://github.com/soderlind/plugin-customizer/commit/a071b8158c819b3c49ea68284b2b5ddadfbcc9c0) Add copyright and license information (@soderlind) 49 | - [a809cca](https://github.com/soderlind/plugin-customizer/commit/a809cca95e2239e92aaee98647004c08ebc98241) Add source example (@soderlind) 50 | - [482465a](https://github.com/soderlind/plugin-customizer/commit/482465a5e7972d7eb278e884d114ad137b15ec4e) Add travis and codeclimate badge (@soderlind) 51 | - [508d458](https://github.com/soderlind/plugin-customizer/commit/508d4580594e1b25328eeec3c663bd469e16d5f1) Add travis config file (@soderlind) 52 | - [c22380a](https://github.com/soderlind/plugin-customizer/commit/c22380a61b4bc93429c62192d7d76a95b640d7b9) Update comments (@soderlind) 53 | - [e88cc4d](https://github.com/soderlind/plugin-customizer/commit/e88cc4d7cc6076fc0b03bfc66393fa829316967b) Add link to article (@soderlind) 54 | - [a141eec](https://github.com/soderlind/plugin-customizer/commit/a141eec245d16ae9d6d1194f6d0e38b82b26c02a) Add "How to contribute" (@soderlind) 55 | - [8dd5a3f](https://github.com/soderlind/plugin-customizer/commit/8dd5a3f66b2da0ba35a9bd8881fb35c212bab4b6) Fix timings, add comments (@soderlind) 56 | - [f1f2b5d](https://github.com/soderlind/plugin-customizer/commit/f1f2b5df7ec6b6b44ee0c3253f91a3f04fe1f4c3) Add update preview script (@soderlind) 57 | - [7ddf48d](https://github.com/soderlind/plugin-customizer/commit/7ddf48dfa3aba55655eba324ab910b84096b08cf) Add get_option() to templates (@soderlind) 58 | - [cb6a19d](https://github.com/soderlind/plugin-customizer/commit/cb6a19d9c18e468c8564c7f5c0adebb1b3648b9e) Rename script (@soderlind) 59 | - [61017e5](https://github.com/soderlind/plugin-customizer/commit/61017e5a1e1b0ab2de60bce3b8aece03a78ea078) Add example option page (@soderlind) 60 | - [16aea5b](https://github.com/soderlind/plugin-customizer/commit/16aea5b5fc4163df092f7c4f474c2e2386ec00eb) Change args.panel to args.id (@soderlind) 61 | - [c54c45a](https://github.com/soderlind/plugin-customizer/commit/c54c45ae760e4a7e8bf99bdd0e7497472e946895) Add customizer clean slate (@soderlind) 62 | - [f3c6fb1](https://github.com/soderlind/plugin-customizer/commit/f3c6fb1f7ab210e8d9a54f3de8a7e1dd99db4ad2) Rename template (@soderlind) 63 | - [8a82343](https://github.com/soderlind/plugin-customizer/commit/8a8234354c3bc1f9a911fec2d9eb6bf0b63d5471) remove obsolete files (@soderlind) 64 | - [c0fba2d](https://github.com/soderlind/plugin-customizer/commit/c0fba2d716727e4692111bb2c20b4a685807f513) Add customizer blank slate (@soderlind) 65 | - [e663236](https://github.com/soderlind/plugin-customizer/commit/e6632364d9d686dda702149d97dd25364a87f71c) Add preview template (@soderlind) 66 | - [4955a6b](https://github.com/soderlind/plugin-customizer/commit/4955a6b3bb50fe8ad79e6f415d294838370b9ee6) Add permalink (@soderlind) 67 | - [0e4e622](https://github.com/soderlind/plugin-customizer/commit/0e4e622b82ab498712ea04012c4b04c177abd291) Change: Load on panel change (@soderlind) 68 | - [d3ae0c8](https://github.com/soderlind/plugin-customizer/commit/d3ae0c8c1a47b09137df65ab1a59b3c8cecabbc8) Add template loader (@soderlind) 69 | - [c597d44](https://github.com/soderlind/plugin-customizer/commit/c597d445e6ed7dc2a87bacaf21ff5bc089f00664) Delete obsolete files (@soderlind) 70 | - [a4ea6b8](https://github.com/soderlind/plugin-customizer/commit/a4ea6b8be19847e93009409214d55f9a095a40b7) Add code climate config files (@soderlind) 71 | - [da9bbdf](https://github.com/soderlind/plugin-customizer/commit/da9bbdfb3afbc18d638b89a7d2cda31608d0a42c) add customizer preview (@soderlind) 72 | - [4373e39](https://github.com/soderlind/plugin-customizer/commit/4373e39b68567da71e87e2ebf6a34e870164c780) Add args for adding url and section (@soderlind) 73 | - [0e855b4](https://github.com/soderlind/plugin-customizer/commit/0e855b4b4ec7b365244b01a92fcd3d8cc7aac476) working demo (@soderlind) 74 | - [7c74c27](https://github.com/soderlind/plugin-customizer/commit/7c74c272f22b89f35b5a98a571421dbf79eb9fb1) Merge branch 'master' of https://github.com/soderlind/plugin-customizer (@soderlind) 75 | - [9ed2b58](https://github.com/soderlind/plugin-customizer/commit/9ed2b5802333cb75a894ccef836a91f85f21f1f4) Initial release (@soderlind) 76 | - [4e031e8](https://github.com/soderlind/plugin-customizer/commit/4e031e8b0ae9168cfe14c05130b0fd26d98e118c) Initial commit (@soderlind) -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | I'm really glad you're reading this. 4 | 5 | ## Submitting changes 6 | 7 | Please send a [GitHub Pull Request to plugin-customizer](https://github.com/soderlind/plugin-customizer/pull/new/master) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). 8 | Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this: 9 | 10 | $ git commit -m "A brief summary of the commit 11 | > 12 | > A paragraph describing what changed and its impact." 13 | 14 | ## Coding conventions 15 | 16 | My plugins are following the [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards). 17 | 18 | Thanks, 19 | Per Søderlind 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Plugin Customizer 4 |
5 | [![Build Status](https://travis-ci.org/soderlind/plugin-customizer.svg?branch=master)](https://travis-ci.org/soderlind/plugin-customizer) [![Code Climate](https://codeclimate.com/github/soderlind/plugin-customizer/badges/gpa.svg)](https://codeclimate.com/github/soderlind/plugin-customizer) 6 | 7 | ## The goal 8 | 9 | The reason I made Plugin Customizer is to make it easy to add WordPress Customizer to your plugins. 10 | 11 | ## Use 12 | 13 | 1. Clone or [download](https://github.com/soderlind/plugin-customizer/archive/master.zip) this repository and copy the `src` folder to your plugin. 14 | 1. Add the autoloder to your plugin. 15 | 1. Add Plugin_Customizer class and Plugin_Customizer_Interface to your plugin class. 16 | 1. Init Plugin_Customizer in your constructor my calling PluginCustomizer\Plugin_Customizer::init() 17 | 18 | It you'd like to learn more, read the inline comments in the [demo plugin](plugin-customizer-demo.php) and [src/Plugin_Customizer.php](src/Plugin_Customizer.php) 19 | 20 | ```php 21 | // add autoloader 22 | require_once PLUGIN_CUSTOMIZER_DEMO_PATH . 'inc/ps-auto-loader.php'; 23 | $class_loader = new PS_Auto_Loader(); 24 | $class_loader->addNamespace( 'PluginCustomizer', PLUGIN_CUSTOMIZER_DEMO_PATH . 'src' ); 25 | $class_loader->register(); 26 | 27 | class MyPlugin extends \PluginCustomizer\Plugin_Customizer implements \PluginCustomizer\Plugin_Customizer_Interface { 28 | function __construct() { 29 | \PluginCustomizer\Plugin_Customizer::init( array( 30 | 'name' => 'Customizer Demo', // name your plugin 31 | 'url' => plugins_url( '', __FILE__ ), 32 | 'path' => plugin_dir_path( __FILE__ ), 33 | ) ); 34 | } 35 | } 36 | ``` 37 | Btw, an interface can be considered as a reminder of which methods you must add to your MyPlugin class. They are: 38 | 39 | ```php 40 | interface Plugin_Customizer_Interface { 41 | public function plugin_customizer_add_templates(); 42 | public function plugin_customizer_previewer_postmessage_script(); 43 | public function customizer_plugin_sections( $wp_customize ); 44 | public function customizer_plugin_settings( $wp_customize ); 45 | public function customizer_plugin_controls( $wp_customize ); 46 | } 47 | ``` 48 | 49 | ### plugin_customizer_add_templates(); 50 | 51 | `plugin_customizer_add_templates()` let you add the [templates](templates) you'd like to use in the preview. 52 | 53 | ```php 54 | /** 55 | * Load default template 56 | * Optionally load separate templates for the customizer sections. 57 | * 58 | * @author soderlind 59 | * @version 1.1.0 60 | */ 61 | public function plugin_customizer_add_templates() { 62 | /** 63 | * The default template used when opening the customizer 64 | * @var array 65 | */ 66 | $default_url = array( 67 | 'url' => parent::template_url( 'newsletter.php' ), // translates to templates/newsletter.php 68 | ); 69 | /** 70 | * Option, add a template to a section. key = section name, value = url to template. 71 | * 72 | * The last part, title and content in the exmple below, will translate to title.php 73 | * and content.php in the templates folder. 74 | */ 75 | $section_urls = array( 76 | 'newsletter_title_section' => parent::template_url( 'title.php' ), // translates to templates/title.php 77 | 'newsletter_content_section' => parent::template_url( 'content.php' ), // translates to templates/content.php 78 | ); 79 | parent::add_templates( $default_url, $section_urls ); 80 | /** 81 | * If you don't have different templates per section, just load the default template 82 | */ 83 | // parent::add_templates( $default_url ); 84 | } 85 | ``` 86 | 87 | ### plugin_customizer_previewer_postmessage_script(); 88 | 89 | Use the `plugin_customizer_previewer_postmessage_script()` to add your [postmessage](https://developer.wordpress.org/themes/advanced-topics/customizer-api/#using-postmessage-for-improved-setting-previewing) javascript [file](js/plugin-customizer-init.js). 90 | 91 | ```php 92 | /** 93 | * Load the preview script. The script is needed sice the transport is postmessage 94 | * @author soderlind 95 | * @version 1.0.0 96 | */ 97 | public function plugin_customizer_previewer_postmessage_script() { 98 | 99 | $handle = 'plugin-customizer-demo-init'; 100 | $src = plugins_url( 'js/plugin-customizer-init.js' , __FILE__ ); 101 | $deps = array( 'customize-preview', 'jquery' ); 102 | $version = PLUGIN_CUSTOMIZER_DEMO_VERSION; 103 | $in_footer = 1; 104 | wp_enqueue_script( $handle, $src, $deps, $version , $in_footer ); 105 | } 106 | ``` 107 | ### customizer_plugin_sections(), customizer_plugin_settings() and customizer_plugin_controls() 108 | 109 | In these functions you add the needed sections, settings and controls followin the specification the [Customizer API](https://developer.wordpress.org/themes/advanced-topics/customizer-api/). 110 | 111 | The demo plugin has a [simple implementation](https://github.com/soderlind/plugin-customizer/blob/master/plugin-customizer-demo.php#L92-L191). 112 | 113 | ## Demo 114 | 115 | You know the drill, [download](https://github.com/soderlind/plugin-customizer/archive/master.zip), add and activate the plugin. It will add the `Plugin Customizer` admin menu entries in: 116 | - Root menu 117 | - Submenu 118 | - Admin bar menu 119 | - Option Page 120 | 121 | 122 | ## Copyright and License 123 | 124 | **Plugin Customizer** is copyright 2016 Per Soderlind 125 | 126 | **Plugin Customizer** is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. 127 | 128 | **Plugin Customizer** is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU General Public License](LICENSE) for more details. 129 | 130 | You should have received a copy of the GNU Lesser General Public License along with the Extension. If not, see http://www.gnu.org/licenses/. 131 | -------------------------------------------------------------------------------- /inc/ps-auto-loader.php: -------------------------------------------------------------------------------- 1 | prefixes[ $prefix ] ) === false ) { 43 | $this->prefixes[ $prefix ] = array(); 44 | } 45 | 46 | // retain the base directory for the namespace prefix 47 | if ( $prepend ) { 48 | array_unshift( $this->prefixes[ $prefix ], $base_dir ); 49 | } else { 50 | array_push( $this->prefixes[ $prefix ], $base_dir ); 51 | } 52 | } 53 | 54 | /** 55 | * Loads the class file for a given class name. 56 | * 57 | * @param string $class The fully-qualified class name. 58 | * @return mixed The mapped file name on success, or boolean false on 59 | * failure. 60 | */ 61 | public function loadClass( $class ) { 62 | // the current namespace prefix 63 | $prefix = $class; 64 | 65 | // work backwards through the namespace names of the fully-qualified 66 | // class name to find a mapped file name 67 | while ( false !== $pos = strrpos( $prefix, '\\' ) ) { 68 | 69 | // retain the trailing namespace separator in the prefix 70 | $prefix = substr( $class, 0, $pos + 1 ); 71 | 72 | // the rest is the relative class name 73 | $relative_class = substr( $class, $pos + 1 ); 74 | 75 | // try to load a mapped file for the prefix and relative class 76 | $mapped_file = $this->loadMappedFile( $prefix, $relative_class ); 77 | if ( $mapped_file ) { 78 | return $mapped_file; 79 | } 80 | 81 | // remove the trailing namespace separator for the next iteration 82 | // of strrpos() 83 | $prefix = rtrim( $prefix, '\\' ); 84 | } 85 | 86 | // never found a mapped file 87 | return false; 88 | } 89 | 90 | /** 91 | * Load the mapped file for a namespace prefix and relative class. 92 | * 93 | * @param string $prefix The namespace prefix. 94 | * @param string $relative_class The relative class name. 95 | * @return mixed Boolean false if no mapped file can be loaded, or the 96 | * name of the mapped file that was loaded. 97 | */ 98 | protected function loadMappedFile( $prefix, $relative_class ) { 99 | // are there any base directories for this namespace prefix? 100 | if ( isset( $this->prefixes[ $prefix ] ) === false ) { 101 | return false; 102 | } 103 | 104 | // look through base directories for this namespace prefix 105 | foreach ( $this->prefixes[ $prefix ] as $base_dir ) { 106 | 107 | // replace the namespace prefix with the base directory, 108 | // replace namespace separators with directory separators 109 | // in the relative class name, append with .php 110 | $file = $base_dir 111 | . str_replace( '\\', '/', $relative_class ) 112 | . '.php'; 113 | 114 | // if the mapped file exists, require it 115 | if ( $this->requireFile( $file ) ) { 116 | // yes, we're done 117 | return $file; 118 | } 119 | } 120 | 121 | // never found it 122 | return false; 123 | } 124 | 125 | /** 126 | * If a file exists, require it from the file system. 127 | * 128 | * @param string $file The file to require. 129 | * @return bool True if the file exists, false if not. 130 | */ 131 | protected function requireFile( $file ) { 132 | if ( file_exists( $file ) ) { 133 | require $file; 134 | return true; 135 | } 136 | return false; 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /js/plugin-customizer-init.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | wp.customize( 'newsletter_title', function(value) { 3 | value.bind(function(to) { 4 | $( '#newsletter-title').html(to); 5 | }); 6 | }); 7 | wp.customize( 'newsletter_content', function(value) { 8 | value.bind(function(to) { 9 | $('#newsletter-content').html(to); 10 | }); 11 | }); 12 | }(jQuery)); 13 | -------------------------------------------------------------------------------- /plugin-customizer-demo.php: -------------------------------------------------------------------------------- 1 | addNamespace( 'PluginCustomizer', PLUGIN_CUSTOMIZER_DEMO_PATH . 'src' ); 30 | $class_loader->register(); 31 | 32 | 33 | class PluginCustomizerDemo extends PluginCustomizer\Plugin_Customizer implements PluginCustomizer\Plugin_Customizer_Interface { 34 | 35 | function __construct() { 36 | PluginCustomizer\Plugin_Customizer::init( array( 37 | 'name' => 'Customizer Demo', // name your plugin 38 | 'url' => plugins_url( '', __FILE__ ), // note, '' = url witout slash at the end of url 39 | 'path' => plugin_dir_path( __FILE__ ), 40 | ) ); 41 | $this->add_admin_menus(); 42 | } 43 | 44 | /** 45 | * Load default template 46 | * Optionally load separate templates for the customizer sections. 47 | * 48 | * @author soderlind 49 | * @version 1.1.0 50 | */ 51 | public function plugin_customizer_add_templates() { 52 | /** 53 | * The default template used when opening the customizer 54 | * @var array 55 | */ 56 | $default_url = array( 57 | 'url' => parent::template_url( 'newsletter.php' ), // translates to templates/newsletter.php 58 | ); 59 | /** 60 | * Option, add a template to a section. key = section name, value = url to template. 61 | * 62 | * The last part, title and content in the exmple below, will translate to title.php 63 | * and content.php in the templates folder. 64 | */ 65 | $section_urls = array( 66 | 'newsletter_title_section' => parent::template_url( 'title.php' ), // translates to templates/title.php 67 | 'newsletter_content_section' => parent::template_url( 'content.php' ), // translates to templates/content.php 68 | ); 69 | parent::add_templates( $default_url, $section_urls ); 70 | /** 71 | * If you don't have different templates per section, just load the default template 72 | */ 73 | // parent::add_templates( $default_url ); 74 | } 75 | 76 | /** 77 | * Load the preview script. The script is needed sice the transport is postmessage 78 | * @author soderlind 79 | * @version 1.0.0 80 | */ 81 | public function plugin_customizer_previewer_postmessage_script() { 82 | 83 | $handle = 'plugin-customizer-demo-init'; 84 | $src = plugins_url( 'js/plugin-customizer-init.js' , __FILE__ ); 85 | $deps = array( 'customize-preview', 'jquery' ); 86 | $version = PLUGIN_CUSTOMIZER_DEMO_VERSION; 87 | $in_footer = 1; 88 | wp_enqueue_script( $handle, $src, $deps, $version , $in_footer ); 89 | } 90 | 91 | 92 | /** 93 | * Simple customizer demo. Saves the settings as options. 94 | */ 95 | 96 | /** 97 | * Add sections. 98 | * 99 | * @author soderlind 100 | * @version 1.0.0 101 | * @param WP_Customize_Manager $wp_customize 102 | */ 103 | public function customizer_plugin_sections( $wp_customize ) { 104 | global $wp_customize; 105 | 106 | $wp_customize->add_section( 107 | 'newsletter_title_section', 108 | array( 109 | 'title' => __( 'Title', 'plugin-customizer' ), 110 | 'description' => __( 'Customize Your Logo Section', 'plugin-customizer' ), 111 | 'priority' => 5, 112 | 'capability' => 'manage_options', 113 | ) 114 | ); 115 | $wp_customize->add_section( 116 | 'newsletter_content_section', 117 | array( 118 | 'title' => __( 'Content', 'plugin-customizer' ), 119 | 'description' => __( 'Customize newsletter content', 'plugin-customizer' ), 120 | 'priority' => 10, 121 | 'capability' => 'manage_options', 122 | ) 123 | ); 124 | return true; 125 | } 126 | 127 | /** 128 | * Add settings. 129 | * 130 | * @author soderlind 131 | * @version 1.0.0 132 | * @param WP_Customize_Manager $wp_customize 133 | */ 134 | public function customizer_plugin_settings( $wp_customize ) { 135 | global $wp_customize; 136 | 137 | $wp_customize->add_setting( 138 | 'newsletter_title', 139 | array( 140 | 'type' => 'option', 141 | 'capability' => 'manage_options', 142 | 'transport' => 'postMessage', 143 | 'default' => __( 'The Wizard of Oz', 'plugin-customizer' ), 144 | ) 145 | ); 146 | 147 | $wp_customize->add_setting( 148 | 'newsletter_content', 149 | array( 150 | 'type' => 'option', 151 | 'capability' => 'manage_options', 152 | 'transport' => 'postMessage', 153 | 'default' => 'This was to be an eventful day for the travelers. They had hardly been walking an hour when they saw before them a great ditch that crossed the road and divided the forest as far as they could see on either side. It was a very wide ditch, and when they crept up to the edge and looked into it they could see it was also very deep, and there were many big, jagged rocks at the bottom. The sides were so steep that none of them could climb down, and for a moment it seemed that their journey must end. "What shall we do?" asked Dorothy despairingly. "I haven\'t the faintest idea," said the Tin Woodman, and the Lion shook his shaggy mane and looked thoughtful.', //esc_html( '

Nulla laoreet erat vitae aliquet tristique. Quisque quis suscipit enim, a elementum eros. Vestibulum quis lacus ligula. Mauris sit amet nibh tincidunt, gravida tortor ac, maximus nisi. Nunc turpis mauris, blandit vitae nibh non, blandit pharetra purus. Sed sed convallis diam. In ante nisi, pellentesque in laoreet at, fringilla ac neque.

Cras consequat eros lectus, ac dignissim justo cursus ac. In mi tortor, ornare eu quam a, ultrices tincidunt magna. Fusce non purus quis ex convallis vehicula. Aenean purus diam, vulputate vel pellentesque ultrices, tincidunt ac lectus. Nullam est purus, lobortis ac aliquam eget, egestas a diam. Praesent eget sapien vitae orci faucibus tempus. Ut sit amet lorem elit. Curabitur et vestibulum nibh.

Mauris vestibulum eget nisl sit amet gravida. Nullam in orci ut sem maximus dapibus blandit quis dolor. Sed pretium efficitur elit, eget vulputate sapien bibendum non. Proin congue posuere sagittis. Ut fermentum mauris ut gravida faucibus. Aenean a malesuada magna. Vestibulum nec viverra metus. Nunc aliquam eros orci, ut malesuada felis malesuada vitae. Phasellus vehicula non ex at scelerisque.

' ), 154 | ) 155 | ); 156 | return true; 157 | } 158 | 159 | /** 160 | * Add contronls. 161 | * 162 | * @author soderlind 163 | * @version 1.0.0 164 | * @param WP_Customize_Manager $wp_customize 165 | */ 166 | public function customizer_plugin_controls( $wp_customize ) { 167 | global $wp_customize; 168 | 169 | $wp_customize->add_control( new WP_Customize_Control( 170 | $wp_customize, 171 | 'newsletter_title', 172 | array( 173 | 'label' => __( 'Title', 'plugin-customizer' ), 174 | 'type' => 'text', 175 | 'section' => 'newsletter_title_section', 176 | 'settings' => 'newsletter_title', 177 | ) 178 | ) ); 179 | 180 | $wp_customize->add_control( new WP_Customize_Control( 181 | $wp_customize, 182 | 'newsletter_content', 183 | array( 184 | 'label' => __( 'Content', 'plugin-customizer' ), 185 | 'section' => 'newsletter_content_section', 186 | 'settings' => 'newsletter_content', 187 | 'type' => 'textarea', 188 | ) 189 | ) ); 190 | return true; 191 | } 192 | 193 | /** 194 | * Admin menus 195 | */ 196 | 197 | public function add_admin_menus() { 198 | /** 199 | * Add admin menu, You'll most likely only need one of them. 200 | */ 201 | 202 | // root menu 203 | add_action( 'admin_menu', array( $this, 'register_root_menu' ) ); 204 | add_action( 'admin_init', array( $this, 'root_menu_redirect_to_customizer' ) , 1 ); 205 | // submenu 206 | add_action( 'admin_menu', array( $this, 'register_sub_menu' ) ); 207 | // admin bar 208 | add_action( 'admin_bar_menu', array( $this, 'add_admin_bar_customizer_url' ), 500 ); 209 | // admin options page 210 | add_action( 'admin_menu', array( $this, 'add_option_page' ) ); 211 | add_action( 'admin_init', array( $this, 'settings_init' ) ); 212 | 213 | } 214 | 215 | /** 216 | * Create top level (root) menu. Will create URL with parameter page=redirect-customizer 217 | * 218 | * @author soderlind 219 | * @version 1.0.0 220 | */ 221 | public function register_root_menu() { 222 | add_menu_page( 223 | __( 'Plugin Customizer', 'plugin-customizer' ), 224 | __( 'Plugin Customizer', 'plugin-customizer' ), 225 | 'manage_options', 226 | 'redirect-customizer', 227 | 'function' 228 | ); 229 | } 230 | 231 | /** 232 | * Redirect to customizer url 233 | * 234 | * See http://wordpress.stackexchange.com/a/175574/14546 235 | * @author soderlind 236 | * @version 1.0.0 237 | */ 238 | function root_menu_redirect_to_customizer() { 239 | $menu_redirect = isset( $_GET['page'] ) ? $_GET['page'] : false; 240 | 241 | if ( 'redirect-customizer' == $menu_redirect ) { 242 | wp_safe_redirect( \PluginCustomizer\Plugin_Customizer::get_customizer_url( admin_url() ) ); 243 | exit(); 244 | } 245 | } 246 | 247 | /** 248 | * Create submenu 249 | * @author soderlind 250 | * @version 1.0.0 251 | */ 252 | public function register_sub_menu() { 253 | add_options_page( 254 | __( 'Plugin Customizer', 'plugin-customizer' ), 255 | __( 'Plugin Customizer', 'plugin-customizer' ), 256 | 'manage_options', 257 | 'plugin-template', 258 | '__return_null' 259 | ); 260 | $this->add_sub_menu_customizer_url(); 261 | } 262 | 263 | /** 264 | * Replace the 'plugin-template' string, in the submenu added by register_sub_menu(), 265 | * with the customizer url. 266 | * 267 | * See http://wordpress.stackexchange.com/a/131214/14546 268 | * 269 | * @author soderlind 270 | * @version 1.0.0 271 | */ 272 | function add_sub_menu_customizer_url( $parent = 'options-general.php' ) { 273 | global $submenu; 274 | 275 | if ( ! isset( $submenu[ $parent ] ) ) { 276 | return; 277 | } 278 | foreach ( $submenu[ $parent ] as $k => $d ) { 279 | if ( 'plugin-template' == $d['2'] ) { 280 | $submenu[ $parent ][ $k ]['2'] = \PluginCustomizer\Plugin_Customizer::get_customizer_url( $parent ); 281 | break; 282 | } 283 | } 284 | } 285 | 286 | /** 287 | * [add_admin_bar_customizer_url description] 288 | * @author soderlind 289 | * @version 1.0.0 290 | * @param [type] $wp_admin_bar [description] 291 | */ 292 | function add_admin_bar_customizer_url( $wp_admin_bar ) { 293 | global $post; 294 | if ( is_admin() ) { 295 | $return_url = $this->_get_current_admin_page_url(); 296 | } elseif ( is_object( $post ) ) { 297 | $return_url = get_permalink( $post->ID ); 298 | } else { 299 | $return_url = esc_url( home_url( '/' ) ); 300 | } 301 | 302 | $args = array( 303 | 'id' => 'plugin-customizer-link', 304 | 'title' => __( 'Plugin Customizer', 'plugin-customizer' ), 305 | 'href' => \PluginCustomizer\Plugin_Customizer::get_customizer_url( $return_url ), 306 | ); 307 | 308 | $wp_admin_bar->add_node( $args ); 309 | } 310 | 311 | /** 312 | * Find the current admin url. 313 | * 314 | * From: https://core.trac.wordpress.org/ticket/27888 315 | * 316 | * @author soderlind 317 | * @version 1.0.0 318 | * @return String|Bool The URL to the current admin page, or false if not in wp-admin. 319 | */ 320 | private function _get_current_admin_page_url() { 321 | if ( ! is_admin() ) { 322 | return false; 323 | } 324 | global $pagenow; 325 | 326 | $url = $pagenow; 327 | $query_string = $_SERVER['QUERY_STRING']; 328 | 329 | if ( ! empty( $query_string ) ) { 330 | $url .= '?' . $query_string; 331 | } 332 | return $url; 333 | } 334 | 335 | /** 336 | * Add an example option page. 337 | * @author soderlind 338 | * @version 1.0.0 339 | */ 340 | public function add_option_page() { 341 | add_menu_page( 'Plugin Customizer Options', 'Plugin Customizer Options', 'manage_options', 'plugin-customizer', array( $this, 'options_page' ) ); 342 | } 343 | 344 | public function settings_init() { 345 | register_setting( 'pluginPage', 'settings' ); 346 | add_settings_section( 'pluginPage_section', __( 'Demonstrate how to load the customizer from an option page', 'plugin-customizer' ), '', 'pluginPage' ); 347 | add_settings_field( 'option_page_customizer', __( 'Open customizer ', 'plugin-customizer' ), array( $this, 'option_page_customizer_link' ), 'pluginPage', 'pluginPage_section' ); 348 | } 349 | 350 | public function option_page_customizer_link() { 351 | printf( '%s

%s

', 352 | \PluginCustomizer\Plugin_Customizer::get_customizer_url( 'admin.php?page=plugin-customizer', 'newsletter_title_section' ), __( 'Customize', 'plugin-customizer' ), 353 | __( 'Will use autofocus[section]=newletter_title to focus on the title (eg open it)', 'plugin-customizer' ) 354 | ); 355 | } 356 | 357 | public function options_page() { 358 | ?> 359 |
360 |

Plugin Customizer

361 | 367 |
368 | Add New` 22 | 1. Search for `Plugin Customizer` 23 | 1. Install and Activate 24 | 25 | or 26 | 27 | 1. Download the plugin and extract the plugin-customizer.zip 28 | 1. Upload the extracted `plugin-customizer` folder to the `/wp-content/plugins/` directory 29 | 1. Activate the plugin through the 'Plugins' menu in WordPress 30 | 31 | The plugin is also [available at GitHub](https://github.com/soderlind/plugin-customizer) 32 | 33 | == Changelog == 34 | 35 | = 1.1.2 = 36 | * Initial release. 37 | -------------------------------------------------------------------------------- /src/Blank_Slate.php: -------------------------------------------------------------------------------- 1 | slug = $slug; 41 | $this->plugin_url = $plugin_url; 42 | $this->plugin_root = $plugin_root; 43 | add_filter( 'customize_loaded_components', function() { 44 | 45 | $priority = 1; 46 | add_action( 'wp_loaded', function() { 47 | 48 | global $wp_customize; 49 | remove_all_actions( 'customize_register' ); 50 | $wp_customize->register_panel_type( 'WP_Customize_Panel' ); 51 | $wp_customize->register_section_type( 'WP_Customize_Section' ); 52 | $wp_customize->register_section_type( 'WP_Customize_Sidebar_Section' ); 53 | $wp_customize->register_control_type( 'WP_Customize_Color_Control' ); 54 | $wp_customize->register_control_type( 'WP_Customize_Media_Control' ); 55 | $wp_customize->register_control_type( 'WP_Customize_Upload_Control' ); 56 | $wp_customize->register_control_type( 'WP_Customize_Image_Control' ); 57 | $wp_customize->register_control_type( 'WP_Customize_Background_Image_Control' ); 58 | $wp_customize->register_control_type( 'WP_Customize_Cropped_Image_Control' ); 59 | $wp_customize->register_control_type( 'WP_Customize_Site_Icon_Control' ); 60 | $wp_customize->register_control_type( 'WP_Customize_Theme_Control' ); 61 | }, $priority ); 62 | $components = array(); 63 | 64 | return $components; 65 | } ); 66 | add_action( 'customize_controls_init', function() { 67 | global $wp_customize; 68 | $wp_customize->set_preview_url( 69 | add_query_arg( 70 | array( $this->slug => 'on' ), 71 | $wp_customize->get_preview_url() 72 | ) 73 | ); 74 | } ); 75 | 76 | add_action( 'customize_controls_enqueue_scripts', function() { 77 | $handle = 'plugin-customizer-blank-slate'; 78 | $src = $this->plugin_url . 'assets/js/plugin-customizer-blank-slate.js'; 79 | $deps = array( 'customize-controls' ); 80 | $ver = false; 81 | $in_footer = true; 82 | wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); 83 | 84 | $args = array( 85 | 'queryParamName' => $this->slug, 86 | 'queryParamValue' => 'on', 87 | ); 88 | wp_add_inline_script( 89 | $handle, 90 | sprintf( 'PluginCustomizerBlankSlate.init( %s );', wp_json_encode( $args ) ), 91 | 'after' 92 | ); 93 | } ); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/Plugin_Customizer.php: -------------------------------------------------------------------------------- 1 | 'Plugin Customizer', 45 | 'url' => plugins_url( '', dirname( __FILE__ ) ), 46 | 'path' => plugin_dir_path( dirname( __FILE__ ) ), 47 | ) ); 48 | 49 | $this->slug = sanitize_title( $config['name'] , 'plugin-customizer' ); 50 | $this->plugin_name = $config['name']; 51 | $this->plugin_url = $config['url']; 52 | $this->plugin_root = $config['path']; 53 | $this->url = plugins_url( '/', __FILE__ ); 54 | $this->root = plugin_dir_path( __FILE__ ); 55 | 56 | /** 57 | * When saving the setinngs, the customizer settings must be visible for admin-ajax.php 58 | * so add it before the bailout test. 59 | */ 60 | add_action( 'wp_loaded', function() { 61 | add_action( 'customize_register', array( $this, 'customizer_plugin_settings' ) ); 62 | }, $this->customize_register_priority ); 63 | /** 64 | * Bailout if not called from the plugin menu links. 65 | */ 66 | if ( ! isset( $_GET[ $this->slug ] ) || 'on' !== wp_unslash( $_GET[ $this->slug ] ) ) { 67 | return; 68 | } 69 | /** 70 | * Set the customizer title. 71 | */ 72 | add_filter( 'pre_option_blogname', function(){ 73 | return $this->plugin_name; 74 | } ); 75 | 76 | /** 77 | * WordPres Customizer is dependant on functionality in the theme. Just in case 78 | * the current theme doesn't support WordPress Customizer we'll use a theme 79 | * that supports it. 80 | */ 81 | add_action( 'setup_theme', function() { 82 | add_filter( 'theme_root', array( $this, 'switch_theme_root_path' ) ); 83 | add_filter( 'template_directory_uri', array( $this, 'switch_template_uri' ) ); 84 | add_filter( 'stylesheet_uri', array( $this, 'switch_template_uri' ) ); 85 | add_filter( 'pre_option_stylesheet', function(){ 86 | return $this->theme_name; 87 | } ); 88 | add_filter( 'pre_option_template', function(){ 89 | return $this->theme_name; 90 | } ); 91 | } ); 92 | /** 93 | * Remove all other panels and sections from the customizer. 94 | */ 95 | $blank_slate = Blank_Slate::instance(); 96 | $blank_slate->init( $this->slug, $this->url, $this->root ); 97 | 98 | /** 99 | * Create preview template permalink rules. 100 | * Also see plugin_customizer_configure_previewer(), template_loader() and js/plugin-customizer-preview-templates.js 101 | * 102 | * A 'how to create permalink' tutorial is at https://soderlind.no/wordpress-plugins-and-permalinks-how-to-use-pretty-links-in-your-plugin/ 103 | */ 104 | add_filter( 'generate_rewrite_rules', array( $this, 'rewrite_rule' ) ); 105 | add_filter( 'query_vars', array( $this, 'query_vars' ) ); 106 | add_filter( 'admin_init', array( $this, 'flush_rewrite_rules' ) ); 107 | 108 | /** 109 | * Parse request from js/plugin-customizer-preview-templates.js previewer script and load the template. 110 | */ 111 | add_action( 'parse_request', array( $this, 'template_loader' ) ); 112 | 113 | /** 114 | * Enqueue previewer script. 115 | * 116 | * See https://make.xwp.co/2016/07/21/navigating-to-a-url-in-the-customizer-preview-when-a-section-is-expanded/ 117 | */ 118 | add_action( 'customize_controls_enqueue_scripts', array( $this, 'plugin_customizer_configure_previewer' ) ); 119 | add_action( 'customize_controls_enqueue_scripts', array( $this, 'plugin_customizer_add_templates' ), 11 ); 120 | 121 | /** 122 | * The plugin is using transport => postMessage, set in customizer_plugin_settings(), and needs 123 | * javascript to update the preview. 124 | * 125 | * You can Learn more about postmessage at: 126 | * https://developer.wordpress.org/themes/advanced-topics/customizer-api/#using-postmessage-for-improved-setting-previewing 127 | */ 128 | add_action( 'customize_preview_init', array( $this, 'plugin_customizer_previewer_postmessage_script' ) ); 129 | /** 130 | * Register plugin customizer settings. 131 | */ 132 | add_action( 'wp_loaded', function() { 133 | add_action( 'customize_register', array( $this, 'customizer_plugin_sections' ) ); 134 | add_action( 'customize_register', array( $this, 'customizer_plugin_controls' ) ); 135 | 136 | /** 137 | * If you plan to use selective refresh, set the transport in customizer_plugin_settings() 138 | * to 'refresh' and uncomment the line below. Also comment out the customize_preview_init action above. 139 | * 140 | * You can learn more about selective refresh at: 141 | * https://make.wordpress.org/core/2016/02/16/selective-refresh-in-the-customizer/ 142 | */ 143 | // add_action( 'customize_register', array( $this, 'customizer_plugin_selective_refresh' ) ); 144 | }, $this->customize_register_priority ); 145 | 146 | } 147 | 148 | /** 149 | * Create rewrite rule for the template URL used by js/plugin-cusomizer-scripts.js 150 | * 151 | * See: https://soderlind.no/wordpress-plugins-and-permalinks-how-to-use-pretty-links-in-your-plugin/ 152 | * 153 | * @author soderlind 154 | * @version 1.0.0 155 | * @param Object $wp_rewrite Permalink structure 156 | * @return Array Rewrite rules 157 | */ 158 | function rewrite_rule( $wp_rewrite ) { 159 | $new_rules = array( 160 | sprintf( '%s/templates/(.*)$', $this->slug ) => sprintf( 'index.php?plugin-customizer-template-%s=%s', $this->slug, $wp_rewrite->preg_index( 1 ) ), 161 | ); 162 | 163 | $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; 164 | return $wp_rewrite->rules; 165 | } 166 | 167 | /** 168 | * Add query variable for the rewrite rule used by the template URL 169 | * 170 | * See: https://soderlind.no/wordpress-plugins-and-permalinks-how-to-use-pretty-links-in-your-plugin/ 171 | * 172 | * @author soderlind 173 | * @version 1.0.0 174 | * @param Array $query_vars All defined query variables. 175 | * @return Array The updated array with query variables. 176 | */ 177 | function query_vars( $query_vars ) { 178 | $query_vars[] = sprintf( 'plugin-customizer-template-%s', $this->slug ); 179 | return $query_vars; 180 | } 181 | 182 | /** 183 | * Flush the permalink structure. 184 | * 185 | * See: https://soderlind.no/wordpress-plugins-and-permalinks-how-to-use-pretty-links-in-your-plugin/ 186 | * 187 | * @author soderlind 188 | * @version 1.0.0 189 | */ 190 | function flush_rewrite_rules() { 191 | $rules = $GLOBALS['wp_rewrite']->wp_rewrite_rules(); 192 | if ( ! isset( $rules[ sprintf( '%s/templates/(.*)$', $this->slug ) ] ) ) { // must be the same rule as in rewrite_rule($wp_rewrite) 193 | global $wp_rewrite; 194 | $wp_rewrite->flush_rules(); 195 | } 196 | } 197 | 198 | /** 199 | * Create the preview. 200 | * 201 | * The WordPress customizer uses ajax to communicate with the preview. To load the needed 202 | * scripts, wp_head() and wp_footer() must be added to the template. 203 | * 204 | * @author soderlind 205 | * @version 1.0.0 206 | */ 207 | function template_loader( $wp_query ) { 208 | $key = sprintf( 'plugin-customizer-template-%s', $this->slug ); 209 | if ( isset( $wp_query->query_vars[ $key ] ) ) { // same as the first custom variable in query_vars( $query_vars ) 210 | $template = $wp_query->query_vars[ $key ] . '.php'; 211 | wp_head(); 212 | $this->_load_template( $template ); 213 | wp_footer(); 214 | 215 | exit( 0 ); 216 | } 217 | } 218 | 219 | /** 220 | * Load the themplate and display the template if found 221 | * 222 | * Will try to locate the template in this order: 223 | * 1) [child-theme]/plugin-customizer/ 224 | * 2) [parent-theme]/plugin-customizer/ 225 | * 3) [plugin directory]/templates/ 226 | * 227 | * @author soderlind 228 | * @version 1.0.0 229 | * @param string $template plugin_root to the template 230 | */ 231 | private function _load_template( $template ) { 232 | // from: https://developer.wordpress.org/reference/functions/load_template/#comment-727 233 | if ( $overridden_template = locate_template( "plugin-customizer/{$template}" ) ) { 234 | /* 235 | * locate_template() returns plugin_root to file. 236 | * if either the child theme or the parent theme have overridden the template, load it. 237 | */ 238 | load_template( $overridden_template ); 239 | } else { 240 | /* 241 | * If neither the child nor parent theme have overridden the template, 242 | * we load the template from the 'templates' sub-directory of the directory this file is in. 243 | */ 244 | load_template( $this->plugin_root . "templates/{$template}" ); 245 | } 246 | } 247 | /** 248 | * Load the previewer script and pass the template URL as argument to the script. 249 | * Optionally load separate templates for the customizer sections. 250 | * 251 | * @author soderlind 252 | * @version 1.0.0 253 | */ 254 | public function plugin_customizer_configure_previewer() { 255 | $src = $this->url . 'assets/js/plugin-customizer-preview-templates.js'; 256 | $deps = array( 'customize-controls' ); 257 | $version = PLUGIN_CUSTOMIZER_VERSION; 258 | $in_footer = 1; 259 | wp_enqueue_script( $this->slug, $src, $deps, $version , $in_footer ); 260 | } 261 | 262 | abstract public function plugin_customizer_add_templates(); 263 | 264 | public function template_url( $template ) { 265 | $template = basename( $template, '.php' ); 266 | $template_url = home_url( sprintf( '%s/templates/%s/?%s=on', $this->slug, $template, $this->slug ) ); 267 | 268 | return $template_url; 269 | } 270 | 271 | public function add_templates( $default_url, $section_urls = array() ) { 272 | wp_add_inline_script( 273 | $this->slug, 274 | sprintf( 'PluginCustomizer.init( %s, %s );', 275 | wp_json_encode( $default_url ), 276 | wp_json_encode( $section_urls ) 277 | ), 278 | 'after' 279 | ); 280 | } 281 | 282 | /** 283 | * Load the preview script. The script is needed sice the transport is postmessage 284 | * @author soderlind 285 | * @version 1.0.0 286 | */ 287 | abstract public function plugin_customizer_previewer_postmessage_script(); 288 | 289 | /** 290 | * Create the customizer URL. 291 | * 292 | * @author soderlind 293 | * @version 1.0.0 294 | * @param string $return_url The URL to return to when closing the customizer. 295 | * @param string $autofocus_section Used for deep-linking, i.e. this section will be selected 296 | * when the customizer is opened. 297 | * @return string The customizer URL. 298 | */ 299 | protected function get_customizer_url( $return_url = '', $autofocus_section = '' ) { 300 | // If no return url, set the return url to the main admin url. 301 | if ( '' == $return_url ) { 302 | $return_url = admin_url(); 303 | } 304 | $url = wp_customize_url(); 305 | // Add parameter to identify this as a customizer url for this plugin. 306 | $url = add_query_arg( $this->slug , 'on', $url ); 307 | // If autofocus, add parameter to url. 308 | if ( '' !== $autofocus_section ) { 309 | $url = add_query_arg( 'autofocus[section]', $autofocus_section, $url ); 310 | } 311 | //Add parameter for return url. 312 | $url = add_query_arg( 'return', urlencode( $return_url ), $url ); 313 | //Sanitize url. 314 | $url = esc_url_raw( $url ); 315 | return $url; 316 | } 317 | 318 | 319 | abstract public function customizer_plugin_sections( $wp_customize ); 320 | abstract public function customizer_plugin_settings( $wp_customize ); 321 | abstract public function customizer_plugin_controls( $wp_customize ); 322 | 323 | // inspired by https://gist.github.com/franz-josef-kaiser/8608140 324 | public function switch_theme_root_path( $org_theme_root ) { 325 | $crrent_theme = wp_get_theme( $this->theme_name ); 326 | // if theme exists, no point in changing theme root. 327 | if ( $crrent_theme->exists() ) { 328 | return $org_theme_root; 329 | } 330 | 331 | $new_theme_root = $this->root . 'assets'; 332 | # Too early to use register_theme_directory() 333 | if ( ! in_array( $new_theme_root, $GLOBALS['wp_theme_directories'] ) ) { 334 | $GLOBALS['wp_theme_directories'][] = $new_theme_root; 335 | } 336 | 337 | return $new_theme_root; 338 | } 339 | 340 | public function switch_template_uri( $uri ) { 341 | $new_theme_root_uri = $this->url . 'assets/' . $this->theme_name; 342 | return $new_theme_root_uri; 343 | } 344 | 345 | public function plugin_theme_name() { 346 | return $this->theme_name; 347 | } 348 | } 349 | } 350 | -------------------------------------------------------------------------------- /src/Plugin_Customizer_Interface.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 | 15 |
16 | 19 | 20 |
21 |

22 | 23 | 24 |
25 |
26 | 27 |
28 | 29 | 30 | 31 |
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/archive.php: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 |
23 | 24 | 25 | 26 | 32 | 33 | __( 'Previous page', 'twentysixteen' ), 50 | 'next_text' => __( 'Next page', 'twentysixteen' ), 51 | 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', 52 | ) ); 53 | 54 | // If no content, include the "No posts found" template. 55 | else : 56 | get_template_part( 'template-parts/content', 'none' ); 57 | 58 | endif; 59 | ?> 60 | 61 |
62 |
63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/comments.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
24 | 25 | 26 |

27 | 47 |

48 | 49 | 50 | 51 |
    52 | 'ol', 55 | 'short_ping' => true, 56 | 'avatar_size' => 42, 57 | ) ); 58 | ?> 59 |
60 | 61 | 62 | 63 | 64 | 65 | 69 |

70 | 71 | 72 | '

', 75 | 'title_reply_after' => '

', 76 | ) ); 77 | ?> 78 | 79 |
80 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/css/editor-style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Twenty Sixteen 3 | Description: Used to style the TinyMCE editor. 4 | */ 5 | 6 | 7 | /** 8 | * Table of Contents: 9 | * 10 | * 1.0 - Body 11 | * 2.0 - Typography 12 | * 3.0 - Elements 13 | * 4.0 - Alignment 14 | * 5.0 - Caption 15 | * 6.0 - Galleries 16 | * 7.0 - Audio / Video 17 | * 8.0 - RTL 18 | */ 19 | 20 | 21 | /** 22 | * 1.0 - Body 23 | */ 24 | 25 | body { 26 | color: #1a1a1a; 27 | font-family: Merriweather, Georgia, serif; 28 | font-size: 16px; 29 | font-weight: 400; 30 | line-height: 1.75; 31 | margin: 20px 40px; 32 | max-width: 600px; 33 | vertical-align: baseline; 34 | } 35 | 36 | body.post-type-page { 37 | max-width: 840px; 38 | } 39 | 40 | 41 | /** 42 | * 2.0 - Typography 43 | */ 44 | 45 | h1, 46 | h2, 47 | h3, 48 | h4, 49 | h5, 50 | h6 { 51 | clear: both; 52 | font-weight: 900; 53 | margin: 56px 0 28px; 54 | } 55 | 56 | h1 { 57 | font-size: 33px; 58 | line-height: 1.2727272727; 59 | } 60 | 61 | h2 { 62 | font-size: 28px; 63 | line-height: 1.25; 64 | } 65 | 66 | h3 { 67 | font-size: 23px; 68 | line-height: 1.2173913043; 69 | } 70 | 71 | h4, 72 | h5, 73 | h6 { 74 | font-size: 19px; 75 | line-height: 1.1052631579; 76 | } 77 | 78 | h4 { 79 | letter-spacing: 0.13333em; 80 | text-transform: uppercase; 81 | } 82 | 83 | h6 { 84 | font-style: italic; 85 | } 86 | 87 | h1:first-child, 88 | h2:first-child, 89 | h3:first-child, 90 | h4:first-child, 91 | h5:first-child, 92 | h6:first-child { 93 | margin-top: 0; 94 | } 95 | 96 | p { 97 | margin: 0 0 28px; 98 | } 99 | 100 | b, 101 | strong { 102 | font-weight: 700; 103 | } 104 | 105 | dfn, 106 | cite, 107 | em, 108 | i { 109 | font-style: italic; 110 | } 111 | 112 | blockquote { 113 | border-left: 4px solid #1a1a1a; 114 | color: #686868; 115 | font-size: 19px; 116 | font-style: italic; 117 | line-height: 1.4736842105; 118 | margin-bottom: 28px; 119 | overflow: hidden; 120 | padding: 0 0 0 24px; 121 | } 122 | 123 | blockquote:not(.alignleft):not(.alignright) { 124 | margin-left: -28px; 125 | } 126 | 127 | blockquote blockquote:not(.alignleft):not(.alignright) { 128 | margin-left: 0; 129 | } 130 | 131 | blockquote:before, 132 | blockquote:after { 133 | content: ""; 134 | display: table; 135 | } 136 | 137 | blockquote:after { 138 | clear: both; 139 | } 140 | 141 | blockquote > :last-child { 142 | margin-bottom: 0; 143 | } 144 | 145 | blockquote cite, 146 | blockquote small { 147 | color: #1a1a1a; 148 | font-size: 16px; 149 | line-height: 1.75; 150 | } 151 | 152 | blockquote em, 153 | blockquote i, 154 | blockquote cite { 155 | font-style: normal; 156 | } 157 | 158 | blockquote strong, 159 | blockquote b { 160 | font-weight: 400; 161 | } 162 | 163 | blockquote.alignleft, 164 | blockquote.alignright { 165 | border: 0 solid #1a1a1a; 166 | border-top-width: 4px; 167 | padding: 18px 0 0; 168 | width: -webkit-calc(50% - 14px); 169 | width: calc(50% - 14px); 170 | } 171 | 172 | address { 173 | font-style: italic; 174 | margin: 0 0 28px; 175 | } 176 | 177 | code, 178 | kbd, 179 | tt, 180 | var, 181 | samp, 182 | pre { 183 | font-family: Inconsolata, monospace; 184 | } 185 | 186 | pre { 187 | border: 1px solid #d1d1d1; 188 | font-size: 16px; 189 | line-height: 1.3125; 190 | margin: 0 0 28px; 191 | max-width: 100%; 192 | overflow: auto; 193 | padding: 14px; 194 | white-space: pre; 195 | white-space: pre-wrap; 196 | word-wrap: break-word; 197 | } 198 | 199 | code { 200 | background-color: #d1d1d1; 201 | padding: 2px 4px; 202 | } 203 | 204 | abbr[title] { 205 | border-bottom: 1px dotted #d1d1d1; 206 | cursor: help; 207 | } 208 | 209 | mark, 210 | ins { 211 | background: #007acc; 212 | color: #fff; 213 | padding: 2px 4px; 214 | text-decoration: none; 215 | } 216 | 217 | sup, 218 | sub { 219 | font-size: 75%; 220 | height: 0; 221 | line-height: 0; 222 | position: relative; 223 | vertical-align: baseline; 224 | } 225 | 226 | sub { 227 | top: -6px; 228 | } 229 | 230 | sup { 231 | bottom: -3px; 232 | } 233 | 234 | small { 235 | font-size: 80%; 236 | } 237 | 238 | big { 239 | font-size: 125%; 240 | } 241 | 242 | 243 | /** 244 | * 3.0 - Elements 245 | */ 246 | 247 | hr { 248 | background-color: #d1d1d1; 249 | border: 0; 250 | height: 1px; 251 | margin-bottom: 28px; 252 | } 253 | 254 | ul, 255 | ol { 256 | margin: 0 0 28px 0; 257 | padding: 0; 258 | } 259 | 260 | ul { 261 | list-style: disc; 262 | } 263 | 264 | ol { 265 | list-style: decimal; 266 | } 267 | 268 | li > ul, 269 | li > ol { 270 | margin-bottom: 0; 271 | } 272 | 273 | li > ul, 274 | blockquote > ul { 275 | margin-left: 20px; 276 | } 277 | 278 | li > ol, 279 | blockquote > ol { 280 | margin-left: 24px; 281 | } 282 | 283 | dl { 284 | margin: 0 0 28px; 285 | } 286 | 287 | dt { 288 | font-weight: bold; 289 | } 290 | 291 | dd { 292 | margin: 0 0 28px; 293 | } 294 | 295 | table, 296 | th, 297 | td, 298 | .mce-item-table, 299 | .mce-item-table th, 300 | .mce-item-table td { 301 | border: 1px solid #d1d1d1; 302 | } 303 | 304 | table a { 305 | color: #007acc; 306 | } 307 | 308 | table, 309 | .mce-item-table { 310 | border-collapse: separate; 311 | border-spacing: 0; 312 | border-width: 1px 0 0 1px; 313 | margin: 0 0 28px; 314 | width: 100%; 315 | } 316 | 317 | table th, 318 | .mce-item-table th, 319 | table caption { 320 | border-width: 0 1px 1px 0; 321 | font-size: 16px; 322 | font-weight: 700; 323 | padding: 7px; 324 | text-align: left; 325 | vertical-align: baseline; 326 | } 327 | 328 | table td, 329 | .mce-item-table td { 330 | border-width: 0 1px 1px 0; 331 | font-size: 16px; 332 | padding: 7px; 333 | vertical-align: baseline; 334 | } 335 | 336 | img { 337 | border: 0; 338 | height: auto; 339 | max-width: 100%; 340 | vertical-align: middle; 341 | } 342 | 343 | a img { 344 | display: block; 345 | } 346 | 347 | figure { 348 | margin: 0; 349 | } 350 | 351 | del { 352 | opacity: 0.8; 353 | } 354 | 355 | a { 356 | box-shadow: 0 1px 0 0 currentColor; 357 | color: #007acc; 358 | text-decoration: none; 359 | } 360 | 361 | fieldset { 362 | border: 1px solid #d1d1d1; 363 | margin: 0 0 28px; 364 | padding: 14px; 365 | } 366 | 367 | 368 | /** 369 | * 4.0 - Alignment 370 | */ 371 | 372 | .alignleft { 373 | float: left; 374 | margin: 6px 28px 28px 0; 375 | } 376 | 377 | .alignright { 378 | float: right; 379 | margin: 6px 0 28px 28px; 380 | } 381 | 382 | .aligncenter { 383 | clear: both; 384 | display: block; 385 | margin: 0 auto 28px; 386 | } 387 | 388 | 389 | /** 390 | * 5.0 - Caption 391 | */ 392 | 393 | .wp-caption { 394 | background: transparent; 395 | border: none; 396 | margin-bottom: 28px; 397 | max-width: 100%; 398 | padding: 0; 399 | text-align: inherit; 400 | } 401 | 402 | .wp-caption-text, 403 | .wp-caption-dd { 404 | color: #686868; 405 | font-size: 13px; 406 | font-style: italic; 407 | line-height: 1.6153846154; 408 | padding-top: 7px; 409 | } 410 | 411 | 412 | /** 413 | * 6.0 - Galleries 414 | */ 415 | 416 | .mce-content-body .wpview-wrap { 417 | margin-bottom: 28px; 418 | } 419 | 420 | .gallery { 421 | margin: 0 -1.1666667%; 422 | padding: 0; 423 | } 424 | 425 | .gallery .gallery-item { 426 | display: inline-block; 427 | max-width: 33.33%; 428 | padding: 0 1.1400652% 2.2801304%; 429 | text-align: center; 430 | vertical-align: top; 431 | width: 100%; 432 | } 433 | 434 | .gallery-columns-1 .gallery-item { 435 | max-width: 100%; 436 | } 437 | 438 | .gallery-columns-2 .gallery-item { 439 | max-width: 50%; 440 | } 441 | 442 | .gallery-columns-4 .gallery-item { 443 | max-width: 25%; 444 | } 445 | 446 | .gallery-columns-5 .gallery-item { 447 | max-width: 20%; 448 | } 449 | 450 | .gallery-columns-6 .gallery-item { 451 | max-width: 16.66%; 452 | } 453 | 454 | .gallery-columns-7 .gallery-item { 455 | max-width: 14.28%; 456 | } 457 | 458 | .gallery-columns-8 .gallery-item { 459 | max-width: 12.5%; 460 | } 461 | 462 | .gallery-columns-9 .gallery-item { 463 | max-width: 11.11%; 464 | } 465 | 466 | .gallery .gallery-caption { 467 | font-size: 13px; 468 | margin: 0; 469 | } 470 | 471 | .gallery-columns-6 .gallery-caption, 472 | .gallery-columns-7 .gallery-caption, 473 | .gallery-columns-8 .gallery-caption, 474 | .gallery-columns-9 .gallery-caption { 475 | display: none; 476 | } 477 | 478 | 479 | /** 480 | * 7.0 - Audio / Video 481 | */ 482 | 483 | .wp-audio-shortcode a, 484 | .wp-playlist a { 485 | box-shadow: none; 486 | } 487 | 488 | .mce-content-body .wp-audio-playlist { 489 | margin: 0; 490 | padding-bottom: 0; 491 | } 492 | 493 | .mce-content-body .wp-playlist-tracks { 494 | margin-top: 0; 495 | } 496 | 497 | .mce-content-body .wp-playlist-item { 498 | padding: 10px 0; 499 | } 500 | 501 | .mce-content-body .wp-playlist-item-length { 502 | top: 10px; 503 | } 504 | 505 | 506 | /** 507 | * 8.0 - RTL 508 | */ 509 | 510 | .rtl blockquote { 511 | border: 0 solid #1a1a1a; 512 | border-right-width: 4px; 513 | } 514 | 515 | .rtl blockquote.alignleft, 516 | .rtl blockquote.alignright { 517 | border: 0 solid #1a1a1a; 518 | border-top-width: 4px; 519 | } 520 | 521 | .rtl blockquote:not(.alignleft):not(.alignright) { 522 | margin-right: -28px; 523 | padding: 0 24px 0 0; 524 | } 525 | 526 | .rtl blockquote blockquote:not(.alignleft):not(.alignright) { 527 | margin-right: 0; 528 | margin-left: auto; 529 | } 530 | 531 | .rtl li > ul, 532 | .rtl blockquote > ul { 533 | margin-right: 20px; 534 | margin-left: auto; 535 | } 536 | 537 | .rtl li > ol, 538 | .rtl blockquote > ol { 539 | margin-right: 24px; 540 | margin-left: auto; 541 | } 542 | 543 | .rtl table th, 544 | .rtl .mce-item-table th, 545 | .rtl table caption { 546 | text-align: right; 547 | } 548 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/css/ie.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Twenty Sixteen 3 | Description: Global Styles for older IE versions (previous to IE10). 4 | */ 5 | 6 | .site-header-main:before, 7 | .site-header-main:after, 8 | .site-footer:before, 9 | .site-footer:after { 10 | content: ""; 11 | display: table; 12 | } 13 | 14 | .site-header-main:after, 15 | .site-footer:after { 16 | clear: both; 17 | } 18 | 19 | @media screen and (min-width: 56.875em) { 20 | .site-branding, 21 | .site-info { 22 | float: left; 23 | } 24 | 25 | .site-header-menu, 26 | .site-footer .social-navigation { 27 | float: right; 28 | } 29 | 30 | .site-footer .social-navigation { 31 | margin-left: 7px; 32 | } 33 | 34 | .rtl .site-branding, 35 | .rtl .site-info { 36 | float: right; 37 | } 38 | 39 | .rtl .site-header-menu, 40 | .rtl .site-footer .social-navigation { 41 | float: left; 42 | } 43 | 44 | .rtl .site-footer .social-navigation { 45 | margin-right: 7px; 46 | margin-left: 0; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/css/ie7.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Twenty Sixteen 3 | Description: IE7 specific style. 4 | */ 5 | 6 | .site-inner { 7 | max-width: 656px; 8 | } 9 | 10 | .post-navigation, 11 | .pagination, 12 | .image-navigation, 13 | .entry-header, 14 | .entry-summary, 15 | .entry-content, 16 | .entry-footer, 17 | .page-header, 18 | .page-content, 19 | .post-thumbnail, 20 | .content-bottom-widgets, 21 | .comments-area { 22 | margin-right: 28px; 23 | margin-left: 28px; 24 | max-width: 100%; 25 | } 26 | 27 | .site-header, 28 | .sidebar, 29 | .site-footer, 30 | .widecolumn { 31 | padding-right: 28px; 32 | padding-left: 28px; 33 | } 34 | 35 | .search-submit { 36 | height: auto; 37 | margin-top: 28px; 38 | padding: 15px 0 8px; 39 | position: relative; 40 | width: auto; 41 | } 42 | 43 | .search-submit .screen-reader-text { 44 | height: auto; 45 | position: relative !important; 46 | width: auto; 47 | } 48 | 49 | .image-navigation .nav-previous, 50 | .image-navigation .nav-next, 51 | .comment-navigation .nav-previous, 52 | .comment-navigation .nav-next { 53 | *display: inline; 54 | zoom: 1; 55 | } 56 | 57 | .image-navigation .nav-previous + .nav-next, 58 | .comment-navigation .nav-previous + .nav-next { 59 | margin-left: 14px; 60 | } 61 | 62 | .pagination .nav-links { 63 | padding: 0; 64 | } 65 | 66 | .pagination .page-numbers { 67 | line-height: 1; 68 | margin: -4px 14px 0; 69 | padding: 18px 0; 70 | } 71 | 72 | .pagination .prev, 73 | .pagination .next { 74 | display: inline-block; 75 | font-size: 16px; 76 | font-weight: 700; 77 | height: auto; 78 | left: 0; 79 | line-height: 1; 80 | margin: 0; 81 | padding: 18px 14px; 82 | position: relative; 83 | right: 0; 84 | text-transform: none; 85 | width: auto; 86 | } 87 | 88 | .dropdown-toggle { 89 | display: none; 90 | } 91 | 92 | .main-navigation ul ul { 93 | display: block; 94 | } 95 | 96 | .social-navigation { 97 | margin-top: 1.75em; 98 | } 99 | 100 | .social-navigation a { 101 | height: auto; 102 | padding: 3px 7px; 103 | width: auto; 104 | } 105 | 106 | .social-navigation .screen-reader-text { 107 | height: auto; 108 | position: relative !important; 109 | width: auto; 110 | } 111 | 112 | .site-header-main { 113 | overflow : hidden; 114 | zoom : 1; 115 | } 116 | 117 | .entry-footer > span { 118 | margin-right: 14px; 119 | } 120 | 121 | .site-info .site-title { 122 | font-size: 13px; 123 | margin-right: 14px; 124 | } 125 | 126 | .gallery-item { 127 | max-width: 30%; 128 | } 129 | 130 | .gallery-columns-1 .gallery-item { 131 | max-width: 100%; 132 | } 133 | 134 | .gallery-columns-2 .gallery-item { 135 | max-width: 46%; 136 | } 137 | 138 | .gallery-columns-4 .gallery-item { 139 | max-width: 22%; 140 | } 141 | 142 | .gallery-columns-5 .gallery-item { 143 | max-width: 17%; 144 | } 145 | 146 | .gallery-columns-6 .gallery-item { 147 | max-width: 13.5%; 148 | } 149 | 150 | .gallery-columns-7 .gallery-item { 151 | max-width: 11%; 152 | } 153 | 154 | .gallery-columns-8 .gallery-item { 155 | max-width: 9.5%; 156 | } 157 | 158 | .gallery-columns-9 .gallery-item { 159 | max-width: 8%; 160 | } 161 | 162 | .rtl .image-navigation .nav-previous + .nav-next, 163 | .rtl .comment-navigation .nav-previous + .nav-next { 164 | margin-right: 14px; 165 | margin-left: 0; 166 | } 167 | 168 | .rtl .entry-footer > span { 169 | margin-right: 14px; 170 | margin-left: 0; 171 | } 172 | 173 | .rtl .site-info .site-title { 174 | margin-right: 0; 175 | margin-left: 14px; 176 | } 177 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/css/ie8.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Twenty Sixteen 3 | Description: IE8 specific style. 4 | */ 5 | 6 | code { 7 | background-color: transparent; 8 | padding: 0; 9 | } 10 | 11 | .entry-content a, 12 | .entry-summary a, 13 | .taxonomy-description a, 14 | .logged-in-as a, 15 | .comment-content a, 16 | .pingback .comment-body > a, 17 | .textwidget a, 18 | .entry-footer a:hover, 19 | .site-info a:hover { 20 | text-decoration: underline; 21 | } 22 | 23 | .entry-content a:hover, 24 | .entry-content a:focus, 25 | .entry-summary a:hover, 26 | .entry-summary a:focus, 27 | .taxonomy-description a:hover, 28 | .taxonomy-description a:focus, 29 | .logged-in-as a:hover, 30 | .logged-in-as a:focus, 31 | .comment-content a:hover, 32 | .comment-content a:focus, 33 | .pingback .comment-body > a:hover, 34 | .pingback .comment-body > a:focus, 35 | .textwidget a:hover, 36 | .textwidget a:focus, 37 | .entry-content .wp-audio-shortcode a, 38 | .entry-content .wp-playlist a, 39 | .page-links a { 40 | text-decoration: none; 41 | } 42 | 43 | .site { 44 | margin: 21px; 45 | } 46 | 47 | .site-inner { 48 | max-width: 710px; 49 | } 50 | 51 | .site-header { 52 | padding-top: 3.9375em; 53 | padding-bottom: 3.9375em; 54 | } 55 | 56 | .site-branding { 57 | float: left; 58 | margin-top: 1.3125em; 59 | margin-bottom: 1.3125em; 60 | } 61 | 62 | .site-title { 63 | font-size: 28px; 64 | line-height: 1.25; 65 | } 66 | 67 | .site-description { 68 | display: block; 69 | } 70 | 71 | .menu-toggle { 72 | float: right; 73 | font-size: 16px; 74 | margin: 1.3125em 0; 75 | padding: 0.8125em 0.875em 0.6875em; 76 | } 77 | 78 | .site-header-menu { 79 | clear: both; 80 | margin: 0; 81 | padding: 1.3125em 0; 82 | } 83 | 84 | .site-header .main-navigation + .social-navigation { 85 | margin-top: 2.625em; 86 | } 87 | 88 | .header-image { 89 | margin: 1.3125em 0; 90 | } 91 | 92 | .site-main { 93 | margin-bottom: 5.25em; 94 | } 95 | 96 | .post-navigation { 97 | margin-bottom: 5.25em; 98 | } 99 | 100 | .post-navigation .post-title { 101 | font-size: 28px; 102 | line-height: 1.25; 103 | } 104 | 105 | .pagination { 106 | margin: 0 7.6923% 4.421052632em; 107 | } 108 | 109 | .pagination .nav-links:before, 110 | .pagination .nav-links:after { 111 | display: none; 112 | } 113 | 114 | /* restore screen-reader-text */ 115 | .pagination .current .screen-reader-text { 116 | position: absolute !important; 117 | } 118 | 119 | .pagination .page-numbers { 120 | display: inline-block; 121 | font-weight: 400; 122 | } 123 | 124 | .image-navigation .nav-previous, 125 | .image-navigation .nav-next, 126 | .comment-navigation .nav-previous, 127 | .comment-navigation .nav-next { 128 | display: inline-block; 129 | } 130 | 131 | .image-navigation .nav-previous + .nav-next:before, 132 | .comment-navigation .nav-previous + .nav-next:before { 133 | content: "\002f"; 134 | display: inline-block; 135 | filter: alpha(opacity=70); 136 | padding: 0 0.538461538em; 137 | } 138 | 139 | .site-main > article { 140 | margin-bottom: 5.25em; 141 | } 142 | 143 | .entry-title { 144 | font-size: 33px; 145 | line-height: 1.2727272727; 146 | margin-bottom: 0.8484848485em; 147 | } 148 | 149 | .entry-content blockquote.alignleft, 150 | .entry-content blockquote.alignright { 151 | border-width: 4px 0 0 0; 152 | padding: 0.9473684211em 0 0; 153 | width: 50%; 154 | } 155 | 156 | .entry-footer > span:after { 157 | content: "\002f"; 158 | display: inline-block; 159 | filter: alpha(opacity=70); 160 | padding: 0 0.538461538em; 161 | } 162 | 163 | .updated { 164 | display: none; 165 | } 166 | 167 | .updated.published { 168 | display: inline; 169 | } 170 | 171 | .comment-author { 172 | margin-bottom: 0; 173 | } 174 | 175 | .comment-author .avatar { 176 | height: 42px; 177 | position: relative; 178 | top: 0.25em; 179 | width: 42px; 180 | } 181 | 182 | .comment-list .children > li { 183 | padding-left: 1.75em; 184 | } 185 | 186 | .comment-list + .comment-respond, 187 | .comment-navigation + .comment-respond { 188 | padding-top: 3.5em; 189 | } 190 | 191 | .comment-reply-link { 192 | margin-top: 0; 193 | } 194 | 195 | .comments-area, 196 | .widget, 197 | .content-bottom-widgets .widget-area { 198 | margin-bottom: 5.25em; 199 | } 200 | 201 | .sidebar, 202 | .widecolumn { 203 | margin-bottom: 5.25em; 204 | } 205 | 206 | .site-footer .main-navigation, 207 | .site-footer .social-navigation { 208 | display: none; 209 | } 210 | 211 | .rtl .site-branding { 212 | float: right; 213 | } 214 | 215 | .rtl .menu-toggle { 216 | float: left; 217 | } 218 | 219 | .rtl .comment-list .children > li { 220 | padding-right: 1.75em; 221 | padding-left: 0; 222 | } 223 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/footer.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/functions.php: -------------------------------------------------------------------------------- 1 | tag in the document head, and expect WordPress to 63 | * provide it for us. 64 | */ 65 | add_theme_support( 'title-tag' ); 66 | 67 | /* 68 | * Enable support for custom logo. 69 | * 70 | * @since Twenty Sixteen 1.2 71 | */ 72 | add_theme_support( 'custom-logo', array( 73 | 'height' => 240, 74 | 'width' => 240, 75 | 'flex-height' => true, 76 | ) ); 77 | 78 | /* 79 | * Enable support for Post Thumbnails on posts and pages. 80 | * 81 | * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails 82 | */ 83 | add_theme_support( 'post-thumbnails' ); 84 | set_post_thumbnail_size( 1200, 9999 ); 85 | 86 | // This theme uses wp_nav_menu() in two locations. 87 | register_nav_menus( array( 88 | 'primary' => __( 'Primary Menu', 'twentysixteen' ), 89 | 'social' => __( 'Social Links Menu', 'twentysixteen' ), 90 | ) ); 91 | 92 | /* 93 | * Switch default core markup for search form, comment form, and comments 94 | * to output valid HTML5. 95 | */ 96 | add_theme_support( 'html5', array( 97 | 'search-form', 98 | 'comment-form', 99 | 'comment-list', 100 | 'gallery', 101 | 'caption', 102 | ) ); 103 | 104 | /* 105 | * Enable support for Post Formats. 106 | * 107 | * See: https://codex.wordpress.org/Post_Formats 108 | */ 109 | add_theme_support( 'post-formats', array( 110 | 'aside', 111 | 'image', 112 | 'video', 113 | 'quote', 114 | 'link', 115 | 'gallery', 116 | 'status', 117 | 'audio', 118 | 'chat', 119 | ) ); 120 | 121 | /* 122 | * This theme styles the visual editor to resemble the theme style, 123 | * specifically font, colors, icons, and column width. 124 | */ 125 | add_editor_style( array( 'css/editor-style.css', twentysixteen_fonts_url() ) ); 126 | 127 | // Indicate widget sidebars can use selective refresh in the Customizer. 128 | add_theme_support( 'customize-selective-refresh-widgets' ); 129 | } 130 | endif; // twentysixteen_setup 131 | add_action( 'after_setup_theme', 'twentysixteen_setup' ); 132 | 133 | /** 134 | * Sets the content width in pixels, based on the theme's design and stylesheet. 135 | * 136 | * Priority 0 to make it available to lower priority callbacks. 137 | * 138 | * @global int $content_width 139 | * 140 | * @since Twenty Sixteen 1.0 141 | */ 142 | function twentysixteen_content_width() { 143 | $GLOBALS['content_width'] = apply_filters( 'twentysixteen_content_width', 840 ); 144 | } 145 | add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); 146 | 147 | /** 148 | * Registers a widget area. 149 | * 150 | * @link https://developer.wordpress.org/reference/functions/register_sidebar/ 151 | * 152 | * @since Twenty Sixteen 1.0 153 | */ 154 | function twentysixteen_widgets_init() { 155 | register_sidebar( array( 156 | 'name' => __( 'Sidebar', 'twentysixteen' ), 157 | 'id' => 'sidebar-1', 158 | 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), 159 | 'before_widget' => '
', 160 | 'after_widget' => '
', 161 | 'before_title' => '

', 162 | 'after_title' => '

', 163 | ) ); 164 | 165 | register_sidebar( array( 166 | 'name' => __( 'Content Bottom 1', 'twentysixteen' ), 167 | 'id' => 'sidebar-2', 168 | 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), 169 | 'before_widget' => '
', 170 | 'after_widget' => '
', 171 | 'before_title' => '

', 172 | 'after_title' => '

', 173 | ) ); 174 | 175 | register_sidebar( array( 176 | 'name' => __( 'Content Bottom 2', 'twentysixteen' ), 177 | 'id' => 'sidebar-3', 178 | 'description' => __( 'Appears at the bottom of the content on posts and pages.', 'twentysixteen' ), 179 | 'before_widget' => '
', 180 | 'after_widget' => '
', 181 | 'before_title' => '

', 182 | 'after_title' => '

', 183 | ) ); 184 | } 185 | add_action( 'widgets_init', 'twentysixteen_widgets_init' ); 186 | 187 | if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : 188 | /** 189 | * Register Google fonts for Twenty Sixteen. 190 | * 191 | * Create your own twentysixteen_fonts_url() function to override in a child theme. 192 | * 193 | * @since Twenty Sixteen 1.0 194 | * 195 | * @return string Google fonts URL for the theme. 196 | */ 197 | function twentysixteen_fonts_url() { 198 | $fonts_url = ''; 199 | $fonts = array(); 200 | $subsets = 'latin,latin-ext'; 201 | 202 | /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ 203 | if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { 204 | $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; 205 | } 206 | 207 | /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ 208 | if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { 209 | $fonts[] = 'Montserrat:400,700'; 210 | } 211 | 212 | /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ 213 | if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { 214 | $fonts[] = 'Inconsolata:400'; 215 | } 216 | 217 | if ( $fonts ) { 218 | $fonts_url = add_query_arg( array( 219 | 'family' => urlencode( implode( '|', $fonts ) ), 220 | 'subset' => urlencode( $subsets ), 221 | ), 'https://fonts.googleapis.com/css' ); 222 | } 223 | 224 | return $fonts_url; 225 | } 226 | endif; 227 | 228 | /** 229 | * Handles JavaScript detection. 230 | * 231 | * Adds a `js` class to the root `` element when JavaScript is detected. 232 | * 233 | * @since Twenty Sixteen 1.0 234 | */ 235 | function twentysixteen_javascript_detection() { 236 | echo "\n"; 237 | } 238 | add_action( 'wp_head', 'twentysixteen_javascript_detection', 0 ); 239 | 240 | /** 241 | * Enqueues scripts and styles. 242 | * 243 | * @since Twenty Sixteen 1.0 244 | */ 245 | function twentysixteen_scripts() { 246 | // Add custom fonts, used in the main stylesheet. 247 | wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); 248 | 249 | // Add Genericons, used in the main stylesheet. 250 | wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' ); 251 | 252 | // Theme stylesheet. 253 | wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri() ); 254 | 255 | // Load the Internet Explorer specific stylesheet. 256 | wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20160816' ); 257 | wp_style_add_data( 'twentysixteen-ie', 'conditional', 'lt IE 10' ); 258 | 259 | // Load the Internet Explorer 8 specific stylesheet. 260 | wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20160816' ); 261 | wp_style_add_data( 'twentysixteen-ie8', 'conditional', 'lt IE 9' ); 262 | 263 | // Load the Internet Explorer 7 specific stylesheet. 264 | wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20160816' ); 265 | wp_style_add_data( 'twentysixteen-ie7', 'conditional', 'lt IE 8' ); 266 | 267 | // Load the html5 shiv. 268 | wp_enqueue_script( 'twentysixteen-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' ); 269 | wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' ); 270 | 271 | wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20160816', true ); 272 | 273 | if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { 274 | wp_enqueue_script( 'comment-reply' ); 275 | } 276 | 277 | if ( is_singular() && wp_attachment_is_image() ) { 278 | wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160816' ); 279 | } 280 | 281 | wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20160816', true ); 282 | 283 | wp_localize_script( 'twentysixteen-script', 'screenReaderText', array( 284 | 'expand' => __( 'expand child menu', 'twentysixteen' ), 285 | 'collapse' => __( 'collapse child menu', 'twentysixteen' ), 286 | ) ); 287 | } 288 | add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); 289 | 290 | /** 291 | * Adds custom classes to the array of body classes. 292 | * 293 | * @since Twenty Sixteen 1.0 294 | * 295 | * @param array $classes Classes for the body element. 296 | * @return array (Maybe) filtered body classes. 297 | */ 298 | function twentysixteen_body_classes( $classes ) { 299 | // Adds a class of custom-background-image to sites with a custom background image. 300 | if ( get_background_image() ) { 301 | $classes[] = 'custom-background-image'; 302 | } 303 | 304 | // Adds a class of group-blog to sites with more than 1 published author. 305 | if ( is_multi_author() ) { 306 | $classes[] = 'group-blog'; 307 | } 308 | 309 | // Adds a class of no-sidebar to sites without active sidebar. 310 | if ( ! is_active_sidebar( 'sidebar-1' ) ) { 311 | $classes[] = 'no-sidebar'; 312 | } 313 | 314 | // Adds a class of hfeed to non-singular pages. 315 | if ( ! is_singular() ) { 316 | $classes[] = 'hfeed'; 317 | } 318 | 319 | return $classes; 320 | } 321 | add_filter( 'body_class', 'twentysixteen_body_classes' ); 322 | 323 | /** 324 | * Converts a HEX value to RGB. 325 | * 326 | * @since Twenty Sixteen 1.0 327 | * 328 | * @param string $color The original color, in 3- or 6-digit hexadecimal form. 329 | * @return array Array containing RGB (red, green, and blue) values for the given 330 | * HEX code, empty array otherwise. 331 | */ 332 | function twentysixteen_hex2rgb( $color ) { 333 | $color = trim( $color, '#' ); 334 | 335 | if ( strlen( $color ) === 3 ) { 336 | $r = hexdec( substr( $color, 0, 1 ).substr( $color, 0, 1 ) ); 337 | $g = hexdec( substr( $color, 1, 1 ).substr( $color, 1, 1 ) ); 338 | $b = hexdec( substr( $color, 2, 1 ).substr( $color, 2, 1 ) ); 339 | } else if ( strlen( $color ) === 6 ) { 340 | $r = hexdec( substr( $color, 0, 2 ) ); 341 | $g = hexdec( substr( $color, 2, 2 ) ); 342 | $b = hexdec( substr( $color, 4, 2 ) ); 343 | } else { 344 | return array(); 345 | } 346 | 347 | return array( 'red' => $r, 'green' => $g, 'blue' => $b ); 348 | } 349 | 350 | /** 351 | * Custom template tags for this theme. 352 | */ 353 | require get_template_directory() . '/inc/template-tags.php'; 354 | 355 | /** 356 | * Customizer additions. 357 | */ 358 | require get_template_directory() . '/inc/customizer.php'; 359 | 360 | /** 361 | * Add custom image sizes attribute to enhance responsive image functionality 362 | * for content images 363 | * 364 | * @since Twenty Sixteen 1.0 365 | * 366 | * @param string $sizes A source size value for use in a 'sizes' attribute. 367 | * @param array $size Image size. Accepts an array of width and height 368 | * values in pixels (in that order). 369 | * @return string A source size value for use in a content image 'sizes' attribute. 370 | */ 371 | function twentysixteen_content_image_sizes_attr( $sizes, $size ) { 372 | $width = $size[0]; 373 | 374 | 840 <= $width && $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px'; 375 | 376 | if ( 'page' === get_post_type() ) { 377 | 840 > $width && $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; 378 | } else { 379 | 840 > $width && 600 <= $width && $sizes = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px'; 380 | 600 > $width && $sizes = '(max-width: ' . $width . 'px) 85vw, ' . $width . 'px'; 381 | } 382 | 383 | return $sizes; 384 | } 385 | add_filter( 'wp_calculate_image_sizes', 'twentysixteen_content_image_sizes_attr', 10 , 2 ); 386 | 387 | /** 388 | * Add custom image sizes attribute to enhance responsive image functionality 389 | * for post thumbnails 390 | * 391 | * @since Twenty Sixteen 1.0 392 | * 393 | * @param array $attr Attributes for the image markup. 394 | * @param int $attachment Image attachment ID. 395 | * @param array $size Registered image size or flat array of height and width dimensions. 396 | * @return string A source size value for use in a post thumbnail 'sizes' attribute. 397 | */ 398 | function twentysixteen_post_thumbnail_sizes_attr( $attr, $attachment, $size ) { 399 | if ( 'post-thumbnail' === $size ) { 400 | is_active_sidebar( 'sidebar-1' ) && $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 60vw, (max-width: 1362px) 62vw, 840px'; 401 | ! is_active_sidebar( 'sidebar-1' ) && $attr['sizes'] = '(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 88vw, 1200px'; 402 | } 403 | return $attr; 404 | } 405 | add_filter( 'wp_get_attachment_image_attributes', 'twentysixteen_post_thumbnail_sizes_attr', 10 , 3 ); 406 | 407 | /** 408 | * Modifies tag cloud widget arguments to have all tags in the widget same font size. 409 | * 410 | * @since Twenty Sixteen 1.1 411 | * 412 | * @param array $args Arguments for tag cloud widget. 413 | * @return array A new modified arguments. 414 | */ 415 | function twentysixteen_widget_tag_cloud_args( $args ) { 416 | $args['largest'] = 1; 417 | $args['smallest'] = 1; 418 | $args['unit'] = 'em'; 419 | return $args; 420 | } 421 | add_filter( 'widget_tag_cloud_args', 'twentysixteen_widget_tag_cloud_args' ); 422 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/genericons/COPYING.txt: -------------------------------------------------------------------------------- 1 | Genericons is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 2 | 3 | The fonts are distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 4 | 5 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 6 | 7 | As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. 8 | 9 | This license does not convey any intellectual property rights to third party trademarks that may be included in the icon font; such marks remain subject to all rights and guidelines of use of their owner. -------------------------------------------------------------------------------- /src/assets/twentysixteen/genericons/Genericons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soderlind/plugin-customizer/04f62e7cb9bd22ac0f1bdf010f93f1f873d0802e/src/assets/twentysixteen/genericons/Genericons.eot -------------------------------------------------------------------------------- /src/assets/twentysixteen/genericons/Genericons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soderlind/plugin-customizer/04f62e7cb9bd22ac0f1bdf010f93f1f873d0802e/src/assets/twentysixteen/genericons/Genericons.ttf -------------------------------------------------------------------------------- /src/assets/twentysixteen/genericons/Genericons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soderlind/plugin-customizer/04f62e7cb9bd22ac0f1bdf010f93f1f873d0802e/src/assets/twentysixteen/genericons/Genericons.woff -------------------------------------------------------------------------------- /src/assets/twentysixteen/genericons/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/genericons/README.md: -------------------------------------------------------------------------------- 1 | # Genericons 2 | 3 | Genericons are vector icons embedded in a webfont designed to be clean and simple keeping with a generic aesthetic. 4 | 5 | Use genericons for instant HiDPI, to change icon colors on the fly, or even with CSS effects such as drop-shadows or gradients! 6 | 7 | 8 | ## Usage 9 | 10 | To use it, place the `genericons` folder in your stylesheet directory and enqueue the genericons.css file. Now you can create an icon like this: 11 | 12 | ``` 13 | .my-icon:before { 14 | content: '\f101'; 15 | font: normal 16px/1 'Genericons'; 16 | display: inline-block; 17 | -webkit-font-smoothing: antialiased; 18 | -moz-osx-font-smoothing: grayscale; 19 | } 20 | ``` 21 | 22 | This will output a comment icon before every element with the class "my-icon". The `content: '\f101';` part of this CSS is easily copied from the helper tool at http://genericons.com/, or `example.html` in the `font` directory. 23 | 24 | You can also use the bundled example.css if you'd rather insert the icons using HTML tags. 25 | 26 | 27 | ## Building your own Genericons 28 | 29 | In the `source` directory, you'll find all Genericons source icons in SVG format. This will allow you to bake your own flavor of Genericons using a tool such as FontCustom (http://fontcustom.com) or Fontello (http://fontello.com). Perhaps you need more logos than are available in the base Genericons package? Just add those logos and bake your own expanded set. Maybe you need just a few of the icons Genericons provides, but would like to trim the fat? Remove the ones you won't need! 30 | 31 | 32 | ### FontCustom instructions 33 | 34 | FontCustom is a powerful commandline tool which which bakes icon fonts from the SVG source files. It's the tool Genericons is built on, and it provides highly accurate and perfectly crisp icons, *provided all SVGs have the same pixel height*. 35 | 36 | It's not that hard to use, and once it's installed you'll never think of icon-fonts the same way again. Seriously, you should try it. Icon fonts for everyone! 37 | 38 | 1. Install FontCustom. Follow the instructions on the website: http://fontcustom.com/ 39 | 2. In the `source` directory from the Genericons download, open the file called `fontcustom.yml` in a text editor. Customize the `font_name` and `css_selector`. 40 | 3. Open a terminal. Browse to the `source` directory. Type `fontcustom compile`. 41 | 42 | You'll now receive a brand new subdirectory called `fontcustom-webfont`. Inside here you'll find your very own flavor of Genericons, with only the icons you want, including a handy example page that'll help you copy/paste the necessary glyphs or CSS values. 43 | 44 | *Please note*: In the source directory, there's a hidden file called `.fontcustom-manifest.json`. This file is auto-generated by the FontCustom tool, and holds codepoints (unicode addresses) for every glyph, so its address doesn't change when you add or remove icons. If you feel the need to "start fresh" with the unicode addresses, you should delete this file. 45 | 46 | 47 | ### Fontello instructions 48 | 49 | Fontello is very easy to use. Just drop the SVG files of the icons you want onto their website and download the font. The downside is that Fontello seems to ignore the 16px pixelgrid, so you'll end up with fuzzy icons. Buyer beware. 50 | 51 | 52 | ## Notes 53 | 54 | **Photoshop mockups** 55 | 56 | The `Genericons.ttf` file can be placed in your system fonts folder and used Photoshop or other graphics apps if you like. 57 | 58 | If you're using Genericons in your Photoshop mockups, please remember to delete the old version of the font from Font Book, and grab the new one from the zip file. This also affects using it in your webdesigns: if you have an old version of the font installed locally, that's the font that'll be used in your website as well, so if you're missing icons, check for old versions of the font on your system. 59 | 60 | **Pixel grid** 61 | 62 | Genericons has been designed for a 16x16px grid. That means it'll look sharp at font-size: 16px exactly. It'll also be crisp at multiples thereof, such as 32px or 64px. It'll look reasonably crisp at in-between font sizes such as 24px or 48px, but not quite as crisp as 16 or 32. Please don't set the font-size to 17px, though, that'll just look terrible blurry. 63 | 64 | **Antialiasing** 65 | 66 | If you keep intact the `-webkit-font-smoothing: antialiased;` and `-moz-osx-font-smoothing: grayscale;` CSS properties. That'll make the icons look their best possible, in Firefox and WebKit based browsers. 67 | 68 | **optimizeLegibility** 69 | 70 | Note: On Android browsers with version 4.2, 4.3, and probably later, Genericons will simply not show up if you're using the CSS property "text-rendering" set to "optimizeLegibility. 71 | 72 | **Updates** 73 | 74 | We don't often update icons, but do very carefully when we get good feedback suggesting improvements. Please be mindful if you upgrade, and check that the updated icons behave as you intended. 75 | 76 | **Base64 encoding** 77 | 78 | By default, Genericons ships with a stylesheet that includes a base64 encoded version of the font. This is to sidestep issues with cross-origin requests for fonts, that happen when a stylesheet loads a font that's stored on a different domain or subdomain. This is very common when using caching plugins. 79 | 80 | Base64 encoding comes with a 25% filesize overhead compared to just loading the WOFF file directly. If you know that you won't be loading fonts across domains, or have the ability to edit your server config files to allow it, you can get slightly faster performance by loading Genericons without the base64 encoding. Simply edit `genericons.css` and edit the `@font-face` declaration to match this: 81 | 82 | ``` 83 | @font-face { 84 | font-family: 'Genericons'; 85 | src: url('Genericons.woff') format('woff'), 86 | url('Genericons.ttf') format('truetype'), 87 | url('Genericons.svg#genericonsregular') format('svg'); 88 | font-weight: normal; 89 | font-style: normal; 90 | } 91 | ``` 92 | 93 | 94 | 95 | ## Changelog 96 | 97 | **3.4.1** 98 | 99 | * IE8 support restored. 100 | 101 | **3.4** 102 | 103 | * Updated: Update Google Plus icon to new geometric version. This also *retires* the "alt" version, so *please be mindful if you choose to update, make sure you use the `f206` glyph, not the `f218` glyph, as it no longer exists! 104 | * New: Added helper rotation classes to the base CSS, thanks to geminorum. Apply `genericon-rotate-90` to rotate 90 degrees, -180, -270. Or `genericon-flip-horizontal` or -vertical. 105 | 106 | *Again, it is important if you choose to update to this version, make sure you're not using `genericon-googleplus-alt` or unicode character `f218`, as that has been retired! Use `genericon-googleplus` and glyph `f206` instead!* 107 | 108 | **3.3.1** 109 | 110 | Security Hardening: Remove Genericons example.html file. Please visit genericons.com instead. 111 | 112 | **3.3** 113 | 114 | The Open Source release. 115 | 116 | You can now build your own flavors of Genericons with all the SVGs provided. 117 | 118 | 119 | **3.2** 120 | 121 | A number of new icons and a couple of quick updates. 122 | 123 | * New: Activity 124 | * New: HTML anchor 125 | * New: Bug 126 | * New: Download 127 | * New: Handset 128 | * New: Microphone 129 | * New: Minus 130 | * New: Plus 131 | * New: Move 132 | * New: Rating stars, empty, half, full 133 | * New: Shuffle 134 | * New: video camera 135 | * New: Spotify 136 | * New: Twitch 137 | * Update: Fixed geometry in Edit icon 138 | * Update: Updated Foursquare icon 139 | * IE8 bugfix, slipstreamed into this. 140 | 141 | Twitch and Spotify mark the last social icons that will be added to Genericons. 142 | Future social icons will have to happen in a separate font. 143 | 144 | **3.1** 145 | 146 | Genericons is now generated using a commandline tool called FontCustom. This makes it far easier to add new icons to the font, but the switch means the download zip now has a different layout, fonts have different filenames, there's now no .otf font included (but the .ttf should suffice), and the font now has slightly different metrics. I've taken great care to ensure this new version should work as a drop-in replacement, but please be mindful and test carefully if you choose to upgrade. 147 | 148 | * Per feedback, the baked-in 16px width and height has been removed from the helper CSS. It wasn't really necessary (the glyph itself has these dimensions naturally), and it caused some headaches. 149 | * Base64 encoding is now included by default in the helper CSS. This makes it drop-in easy to get Genericons working in Firefox even when using a CDN. 150 | * Title attribute on website tool. 151 | * New: Website. 152 | * New: Ellipsis. 153 | * New: Foursquare. 154 | * New: X-post. 155 | * New: Sitemap. 156 | * New: Hierarchy. 157 | * New: Paintbrush. 158 | * Updated: Show and Hide icons were updated for clarity. 159 | 160 | **3.0.3** 161 | 162 | Bunch of updates mostly. 163 | 164 | * Two new icons, Dropbox and Fullscreen. 165 | * Updates to all icons containing an exclamation mark. 166 | * Updates to Image and Quote. 167 | * Nicer "Share" icon. 168 | * Bigger default Linkedin icon. 169 | 170 | **3.0.2** 171 | 172 | A slew of new stuff and updates. 173 | 174 | * Social icons: Skype, Digg, Reddit, Stumbleupon, Pocket. 175 | * New generic icons: heart, lock and print. 176 | * New editing icons: code, bold, italic, image 177 | * New interaction icons: subscribe, unsubscribe, subscribed, reply all, reply, flag. 178 | * The hyperlink icon has been updated to be clearer, chunkier. 179 | * The "home" icon has been updated for style, size and clarity. 180 | * The email icon has been updated for style and clarity, and to fit with the new subscribe icons. 181 | * The document icon has been updated for style. 182 | * The "pin" icon has been updated for style and clarity. 183 | * The Twitter icon has been scaled down to fit with the other social icons. 184 | 185 | **3.0.1** 186 | 187 | Mostly maintenance. 188 | 189 | * Fixed an issue with the example page that showed an old "top" icon instead of the actual NEW "refresh" icon. 190 | * Added inverse Google+ and Path. 191 | * Replaced tabs with spaces in the helper CSS. 192 | * Changed the Genericons.com copy/paste tool to serve span's instead of div's for casual icon insertion. It's being converted to "inline-block" anyway. 193 | 194 | **3.0** 195 | 196 | Mainly maintenance and a few new icons. 197 | 198 | * Fast forward, rewind, PollDaddy, Notice, Info, Help, Portfolio 199 | * Updated the feed icon. It's a bit smaller now for consistency, the previous one was rather big. 200 | * So, the previous version numbering, 2.09, wasn't very PHP version compare friendly. So from now on it'll be 3.0, 3.1 etc. Props Ipstenu. 201 | * Genericons.com now has a mini release blog. 202 | * The CSS has prettier formatting, props Konstantin Obenland. 203 | 204 | **2.09** 205 | 206 | Updated Facebook icon to new version. Updated Instagram logo to use new one-color version. Updated Google+ icon to use same radius as Instagram and Facebook. Added a bunch of new icons, cog, unapprove, cart, media player buttons, tablet, send to tablet. 207 | 208 | **2.06** 209 | 210 | Included Base64 encoded version. This is necessary for Genericons to work with CDNs in Firefox. Firefox blocks fonts linked from a different domain. A CDN (typically s.example.com) usually puts the font on a subdomain, and is hence blocked in Firefox. 211 | 212 | **2.05** 213 | 214 | Added a bunch of new icons, including upload to cloud, download to cloud, many more. 215 | 216 | **2.0** 217 | 218 | Initial public release 219 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/header.php: -------------------------------------------------------------------------------- 1 | 13 | class="no-js"> 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | > 25 |
26 |
27 | 28 | 29 | 98 | 99 |
100 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/image.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 | 15 | 19 | 20 |
> 21 | 22 | 28 | 29 |
30 | ', '' ); ?> 31 |
32 | 33 |
34 | 35 |
36 | 48 | 49 | 50 | 51 |
52 | 53 | '', 58 | 'link_before' => '', 59 | 'link_after' => '', 60 | 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', 61 | 'separator' => ', ', 62 | ) ); 63 | ?> 64 |
65 | 66 |
67 | 68 | %1$s %3$s × %4$s', 73 | esc_html_x( 'Full size', 'Used before full size attachment link.', 'twentysixteen' ), 74 | esc_url( wp_get_attachment_url() ), 75 | absint( $metadata['width'] ), 76 | absint( $metadata['height'] ) 77 | ); 78 | } 79 | ?> 80 | "%s"', 'twentysixteen' ), 85 | get_the_title() 86 | ), 87 | '', 88 | '' 89 | ); 90 | ?> 91 |
92 |
93 | 94 | _x( 'Published in%title', 'Parent post link', 'twentysixteen' ), 103 | ) ); 104 | // End the loop. 105 | endwhile; 106 | ?> 107 | 108 |
109 |
110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/inc/back-compat.php: -------------------------------------------------------------------------------- 1 |

%s

', $message ); 43 | } 44 | 45 | /** 46 | * Prevents the Customizer from being loaded on WordPress versions prior to 4.4. 47 | * 48 | * @since Twenty Sixteen 1.0 49 | * 50 | * @global string $wp_version WordPress version. 51 | */ 52 | function twentysixteen_customize() { 53 | wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), '', array( 54 | 'back_link' => true, 55 | ) ); 56 | } 57 | add_action( 'load-customize.php', 'twentysixteen_customize' ); 58 | 59 | /** 60 | * Prevents the Theme Preview from being loaded on WordPress versions prior to 4.4. 61 | * 62 | * @since Twenty Sixteen 1.0 63 | * 64 | * @global string $wp_version WordPress version. 65 | */ 66 | function twentysixteen_preview() { 67 | if ( isset( $_GET['preview'] ) ) { 68 | wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ) ); 69 | } 70 | } 71 | add_action( 'template_redirect', 'twentysixteen_preview' ); 72 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/inc/template-tags.php: -------------------------------------------------------------------------------- 1 | %1$s%2$s %4$s', 24 | get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_size ), 25 | _x( 'Author', 'Used before post author name.', 'twentysixteen' ), 26 | esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), 27 | get_the_author() 28 | ); 29 | } 30 | 31 | if ( in_array( get_post_type(), array( 'post', 'attachment' ) ) ) { 32 | twentysixteen_entry_date(); 33 | } 34 | 35 | $format = get_post_format(); 36 | if ( current_theme_supports( 'post-formats', $format ) ) { 37 | printf( '%1$s%3$s', 38 | sprintf( '%s ', _x( 'Format', 'Used before post format.', 'twentysixteen' ) ), 39 | esc_url( get_post_format_link( $format ) ), 40 | get_post_format_string( $format ) 41 | ); 42 | } 43 | 44 | if ( 'post' === get_post_type() ) { 45 | twentysixteen_entry_taxonomies(); 46 | } 47 | 48 | if ( ! is_singular() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { 49 | echo ''; 50 | comments_popup_link( sprintf( __( 'Leave a comment on %s', 'twentysixteen' ), get_the_title() ) ); 51 | echo ''; 52 | } 53 | } 54 | endif; 55 | 56 | if ( ! function_exists( 'twentysixteen_entry_date' ) ) : 57 | /** 58 | * Prints HTML with date information for current post. 59 | * 60 | * Create your own twentysixteen_entry_date() function to override in a child theme. 61 | * 62 | * @since Twenty Sixteen 1.0 63 | */ 64 | function twentysixteen_entry_date() { 65 | $time_string = ''; 66 | 67 | if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { 68 | $time_string = ''; 69 | } 70 | 71 | $time_string = sprintf( $time_string, 72 | esc_attr( get_the_date( 'c' ) ), 73 | get_the_date(), 74 | esc_attr( get_the_modified_date( 'c' ) ), 75 | get_the_modified_date() 76 | ); 77 | 78 | printf( '%1$s %3$s', 79 | _x( 'Posted on', 'Used before publish date.', 'twentysixteen' ), 80 | esc_url( get_permalink() ), 81 | $time_string 82 | ); 83 | } 84 | endif; 85 | 86 | if ( ! function_exists( 'twentysixteen_entry_taxonomies' ) ) : 87 | /** 88 | * Prints HTML with category and tags for current post. 89 | * 90 | * Create your own twentysixteen_entry_taxonomies() function to override in a child theme. 91 | * 92 | * @since Twenty Sixteen 1.0 93 | */ 94 | function twentysixteen_entry_taxonomies() { 95 | $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); 96 | if ( $categories_list && twentysixteen_categorized_blog() ) { 97 | printf( '%1$s %2$s', 98 | _x( 'Categories', 'Used before category names.', 'twentysixteen' ), 99 | $categories_list 100 | ); 101 | } 102 | 103 | $tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'twentysixteen' ) ); 104 | if ( $tags_list ) { 105 | printf( '%1$s %2$s', 106 | _x( 'Tags', 'Used before tag names.', 'twentysixteen' ), 107 | $tags_list 108 | ); 109 | } 110 | } 111 | endif; 112 | 113 | if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : 114 | /** 115 | * Displays an optional post thumbnail. 116 | * 117 | * Wraps the post thumbnail in an anchor element on index views, or a div 118 | * element when on single views. 119 | * 120 | * Create your own twentysixteen_post_thumbnail() function to override in a child theme. 121 | * 122 | * @since Twenty Sixteen 1.0 123 | */ 124 | function twentysixteen_post_thumbnail() { 125 | if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { 126 | return; 127 | } 128 | 129 | if ( is_singular() ) : 130 | ?> 131 | 132 |
133 | 134 |
135 | 136 | 137 | 138 | 141 | 142 | 162 |
163 | 164 |
165 | %2$s', 182 | esc_url( get_permalink( get_the_ID() ) ), 183 | /* translators: %s: Name of current post */ 184 | sprintf( __( 'Continue reading "%s"', 'twentysixteen' ), get_the_title( get_the_ID() ) ) 185 | ); 186 | return ' … ' . $link; 187 | } 188 | add_filter( 'excerpt_more', 'twentysixteen_excerpt_more' ); 189 | endif; 190 | 191 | if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : 192 | /** 193 | * Determines whether blog/site has more than one category. 194 | * 195 | * Create your own twentysixteen_categorized_blog() function to override in a child theme. 196 | * 197 | * @since Twenty Sixteen 1.0 198 | * 199 | * @return bool True if there is more than one category, false otherwise. 200 | */ 201 | function twentysixteen_categorized_blog() { 202 | if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { 203 | // Create an array of all the categories that are attached to posts. 204 | $all_the_cool_cats = get_categories( array( 205 | 'fields' => 'ids', 206 | // We only need to know if there is more than one category. 207 | 'number' => 2, 208 | ) ); 209 | 210 | // Count the number of categories that are attached to the posts. 211 | $all_the_cool_cats = count( $all_the_cool_cats ); 212 | 213 | set_transient( 'twentysixteen_categories', $all_the_cool_cats ); 214 | } 215 | 216 | if ( $all_the_cool_cats > 1 ) { 217 | // This blog has more than 1 category so twentysixteen_categorized_blog should return true. 218 | return true; 219 | } else { 220 | // This blog has only 1 category so twentysixteen_categorized_blog should return false. 221 | return false; 222 | } 223 | } 224 | endif; 225 | 226 | /** 227 | * Flushes out the transients used in twentysixteen_categorized_blog(). 228 | * 229 | * @since Twenty Sixteen 1.0 230 | */ 231 | function twentysixteen_category_transient_flusher() { 232 | if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { 233 | return; 234 | } 235 | // Like, beat it. Dig? 236 | delete_transient( 'twentysixteen_categories' ); 237 | } 238 | add_action( 'edit_category', 'twentysixteen_category_transient_flusher' ); 239 | add_action( 'save_post', 'twentysixteen_category_transient_flusher' ); 240 | 241 | if ( ! function_exists( 'twentysixteen_the_custom_logo' ) ) : 242 | /** 243 | * Displays the optional custom logo. 244 | * 245 | * Does nothing if the custom logo is not available. 246 | * 247 | * @since Twenty Sixteen 1.2 248 | */ 249 | function twentysixteen_the_custom_logo() { 250 | if ( function_exists( 'the_custom_logo' ) ) { 251 | the_custom_logo(); 252 | } 253 | } 254 | endif; 255 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/index.php: -------------------------------------------------------------------------------- 1 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 25 |
26 |

27 |
28 | 29 | 30 | __( 'Previous page', 'twentysixteen' ), 47 | 'next_text' => __( 'Next page', 'twentysixteen' ), 48 | 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', 49 | ) ); 50 | 51 | // If no content, include the "No posts found" template. 52 | else : 53 | get_template_part( 'template-parts/content', 'none' ); 54 | 55 | endif; 56 | ?> 57 | 58 |
59 |
60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/js/color-scheme-control.js: -------------------------------------------------------------------------------- 1 | /* global colorScheme, Color */ 2 | /** 3 | * Add a listener to the Color Scheme control to update other color controls to new values/defaults. 4 | * Also trigger an update of the Color Scheme CSS when a color is changed. 5 | */ 6 | 7 | ( function( api ) { 8 | var cssTemplate = wp.template( 'twentysixteen-color-scheme' ), 9 | colorSchemeKeys = [ 10 | 'background_color', 11 | 'page_background_color', 12 | 'link_color', 13 | 'main_text_color', 14 | 'secondary_text_color' 15 | ], 16 | colorSettings = [ 17 | 'background_color', 18 | 'page_background_color', 19 | 'link_color', 20 | 'main_text_color', 21 | 'secondary_text_color' 22 | ]; 23 | 24 | api.controlConstructor.select = api.Control.extend( { 25 | ready: function() { 26 | if ( 'color_scheme' === this.id ) { 27 | this.setting.bind( 'change', function( value ) { 28 | var colors = colorScheme[value].colors; 29 | 30 | // Update Background Color. 31 | var color = colors[0]; 32 | api( 'background_color' ).set( color ); 33 | api.control( 'background_color' ).container.find( '.color-picker-hex' ) 34 | .data( 'data-default-color', color ) 35 | .wpColorPicker( 'defaultColor', color ); 36 | 37 | // Update Page Background Color. 38 | color = colors[1]; 39 | api( 'page_background_color' ).set( color ); 40 | api.control( 'page_background_color' ).container.find( '.color-picker-hex' ) 41 | .data( 'data-default-color', color ) 42 | .wpColorPicker( 'defaultColor', color ); 43 | 44 | // Update Link Color. 45 | color = colors[2]; 46 | api( 'link_color' ).set( color ); 47 | api.control( 'link_color' ).container.find( '.color-picker-hex' ) 48 | .data( 'data-default-color', color ) 49 | .wpColorPicker( 'defaultColor', color ); 50 | 51 | // Update Main Text Color. 52 | color = colors[3]; 53 | api( 'main_text_color' ).set( color ); 54 | api.control( 'main_text_color' ).container.find( '.color-picker-hex' ) 55 | .data( 'data-default-color', color ) 56 | .wpColorPicker( 'defaultColor', color ); 57 | 58 | // Update Secondary Text Color. 59 | color = colors[4]; 60 | api( 'secondary_text_color' ).set( color ); 61 | api.control( 'secondary_text_color' ).container.find( '.color-picker-hex' ) 62 | .data( 'data-default-color', color ) 63 | .wpColorPicker( 'defaultColor', color ); 64 | } ); 65 | } 66 | } 67 | } ); 68 | 69 | // Generate the CSS for the current Color Scheme. 70 | function updateCSS() { 71 | var scheme = api( 'color_scheme' )(), 72 | css, 73 | colors = _.object( colorSchemeKeys, colorScheme[ scheme ].colors ); 74 | 75 | // Merge in color scheme overrides. 76 | _.each( colorSettings, function( setting ) { 77 | colors[ setting ] = api( setting )(); 78 | } ); 79 | 80 | // Add additional color. 81 | // jscs:disable 82 | colors.border_color = Color( colors.main_text_color ).toCSS( 'rgba', 0.2 ); 83 | // jscs:enable 84 | 85 | css = cssTemplate( colors ); 86 | 87 | api.previewer.send( 'update-color-scheme-css', css ); 88 | } 89 | 90 | // Update the CSS whenever a color setting is changed. 91 | _.each( colorSettings, function( setting ) { 92 | api( setting, function( setting ) { 93 | setting.bind( updateCSS ); 94 | } ); 95 | } ); 96 | } )( wp.customize ); 97 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/js/customize-preview.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Live-update changed settings in real time in the Customizer preview. 3 | */ 4 | 5 | ( function( $ ) { 6 | var style = $( '#twentysixteen-color-scheme-css' ), 7 | api = wp.customize; 8 | 9 | if ( ! style.length ) { 10 | style = $( 'head' ).append( ''; 72 | return parent.insertBefore(p.lastChild, parent.firstChild); 73 | } 74 | 75 | /** 76 | * Returns the value of `html5.elements` as an array. 77 | * @private 78 | * @returns {Array} An array of shived element node names. 79 | */ 80 | function getElements() { 81 | var elements = html5.elements; 82 | return typeof elements == 'string' ? elements.split(' ') : elements; 83 | } 84 | 85 | /** 86 | * Extends the built-in list of html5 elements 87 | * @memberOf html5 88 | * @param {String|Array} newElements whitespace separated list or array of new element names to shiv 89 | * @param {Document} ownerDocument The context document. 90 | */ 91 | function addElements(newElements, ownerDocument) { 92 | var elements = html5.elements; 93 | if(typeof elements != 'string'){ 94 | elements = elements.join(' '); 95 | } 96 | if(typeof newElements != 'string'){ 97 | newElements = newElements.join(' '); 98 | } 99 | html5.elements = elements +' '+ newElements; 100 | shivDocument(ownerDocument); 101 | } 102 | 103 | /** 104 | * Returns the data associated to the given document 105 | * @private 106 | * @param {Document} ownerDocument The document. 107 | * @returns {Object} An object of data. 108 | */ 109 | function getExpandoData(ownerDocument) { 110 | var data = expandoData[ownerDocument[expando]]; 111 | if (!data) { 112 | data = {}; 113 | expanID++; 114 | ownerDocument[expando] = expanID; 115 | expandoData[expanID] = data; 116 | } 117 | return data; 118 | } 119 | 120 | /** 121 | * returns a shived element for the given nodeName and document 122 | * @memberOf html5 123 | * @param {String} nodeName name of the element 124 | * @param {Document|DocumentFragment} ownerDocument The context document. 125 | * @returns {Object} The shived element. 126 | */ 127 | function createElement(nodeName, ownerDocument, data){ 128 | if (!ownerDocument) { 129 | ownerDocument = document; 130 | } 131 | if(supportsUnknownElements){ 132 | return ownerDocument.createElement(nodeName); 133 | } 134 | if (!data) { 135 | data = getExpandoData(ownerDocument); 136 | } 137 | var node; 138 | 139 | if (data.cache[nodeName]) { 140 | node = data.cache[nodeName].cloneNode(); 141 | } else if (saveClones.test(nodeName)) { 142 | node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); 143 | } else { 144 | node = data.createElem(nodeName); 145 | } 146 | 147 | // Avoid adding some elements to fragments in IE < 9 because 148 | // * Attributes like `name` or `type` cannot be set/changed once an element 149 | // is inserted into a document/fragment 150 | // * Link elements with `src` attributes that are inaccessible, as with 151 | // a 403 response, will cause the tab/window to crash 152 | // * Script elements appended to fragments will execute when their `src` 153 | // or `text` property is set 154 | return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; 155 | } 156 | 157 | /** 158 | * returns a shived DocumentFragment for the given document 159 | * @memberOf html5 160 | * @param {Document} ownerDocument The context document. 161 | * @returns {Object} The shived DocumentFragment. 162 | */ 163 | function createDocumentFragment(ownerDocument, data){ 164 | if (!ownerDocument) { 165 | ownerDocument = document; 166 | } 167 | if(supportsUnknownElements){ 168 | return ownerDocument.createDocumentFragment(); 169 | } 170 | data = data || getExpandoData(ownerDocument); 171 | var clone = data.frag.cloneNode(), 172 | i = 0, 173 | elems = getElements(), 174 | l = elems.length; 175 | for(;i -1, 10 | isOpera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 11 | isIE = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 12 | 13 | if ( ( isWebkit || isOpera || isIE ) && document.getElementById && window.addEventListener ) { 14 | window.addEventListener( 'hashchange', function() { 15 | var id = location.hash.substring( 1 ), 16 | element; 17 | 18 | if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 19 | return; 20 | } 21 | 22 | element = document.getElementById( id ); 23 | 24 | if ( element ) { 25 | if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 26 | element.tabIndex = -1; 27 | } 28 | 29 | element.focus(); 30 | 31 | // Repositions the window on jump-to-anchor to account for admin bar and border height. 32 | window.scrollBy( 0, -53 ); 33 | } 34 | }, false ); 35 | } 36 | } )(); 37 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/page.php: -------------------------------------------------------------------------------- 1 | 15 | 16 |
17 |
18 | 33 | 34 |
35 | 36 | 37 | 38 |
39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/readme.txt: -------------------------------------------------------------------------------- 1 | === Twenty Sixteen === 2 | Contributors: the WordPress team 3 | Requires at least: WordPress 4.4 4 | Tested up to: WordPress 4.5 5 | Version: 1.3 6 | License: GPLv2 or later 7 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 | Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog 9 | 10 | == Description == 11 | Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. 12 | 13 | * Mobile-first, Responsive Layout 14 | * Custom Colors 15 | * Custom Header 16 | * Social Links 17 | * Post Formats 18 | * The GPL v2.0 or later license. :) Use it to make something cool. 19 | 20 | For more information about Twenty Sixteen please go to https://codex.wordpress.org/Twenty_Sixteen. 21 | 22 | == Installation == 23 | 24 | 1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button. 25 | 2. Type in Twenty Sixteen in the search form and press the 'Enter' key on your keyboard. 26 | 3. Click on the 'Activate' button to use your new theme right away. 27 | 4. Go to https://codex.wordpress.org/Twenty_Sixteen for a guide on how to customize this theme. 28 | 5. Navigate to Appearance > Customize in your admin panel and customize to taste. 29 | 30 | == Copyright == 31 | 32 | Twenty Sixteen WordPress Theme, Copyright 2014-2015 WordPress.org 33 | Twenty Sixteen is distributed under the terms of the GNU GPL 34 | 35 | This program is free software: you can redistribute it and/or modify 36 | it under the terms of the GNU General Public License as published by 37 | the Free Software Foundation, either version 2 of the License, or 38 | (at your option) any later version. 39 | 40 | This program is distributed in the hope that it will be useful, 41 | but WITHOUT ANY WARRANTY; without even the implied warranty of 42 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 43 | GNU General Public License for more details. 44 | 45 | Twenty Sixteen Theme bundles the following third-party resources: 46 | 47 | HTML5 Shiv v3.7.0, Copyright 2014 Alexander Farkas 48 | Licenses: MIT/GPL2 49 | Source: https://github.com/aFarkas/html5shiv 50 | 51 | Genericons icon font, Copyright 2013-2015 Automattic.com 52 | License: GNU GPL, Version 2 (or later) 53 | Source: http://www.genericons.com 54 | 55 | Image used in screenshot.png: A photo by Austin Schmid (https://unsplash.com/schmidy/), licensed under Creative Commons Zero(http://creativecommons.org/publicdomain/zero/1.0/) 56 | 57 | == Changelog == 58 | 59 | = 1.3 = 60 | * Released: August 16, 2016 61 | 62 | https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.3 63 | 64 | = 1.2 = 65 | * Released: April 12, 2016 66 | 67 | https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.2 68 | 69 | = 1.1 = 70 | * Released: January 6, 2016 71 | 72 | https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_1.1 73 | 74 | = 1.0 = 75 | * Released: December 8, 2015 76 | 77 | Initial release 78 | 79 | == Notes == 80 | 81 | Only the default and dark color schemes are accessibility ready. 82 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/rtl.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Twenty Sixteen 3 | Description: Adds support for languages written in a Right To Left (RTL) direction. 4 | It's easy, just a matter of overwriting all the horizontal positioning attributes 5 | of your CSS stylesheet in a separate stylesheet file named rtl.css. 6 | 7 | See: https://codex.wordpress.org/Right_to_Left_Language_Support 8 | */ 9 | 10 | /** 11 | * Table of Contents: 12 | * 13 | * 1.0 - Normalize 14 | * 2.0 - Typography 15 | * 3.0 - Elements 16 | * 4.0 - Forms 17 | * 5.0 - Navigations 18 | * 6.0 - Accessibility 19 | * 7.0 - Widgets 20 | * 8.0 - Content 21 | * 8.1 - Header 22 | * 8.2 - Posts and pages 23 | * 8.3 - Comments 24 | * 8.4 - Footer 25 | * 9.0 - Multisites 26 | * 10.0 - Media Queries 27 | * 10.1 - >= 710px 28 | * 10.2 - >= 910px 29 | * 10.3 - >= 985px 30 | * 10.4 - >= 1200px 31 | */ 32 | 33 | 34 | /** 35 | * 1.0 - Normalize 36 | */ 37 | 38 | body { 39 | direction: rtl; 40 | unicode-bidi: embed; 41 | } 42 | 43 | input[type="checkbox"], 44 | input[type="radio"] { 45 | margin-right: auto; 46 | margin-left: 0.4375em; 47 | } 48 | 49 | 50 | /** 51 | * 2.0 - Typography 52 | */ 53 | 54 | body, 55 | button, 56 | button[disabled]:hover, 57 | button[disabled]:focus, 58 | input[type="button"], 59 | input[type="button"][disabled]:hover, 60 | input[type="button"][disabled]:focus, 61 | input[type="reset"], 62 | input[type="reset"][disabled]:hover, 63 | input[type="reset"][disabled]:focus, 64 | input[type="submit"], 65 | input[type="submit"][disabled]:hover, 66 | input[type="submit"][disabled]:focus, 67 | input, 68 | select, 69 | textarea, 70 | .post-password-form label, 71 | .main-navigation, 72 | .post-navigation, 73 | .post-navigation .post-title, 74 | .pagination, 75 | .image-navigation, 76 | .comment-navigation, 77 | .site .skip-link, 78 | .logged-in .site .skip-link, 79 | .widget .widget-title, 80 | .widget_recent_entries .post-date, 81 | .widget_rss .rss-date, 82 | .widget_rss cite, 83 | .tagcloud a, 84 | .site-title, 85 | .entry-title, 86 | .entry-footer, 87 | .sticky-post, 88 | .page-title, 89 | .page-links, 90 | .comments-title, 91 | .comment-reply-title, 92 | .comment-metadata, 93 | .pingback .edit-link, 94 | .comment-reply-link, 95 | .comment-form label, 96 | .no-comments, 97 | .required, 98 | .site-footer .site-title, 99 | .site-footer .site-title:after, 100 | .widecolumn label, 101 | .widecolumn .mu_register label { 102 | font-family: Arial, Tahoma, sans-serif; 103 | } 104 | 105 | ::-webkit-input-placeholder { 106 | font-family: Arial, Tahoma, sans-serif; 107 | } 108 | 109 | :-moz-placeholder { 110 | font-family: Arial, Tahoma, sans-serif; 111 | } 112 | 113 | ::-moz-placeholder { 114 | font-family: Arial, Tahoma, sans-serif; 115 | } 116 | 117 | :-ms-input-placeholder { 118 | font-family: Arial, Tahoma, sans-serif; 119 | } 120 | 121 | blockquote { 122 | border-right-width: 4px; 123 | border-left-width: 0; 124 | padding-right: 1.263157895em; 125 | padding-left: 0; 126 | } 127 | 128 | .entry-content h1, 129 | .entry-content h2, 130 | .entry-content h3, 131 | .entry-content h4, 132 | .entry-content h5, 133 | .entry-content h6, 134 | .entry-summary h1, 135 | .entry-summary h2, 136 | .entry-summary h3, 137 | .entry-summary h4, 138 | .entry-summary h5, 139 | .entry-summary h6, 140 | .comment-content h1, 141 | .comment-content h2, 142 | .comment-content h3, 143 | .comment-content h4, 144 | .comment-content h5, 145 | .comment-content h6, 146 | .textwidget h1, 147 | .textwidget h2, 148 | .textwidget h3, 149 | .textwidget h4, 150 | .textwidget h5, 151 | .textwidget h6, 152 | .entry-content .author-title, 153 | .widget_calendar caption, 154 | .widecolumn h2 { 155 | font-weight: 700; 156 | } 157 | 158 | 159 | /** 160 | * 3.0 - Elements 161 | */ 162 | 163 | ul, 164 | ol { 165 | margin: 0 1.25em 1.75em 0; 166 | } 167 | 168 | ol { 169 | margin-right: 1.5em; 170 | margin-left: 0; 171 | } 172 | 173 | caption, 174 | th, 175 | td { 176 | text-align: right; 177 | } 178 | 179 | 180 | /** 181 | * 4.0 - Forms 182 | */ 183 | 184 | input[type="search"].search-field { 185 | border-radius: 0 2px 2px 0; 186 | } 187 | 188 | .search-submit:before { 189 | left: 1px; 190 | } 191 | 192 | .search-submit { 193 | border-radius: 2px 0 0 2px; 194 | left: 0; 195 | right: auto; 196 | } 197 | 198 | 199 | /** 200 | * 5.0 - Navigation 201 | */ 202 | 203 | .main-navigation ul ul { 204 | margin-right: 0.875em; 205 | margin-left: auto; 206 | } 207 | 208 | .main-navigation .menu-item-has-children > a { 209 | margin-right: auto; 210 | margin-left: 56px; 211 | } 212 | 213 | .dropdown-toggle { 214 | left: 0; 215 | right: auto; 216 | } 217 | 218 | .dropdown-toggle:after { 219 | border-right-width: 1px; 220 | border-left-width: 0; 221 | left: auto; 222 | right: 1px; 223 | } 224 | 225 | .social-navigation li { 226 | float: right; 227 | margin: 0 0 0.4375em 0.4375em; 228 | } 229 | 230 | .pagination:before { 231 | left: 0; 232 | right: auto; 233 | } 234 | 235 | .pagination:after { 236 | left: 54px; 237 | right: auto; 238 | } 239 | 240 | .pagination .nav-links { 241 | padding-right: 0; 242 | padding-left: 106px; 243 | } 244 | 245 | .pagination .nav-links:before { 246 | content: "\f430"; 247 | left: -1px; 248 | right: auto; 249 | } 250 | 251 | .pagination .nav-links:after { 252 | content: "\f429"; 253 | left: 55px; 254 | right: auto; 255 | } 256 | 257 | .pagination .page-numbers { 258 | margin: 0 -0.7368421053em 0 0.7368421053em; 259 | } 260 | 261 | .pagination .prev, 262 | .pagination .next { 263 | margin: 0; 264 | } 265 | 266 | .pagination .prev { 267 | left: 54px; 268 | right: auto; 269 | } 270 | 271 | .pagination .prev:before { 272 | content: "\f429"; 273 | left: auto; 274 | right: -1px; 275 | } 276 | 277 | .pagination .next { 278 | left: 0; 279 | right: auto; 280 | } 281 | 282 | .pagination .next:before { 283 | content: "\f430"; 284 | left: -1px; 285 | right: auto; 286 | } 287 | 288 | .comment-navigation { 289 | margin-right: 0; 290 | margin-left: 0; 291 | } 292 | 293 | 294 | /** 295 | * 6.0 - Accessibility 296 | */ 297 | 298 | .site .skip-link { 299 | left: auto; 300 | right: -9999em; 301 | } 302 | 303 | .site .skip-link:focus { 304 | left: auto; 305 | right: 6px; 306 | } 307 | 308 | 309 | /** 310 | * 7.0 - Widgets 311 | */ 312 | 313 | .tagcloud a { 314 | margin-right: 0; 315 | margin-left: 0.1875em; 316 | } 317 | 318 | 319 | /** 320 | * 8.0 - Content 321 | */ 322 | 323 | 324 | /** 325 | * 8.1 - Header 326 | */ 327 | 328 | .site-branding { 329 | margin-right: 0; 330 | margin-left: auto; 331 | } 332 | 333 | 334 | /** 335 | * 8.2 - Posts and pages 336 | */ 337 | 338 | .author-avatar .avatar { 339 | float: right; 340 | margin-right: 0; 341 | margin-left: 1.75em; 342 | } 343 | 344 | .entry-footer .avatar { 345 | margin-right: 0; 346 | margin-left: 0.5384615385em; 347 | } 348 | 349 | .page-links a, 350 | .page-links > span { 351 | margin-right: auto; 352 | margin-left: 0.3076923077em; 353 | } 354 | 355 | .page-links > .page-links-title { 356 | padding-right: 0; 357 | padding-left: 0.6153846154em; 358 | } 359 | 360 | body:not(.search-results) .entry-summary .alignright { 361 | margin: 0.2631578947em 0 1.4736842105em 1.4736842105em; 362 | } 363 | 364 | body:not(.search-results) .entry-summary .alignleft { 365 | margin: 0.2631578947em 1.4736842105em 1.4736842105em 0; 366 | } 367 | 368 | 369 | /** 370 | * 8.3 - Comments 371 | */ 372 | 373 | .comment-list .children > li { 374 | padding-right: 0.875em; 375 | padding-left: 0; 376 | } 377 | 378 | .comment-author .avatar { 379 | float: right; 380 | margin-right: auto; 381 | margin-left: 0.875em; 382 | } 383 | 384 | .bypostauthor > article .fn:after { 385 | left: auto; 386 | right: 3px; 387 | } 388 | 389 | .comment-content ul, 390 | .comment-content ol { 391 | margin: 0 1.25em 1.5em 0; 392 | } 393 | 394 | .comment-reply-title small a { 395 | float: left; 396 | } 397 | 398 | 399 | /** 400 | * 8.4 - Footer 401 | */ 402 | 403 | .site-footer .site-title:after { 404 | padding-right: 0.538461538em; 405 | padding-left: 0.307692308em; 406 | } 407 | 408 | 409 | /** 410 | * 9.0 - Multisites 411 | */ 412 | 413 | .widecolumn .mu_register label { 414 | margin-right: 0; 415 | margin-left: 0.7692307692em; 416 | } 417 | 418 | 419 | /** 420 | * 10.0 - Media Queries 421 | */ 422 | 423 | 424 | /** 425 | * 10.1 - >= 710px 426 | */ 427 | 428 | @media screen and (min-width: 44.375em) { 429 | .pagination { 430 | margin: 0 7.6923% 4.421052632em 23.0769%; 431 | } 432 | 433 | .entry-header, 434 | .post-thumbnail, 435 | .entry-content, 436 | .entry-summary, 437 | .entry-footer, 438 | .comments-area, 439 | .image-navigation, 440 | .post-navigation, 441 | .page-header, 442 | .page-content, 443 | .content-bottom-widgets { 444 | margin-right: 7.6923%; 445 | margin-left: 23.0769%; 446 | } 447 | 448 | .entry-content blockquote:not(.alignright):not(.alignleft), 449 | .entry-summary blockquote, 450 | .comment-content blockquote { 451 | margin-right: -1.473684211em; 452 | margin-left: auto; 453 | } 454 | 455 | .entry-content blockquote blockquote:not(.alignright):not(.alignleft), 456 | .entry-summary blockquote blockquote, 457 | .comment-content blockquote blockquote { 458 | margin-right: 0; 459 | margin-left: auto; 460 | } 461 | 462 | .entry-content ul, 463 | .entry-summary ul, 464 | .comment-content ul, 465 | .entry-content ol, 466 | .entry-summary ol, 467 | .comment-content ol { 468 | margin-right: 0; 469 | margin-left: auto; 470 | } 471 | 472 | .entry-content li > ul, 473 | .entry-summary li > ul, 474 | .comment-content li > ul, 475 | .entry-content blockquote > ul, 476 | .entry-summary blockquote > ul, 477 | .comment-content blockquote > ul { 478 | margin-right: 1.25em; 479 | margin-left: auto; 480 | } 481 | 482 | .entry-content li > ol, 483 | .entry-summary li > ol, 484 | .comment-content li > ol, 485 | .entry-content blockquote > ol, 486 | .entry-summary blockquote > ol, 487 | .comment-content blockquote > ol { 488 | margin-right: 1.5em; 489 | margin-left: auto; 490 | } 491 | 492 | .comment-list .children > li { 493 | padding-right: 1.75em; 494 | padding-left: 0; 495 | } 496 | 497 | .sidebar, 498 | .widecolumn { 499 | padding-right: 7.6923%; 500 | padding-left: 23.0769%; 501 | } 502 | 503 | body:not(.search-results) .entry-summary li > ul, 504 | body:not(.search-results) .entry-summary blockquote > ul { 505 | margin-right: 1.157894737em; 506 | margin-left: auto; 507 | } 508 | 509 | body:not(.search-results) .entry-summary li > ol, 510 | body:not(.search-results) .entry-summary blockquote > ol { 511 | margin-right: 1.473684211em; 512 | margin-left: auto; 513 | } 514 | } 515 | 516 | 517 | /** 518 | * 10.2 - >= 910px 519 | */ 520 | 521 | @media screen and (min-width: 56.875em) { 522 | .main-navigation .primary-menu > li { 523 | float: right; 524 | } 525 | 526 | .main-navigation ul ul { 527 | left: auto; 528 | margin: 0; 529 | right: -999em; 530 | } 531 | 532 | .main-navigation ul ul:before { 533 | left: 9px; 534 | right: auto; 535 | } 536 | 537 | .main-navigation ul ul:after { 538 | left: 11px; 539 | right: auto; 540 | } 541 | 542 | .main-navigation li:hover > ul, 543 | .main-navigation li.focus > ul { 544 | left: 0; 545 | right: auto; 546 | } 547 | 548 | .main-navigation ul ul li:hover > ul, 549 | .main-navigation ul ul li.focus > ul { 550 | left: 100%; 551 | right: auto; 552 | } 553 | 554 | .main-navigation .menu-item-has-children > a { 555 | margin: 0; 556 | padding-right: 0.875em; 557 | padding-left: 2.25em; 558 | } 559 | 560 | .main-navigation .menu-item-has-children > a:after { 561 | left: 0.625em; 562 | right: auto; 563 | } 564 | 565 | .main-navigation ul ul .menu-item-has-children > a { 566 | padding-right: 0.875em; 567 | padding-left: 2.0625em; 568 | } 569 | 570 | .main-navigation ul ul .menu-item-has-children > a:after { 571 | left: 0.5625em; 572 | right: auto; 573 | top: 0.8125em; 574 | -webkit-transform: rotate(-90deg); 575 | -moz-transform: rotate(-90deg); 576 | -ms-transform: rotate(-90deg); 577 | transform: rotate(-90deg); 578 | } 579 | 580 | .content-area { 581 | float: right; 582 | margin-right: auto; 583 | margin-left: -100%; 584 | } 585 | 586 | .entry-header, 587 | .post-thumbnail, 588 | .entry-content, 589 | .entry-summary, 590 | .entry-footer, 591 | .comments-area, 592 | .image-navigation, 593 | .post-navigation, 594 | .pagination, 595 | .page-header, 596 | .page-content, 597 | .content-bottom-widgets { 598 | margin-right: 0; 599 | margin-left: 0; 600 | } 601 | 602 | .sidebar { 603 | float: right; 604 | margin-right: 75%; 605 | margin-left: auto; 606 | padding: 0; 607 | } 608 | 609 | .widget blockquote { 610 | padding-right: 1.0625em; 611 | padding-left: 0; 612 | } 613 | 614 | .widget .alignright { 615 | margin: 0.2307692308em 0 1.6153846154em 1.6153846154em; 616 | } 617 | 618 | .widget .alignleft { 619 | margin: 0.2307692308em 1.6153846154em 1.6153846154em 0; 620 | } 621 | 622 | .tagcloud a { 623 | margin: 0 0 0.5384615385em 0.2307692308em; 624 | } 625 | 626 | .content-bottom-widgets .widget-area:nth-child(1):nth-last-child(2), 627 | .content-bottom-widgets .widget-area:nth-child(2):nth-last-child(1) { 628 | float: right; 629 | margin-right: auto; 630 | margin-left: 7.1428571%; 631 | } 632 | 633 | .content-bottom-widgets .widget-area:nth-child(2):nth-last-child(1):last-of-type { 634 | margin-right: auto; 635 | margin-left: 0; 636 | } 637 | 638 | .site-info { 639 | margin: 0.538461538em 0 0.538461538em auto; 640 | } 641 | 642 | .no-sidebar .entry-header, 643 | .no-sidebar .entry-content, 644 | .no-sidebar .entry-summary, 645 | .no-sidebar .entry-footer, 646 | .no-sidebar .comments-area, 647 | .no-sidebar .image-navigation, 648 | .no-sidebar .post-navigation, 649 | .no-sidebar .pagination, 650 | .no-sidebar .page-header, 651 | .no-sidebar .page-content, 652 | .no-sidebar .content-bottom-widgets { 653 | margin-right: 15%; 654 | margin-left: 15%; 655 | } 656 | 657 | .no-sidebar .post-thumbnail { 658 | margin-right: 0; 659 | margin-left: 0; 660 | } 661 | 662 | .widecolumn { 663 | padding-right: 15%; 664 | padding-left: 15%; 665 | } 666 | } 667 | 668 | 669 | /** 670 | * 10.3 - >= 985px 671 | */ 672 | 673 | @media screen and (min-width: 61.5625em) { 674 | body:not(.search-results) article:not(.type-page) .entry-content { 675 | float: left; 676 | } 677 | 678 | body:not(.search-results) article:not(.type-page) .entry-content > blockquote.alignleft.below-entry-meta { 679 | margin-right: 1.473684211em; 680 | margin-left: 0; 681 | width: -webkit-calc(50% - 0.736842105em); 682 | width: calc(50% - 0.736842105em);; 683 | } 684 | 685 | body:not(.search-results) article:not(.type-page) .entry-content > blockquote.alignright.below-entry-meta { 686 | margin-right: -40%; 687 | margin-left: 1.473684211em; 688 | width: -webkit-calc(60% - 1.4736842105em); 689 | width: calc(60% - 1.4736842105em); 690 | } 691 | 692 | body:not(.search-results) article:not(.type-page) img.below-entry-meta, 693 | body:not(.search-results) article:not(.type-page) figure.below-entry-meta { 694 | margin-right: -40%; 695 | margin-left: 0; 696 | } 697 | 698 | body:not(.search-results) article:not(.type-page) .entry-footer { 699 | float: right; 700 | } 701 | 702 | body.no-sidebar:not(.search-results) article:not(.type-page) .entry-content { 703 | float: right; 704 | margin-right: 34.99999999%; 705 | margin-left: -100%; 706 | } 707 | 708 | body.no-sidebar:not(.search-results) article:not(.type-page) .entry-footer { 709 | margin-right: 15%; 710 | margin-left: -100%; 711 | } 712 | } 713 | 714 | 715 | /** 716 | * 10.4 - >= 1200px 717 | */ 718 | 719 | @media screen and (min-width: 75em) { 720 | body:not(.search-results) .entry-summary li > ul, 721 | body:not(.search-results) .entry-summary blockquote > ul { 722 | margin-right: 0.956521739em; 723 | margin-left: auto; 724 | } 725 | 726 | body:not(.search-results) .entry-summary li > ol, 727 | body:not(.search-results) .entry-summary blockquote > ol { 728 | margin-right: 1.52173913em; 729 | margin-left: auto; 730 | } 731 | 732 | body:not(.search-results) .entry-summary blockquote { 733 | padding-right: 1.347826087em; 734 | padding-left: 0; 735 | } 736 | 737 | body:not(.search-results) .entry-summary blockquote:not(.alignright):not(.alignleft) { 738 | margin-right: -1.52173913em; 739 | margin-left: auto; 740 | } 741 | 742 | body:not(.search-results) .entry-summary blockquote blockquote:not(.alignright):not(.alignleft) { 743 | margin-right: 0; 744 | margin-left: auto; 745 | } 746 | 747 | body:not(.search-results) .entry-summary .alignright { 748 | margin: 0.2608695652em 0 1.5217391304em 1.5217391304em; 749 | } 750 | 751 | body:not(.search-results) .entry-summary .alignleft { 752 | margin: 0.2608695652em 1.5217391304em 1.5217391304em 0; 753 | } 754 | } 755 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soderlind/plugin-customizer/04f62e7cb9bd22ac0f1bdf010f93f1f873d0802e/src/assets/twentysixteen/screenshot.png -------------------------------------------------------------------------------- /src/assets/twentysixteen/search.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 | 15 | 16 | 17 | 20 | 21 | __( 'Previous page', 'twentysixteen' ), 38 | 'next_text' => __( 'Next page', 'twentysixteen' ), 39 | 'before_page_number' => '' . __( 'Page', 'twentysixteen' ) . ' ', 40 | ) ); 41 | 42 | // If no content, include the "No posts found" template. 43 | else : 44 | get_template_part( 'template-parts/content', 'none' ); 45 | 46 | endif; 47 | ?> 48 | 49 |
50 |
51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/searchform.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 18 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/sidebar-content-bottom.php: -------------------------------------------------------------------------------- 1 | 16 | 29 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/sidebar.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/single.php: -------------------------------------------------------------------------------- 1 | 11 | 12 |
13 |
14 | _x( 'Published in%title', 'Parent post link', 'twentysixteen' ), 30 | ) ); 31 | } elseif ( is_singular( 'post' ) ) { 32 | // Previous/next post navigation. 33 | the_post_navigation( array( 34 | 'next_text' => ' ' . 35 | '' . __( 'Next post:', 'twentysixteen' ) . ' ' . 36 | '%title', 37 | 'prev_text' => ' ' . 38 | '' . __( 'Previous post:', 'twentysixteen' ) . ' ' . 39 | '%title', 40 | ) ); 41 | } 42 | 43 | // End of the loop. 44 | endwhile; 45 | ?> 46 | 47 |
48 | 49 | 50 | 51 |
52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/template-parts/biography.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 25 |
26 | 27 |
28 |

29 | 30 |

31 | 32 | 35 |

36 |
37 |
38 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/template-parts/content-none.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 15 | 16 |
17 | 18 | 19 |

Get started here.', 'twentysixteen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

20 | 21 | 22 | 23 |

24 | 25 | 26 | 27 | 28 |

29 | 30 | 31 | 32 |
33 |
34 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/template-parts/content-page.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
> 12 |
13 | ', '' ); ?> 14 |
15 | 16 | 17 | 18 |
19 | '', 25 | 'link_before' => '', 26 | 'link_after' => '', 27 | 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', 28 | 'separator' => ', ', 29 | ) ); 30 | ?> 31 |
32 | 33 | "%s"', 'twentysixteen' ), 38 | get_the_title() 39 | ), 40 | '
', 41 | '
' 42 | ); 43 | ?> 44 | 45 |
46 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/template-parts/content-search.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
> 12 |
13 | ', esc_url( get_permalink() ) ), '' ); ?> 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | "%s"', 'twentysixteen' ), 29 | get_the_title() 30 | ), 31 | '', 32 | '' 33 | ); 34 | ?> 35 |
36 | 37 | 38 | 39 | "%s"', 'twentysixteen' ), 44 | get_the_title() 45 | ), 46 | '
', 47 | '
' 48 | ); 49 | ?> 50 | 51 | 52 |
53 | 54 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/template-parts/content-single.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
> 12 |
13 | ', '' ); ?> 14 |
15 | 16 | 17 | 18 | 19 | 20 |
21 | '', 27 | 'link_before' => '', 28 | 'link_after' => '', 29 | 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', 30 | 'separator' => ', ', 31 | ) ); 32 | 33 | if ( '' !== get_the_author_meta( 'description' ) ) { 34 | get_template_part( 'template-parts/biography' ); 35 | } 36 | ?> 37 |
38 | 39 |
40 | 41 | "%s"', 'twentysixteen' ), 46 | get_the_title() 47 | ), 48 | '', 49 | '' 50 | ); 51 | ?> 52 |
53 |
54 | -------------------------------------------------------------------------------- /src/assets/twentysixteen/template-parts/content.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
> 12 |
13 | 14 | 15 | 16 | 17 | ', esc_url( get_permalink() ) ), '' ); ?> 18 |
19 | 20 | 21 | 22 | 23 | 24 |
25 | "%s"', 'twentysixteen' ), 29 | get_the_title() 30 | ) ); 31 | 32 | wp_link_pages( array( 33 | 'before' => '', 35 | 'link_before' => '', 36 | 'link_after' => '', 37 | 'pagelink' => '' . __( 'Page', 'twentysixteen' ) . ' %', 38 | 'separator' => ', ', 39 | ) ); 40 | ?> 41 |
42 | 43 |
44 | 45 | "%s"', 'twentysixteen' ), 50 | get_the_title() 51 | ), 52 | '', 53 | '' 54 | ); 55 | ?> 56 |
57 |
58 | -------------------------------------------------------------------------------- /templates/content.php: -------------------------------------------------------------------------------- 1 | 2 | 18 |
19 |
20 | 21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /templates/newsletter.php: -------------------------------------------------------------------------------- 1 | 2 | 18 |
19 |

20 |
21 | 22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /templates/title.php: -------------------------------------------------------------------------------- 1 | 2 | 18 |
19 |

20 |
21 | 22 | --------------------------------------------------------------------------------