Version Description
Improvements for multisite and new single-use snippet scope
Download this release
Release Info
Developer | bungeshea |
Plugin | Code Snippets |
Version | 2.10.0 |
Comparing to | |
See all releases |
Code changes from version 2.9.6 to 2.10.0
- code-snippets.php +3 -3
- css/min/edit.css +1 -1
- css/min/manage.css +1 -1
- languages/code-snippets-pt_BR.mo +0 -0
- languages/code-snippets-pt_BR.po +931 -0
- languages/code-snippets.pot +166 -118
- php/admin-menus/class-edit-menu.php +34 -17
- php/admin-menus/class-import-menu.php +27 -16
- php/admin-menus/class-manage-menu.php +1 -0
- php/admin-menus/class-settings-menu.php +38 -3
- php/class-admin.php +2 -1
- php/class-db.php +9 -9
- php/class-export.php +61 -11
- php/class-list-table.php +38 -17
- php/class-snippet.php +60 -30
- php/settings/settings-fields.php +3 -3
- php/settings/settings.php +31 -3
- php/snippet-ops.php +105 -15
- php/upgrade.php +14 -0
- php/views/edit.php +14 -3
- php/views/import.php +38 -7
- readme.txt +17 -2
code-snippets.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* @author Shea Bunge <shea@bungeshea.com>
|
11 |
* @copyright 2012-2018 Shea Bunge
|
12 |
* @license MIT http://opensource.org/licenses/MIT
|
13 |
-
* @version 2.
|
14 |
* @link https://github.com/sheabunge/code-snippets
|
15 |
*/
|
16 |
|
@@ -20,7 +20,7 @@ Plugin URI: https://github.com/sheabunge/code-snippets
|
|
20 |
Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
|
21 |
Author: Shea Bunge
|
22 |
Author URI: https://bungeshea.com
|
23 |
-
Version: 2.
|
24 |
License: MIT
|
25 |
License URI: license.txt
|
26 |
Text Domain: code-snippets
|
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
42 |
* @since 2.0
|
43 |
* @var string A PHP-standardized version number string
|
44 |
*/
|
45 |
-
define( 'CODE_SNIPPETS_VERSION', '2.
|
46 |
|
47 |
/**
|
48 |
* The full path to the main file of this plugin
|
10 |
* @author Shea Bunge <shea@bungeshea.com>
|
11 |
* @copyright 2012-2018 Shea Bunge
|
12 |
* @license MIT http://opensource.org/licenses/MIT
|
13 |
+
* @version 2.10.0
|
14 |
* @link https://github.com/sheabunge/code-snippets
|
15 |
*/
|
16 |
|
20 |
Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
|
21 |
Author: Shea Bunge
|
22 |
Author URI: https://bungeshea.com
|
23 |
+
Version: 2.10.0
|
24 |
License: MIT
|
25 |
License URI: license.txt
|
26 |
Text Domain: code-snippets
|
42 |
* @since 2.0
|
43 |
* @var string A PHP-standardized version number string
|
44 |
*/
|
45 |
+
define( 'CODE_SNIPPETS_VERSION', '2.10.0' );
|
46 |
|
47 |
/**
|
48 |
* The full path to the main file of this plugin
|
css/min/edit.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.form-table th{width:auto}h2{margin:25px 0 15px}h2:first-of-type{margin-top:20px}label{cursor:auto}label[for=snippet_description] h3 div{position:absolute}ul.tagit{background-color:#fff!important}.submit .button{margin-right:.5em}.snippet-scope{margin-top:15px}.snippet-scope label{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto!important;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-code{outline:0;direction:ltr;text-align:left}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}
|
1 |
+
.form-table th{width:auto}h2{margin:25px 0 15px}h2:first-of-type{margin-top:20px}h2 label{cursor:auto}label[for=snippet_description] h3 div{position:absolute}ul.tagit{background-color:#fff!important}.submit .button{margin-right:.5em}.snippet-scope{margin-top:15px}.snippet-scope label{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto!important;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-code{outline:0;direction:ltr;text-align:left}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}
|
css/min/manage.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.
|
1 |
+
.column-name .dashicons{font-size:16px;width:16px;height:16px}.column-name .dashicons-clock{vertical-align:middle}.snippets .badge{margin-left:4px;padding:3px 6px;text-decoration:none;border:medium;border-radius:2px;background:#e0e0e0;font-size:smaller}.clear-filters{vertical-align:bottom}.snippets td,.snippets th{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets .inactive th.check-column,.snippets tfoot th.check-column,.snippets thead th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .active td,.snippets .active th,.snippets .inactive td,.snippets .inactive th{padding:10px 9px;border:0;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive td,.snippets tr.active+tr.inactive th{border-top:1px solid rgba(0,0,0,.03);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1;box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover,.snippets a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
|
languages/code-snippets-pt_BR.mo
ADDED
Binary file
|
languages/code-snippets-pt_BR.po
ADDED
@@ -0,0 +1,931 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: code-snippets 2.8.6\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2017-05-18 21:00+1000\n"
|
6 |
+
"PO-Revision-Date: 2017-06-26 22:23-03:00\n"
|
7 |
+
"Last-Translator: Bruno borges <bruno@iborges.com>\n"
|
8 |
+
"Language: pt_BR \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
13 |
+
|
14 |
+
#: php/admin-menus/class-admin-menu.php:103
|
15 |
+
msgid "You are not authorized to access this page."
|
16 |
+
msgstr "Você não está autorizado a acessar essa página"
|
17 |
+
|
18 |
+
#: php/admin-menus/class-edit-menu.php:13
|
19 |
+
#: php/admin-menus/class-edit-menu.php:14 php/views/edit.php:25
|
20 |
+
msgid "Edit Snippet"
|
21 |
+
msgstr "Editar trecho"
|
22 |
+
|
23 |
+
#: php/admin-menus/class-edit-menu.php:39
|
24 |
+
msgctxt "menu label"
|
25 |
+
msgid "Add New"
|
26 |
+
msgstr "Adicionar novo"
|
27 |
+
|
28 |
+
#: php/admin-menus/class-edit-menu.php:40 php/views/edit.php:31
|
29 |
+
msgid "Add New Snippet"
|
30 |
+
msgstr "Adicionar novo Snippet"
|
31 |
+
|
32 |
+
#: php/admin-menus/class-edit-menu.php:156
|
33 |
+
msgid "Don't Panic"
|
34 |
+
msgstr "Sem pânico"
|
35 |
+
|
36 |
+
#: php/admin-menus/class-edit-menu.php:157
|
37 |
+
#, php-format
|
38 |
+
msgid ""
|
39 |
+
"The code snippet you are trying to save produced a fatal error on line %d:"
|
40 |
+
msgstr ""
|
41 |
+
"O trecho de código que você está tentando salvar produziu um erro fatal na linha %d:"
|
42 |
+
|
43 |
+
#: php/admin-menus/class-edit-menu.php:159
|
44 |
+
msgid ""
|
45 |
+
"The previous version of the snippet is unchanged, and the rest of this site "
|
46 |
+
"should be functioning normally as before."
|
47 |
+
msgstr ""
|
48 |
+
"A versão anterior do código não foi alterado, e o resto deste site "
|
49 |
+
"deve estar funcionando normalmente como antes."
|
50 |
+
|
51 |
+
#: php/admin-menus/class-edit-menu.php:160
|
52 |
+
msgid ""
|
53 |
+
"Please use the back button in your browser to return to the previous page "
|
54 |
+
"and try to fix the code error."
|
55 |
+
msgstr ""
|
56 |
+
"Por favor use o botão voltar no seu navegador para retornar a página anterior "
|
57 |
+
"e tente corrigir o erro do código"
|
58 |
+
|
59 |
+
#: php/admin-menus/class-edit-menu.php:161
|
60 |
+
msgid ""
|
61 |
+
"If you prefer, you can close this page and discard the changes you just "
|
62 |
+
"made. No changes will be made to this site."
|
63 |
+
msgstr ""
|
64 |
+
"Se você preferir, você pode fechar esta página e descartar as alterações feitas. "
|
65 |
+
"Nenhuma mudança será feita neste site"
|
66 |
+
|
67 |
+
#: php/admin-menus/class-edit-menu.php:281 php/class-list-table.php:341
|
68 |
+
msgid "Description"
|
69 |
+
msgstr "Descrição"
|
70 |
+
|
71 |
+
#: php/admin-menus/class-edit-menu.php:312 php/class-list-table.php:342
|
72 |
+
msgid "Tags"
|
73 |
+
msgstr "Tags"
|
74 |
+
|
75 |
+
#: php/admin-menus/class-edit-menu.php:316
|
76 |
+
msgid "Enter a list of tags; separated by commas"
|
77 |
+
msgstr "Entre com a lista de tags; separadas por vírgulas"
|
78 |
+
|
79 |
+
#: php/admin-menus/class-edit-menu.php:336
|
80 |
+
msgid "Run snippet everywhere"
|
81 |
+
msgstr "Execute snippet em toda a parte"
|
82 |
+
|
83 |
+
#: php/admin-menus/class-edit-menu.php:337
|
84 |
+
msgid "Only run in administration area"
|
85 |
+
msgstr "Somente execute na área de administração "
|
86 |
+
|
87 |
+
#: php/admin-menus/class-edit-menu.php:338
|
88 |
+
msgid "Only run on site front-end"
|
89 |
+
msgstr "Somente execute no front-end do site"
|
90 |
+
|
91 |
+
#: php/admin-menus/class-edit-menu.php:342
|
92 |
+
msgid "Scope"
|
93 |
+
msgstr "Escopo"
|
94 |
+
|
95 |
+
#: php/admin-menus/class-edit-menu.php:362
|
96 |
+
msgid "Sharing"
|
97 |
+
msgstr "Compartilhando"
|
98 |
+
|
99 |
+
#: php/admin-menus/class-edit-menu.php:366
|
100 |
+
msgid "Allow this snippet to be activated on individual sites on the network"
|
101 |
+
msgstr "Permita este código ser ativado em sites individuais na rede"
|
102 |
+
|
103 |
+
#: php/admin-menus/class-edit-menu.php:426
|
104 |
+
#, php-format
|
105 |
+
msgid "The snippet has been deactivated due to an error on line %d:"
|
106 |
+
msgstr "O código foi desativado devido a um erro na linha %d"
|
107 |
+
|
108 |
+
#: php/admin-menus/class-edit-menu.php:431
|
109 |
+
msgid "The snippet has been deactivated due to an error in the code."
|
110 |
+
msgstr "O código foi desativado devido a um erro no código"
|
111 |
+
|
112 |
+
#: php/admin-menus/class-edit-menu.php:438
|
113 |
+
msgid "An error occurred when saving the snippet."
|
114 |
+
msgstr "Um erro ocorreu enquanto salvava o código"
|
115 |
+
|
116 |
+
#: php/admin-menus/class-edit-menu.php:443
|
117 |
+
msgid "Snippet <strong>added</strong>."
|
118 |
+
msgstr "Snippet <strong>adicionado</strong>"
|
119 |
+
|
120 |
+
#: php/admin-menus/class-edit-menu.php:444
|
121 |
+
msgid "Snippet <strong>updated</strong>."
|
122 |
+
msgstr "Snippet <strong>atualizado</strong>."
|
123 |
+
|
124 |
+
#: php/admin-menus/class-edit-menu.php:445
|
125 |
+
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
126 |
+
msgstr "Snippet <strong>adicionado</strong> e <strong>ativado</strong>."
|
127 |
+
|
128 |
+
#: php/admin-menus/class-edit-menu.php:446
|
129 |
+
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
130 |
+
msgstr "Snippet <strong>atualizado</strong> e <strong>ativado</strong>."
|
131 |
+
|
132 |
+
#: php/admin-menus/class-edit-menu.php:447
|
133 |
+
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
134 |
+
msgstr "Snippet <strong>atualizado</strong> e <strong>desativado</strong>."
|
135 |
+
|
136 |
+
#: php/admin-menus/class-import-menu.php:15
|
137 |
+
msgctxt "menu label"
|
138 |
+
msgid "Import"
|
139 |
+
msgstr "Importe"
|
140 |
+
|
141 |
+
#: php/admin-menus/class-import-menu.php:16 php/views/import.php:17
|
142 |
+
msgid "Import Snippets"
|
143 |
+
msgstr "Impote Snippets"
|
144 |
+
|
145 |
+
#: php/admin-menus/class-import-menu.php:84
|
146 |
+
msgid "Code Snippets"
|
147 |
+
msgstr "Code Snippets"
|
148 |
+
|
149 |
+
#: php/admin-menus/class-import-menu.php:85
|
150 |
+
msgid "Import snippets from a code snippets export file"
|
151 |
+
msgstr "Importar snipptes de um arquivo exportado com trechos de código"
|
152 |
+
|
153 |
+
#: php/admin-menus/class-import-menu.php:99
|
154 |
+
#, php-format
|
155 |
+
msgid ""
|
156 |
+
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
157 |
+
"a>"
|
158 |
+
msgid_plural ""
|
159 |
+
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun!"
|
160 |
+
"</a>"
|
161 |
+
msgstr[0] ""
|
162 |
+
"Importado com sucesso <strong>%d</strong> snippet. <a href=\"%s\">Divirta-se!</"
|
163 |
+
"a>"
|
164 |
+
msgstr[1] ""
|
165 |
+
""
|
166 |
+
"Importado com sucesso<strong>%d</strong> snippets. <a href=\"%s\">Divirta-se!"
|
167 |
+
"</a>"
|
168 |
+
|
169 |
+
#: php/admin-menus/class-import-menu.php:112
|
170 |
+
msgid "An error occurred when processing the import file."
|
171 |
+
msgstr "Um erro ocorreu enquanto processava o arquivo importado"
|
172 |
+
|
173 |
+
#: php/admin-menus/class-manage-menu.php:22
|
174 |
+
msgctxt "menu label"
|
175 |
+
msgid "All Snippets"
|
176 |
+
msgstr "Todos os Snippets"
|
177 |
+
|
178 |
+
#: php/admin-menus/class-manage-menu.php:23
|
179 |
+
#: php/admin-menus/class-manage-menu.php:45 php/class-admin.php:61
|
180 |
+
#: php/class-admin.php:144 php/views/manage.php:19
|
181 |
+
msgid "Snippets"
|
182 |
+
msgstr "Snippets"
|
183 |
+
|
184 |
+
#: php/admin-menus/class-manage-menu.php:46
|
185 |
+
msgctxt "top-level menu label"
|
186 |
+
msgid "Snippets"
|
187 |
+
msgstr "Snippets"
|
188 |
+
|
189 |
+
#: php/admin-menus/class-manage-menu.php:81
|
190 |
+
msgid ""
|
191 |
+
"<strong>Warning:</strong> Safe mode is active and snippets will not execute! "
|
192 |
+
"Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-"
|
193 |
+
"config.php</code> to turn off safe mode. <a href=\"https://github.com/"
|
194 |
+
"sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank\">Help</a>"
|
195 |
+
msgstr ""
|
196 |
+
"<strong>Aviso:</strong> Modo seguro ativado e os snippets não serão executados! "
|
197 |
+
"Remova o <code>CODE_SNIPPETS_SAFE_MODE</code> constante do <code>wp-"
|
198 |
+
"config.php</code> para desligar o modo seguro. <a href=\"https://github.com/"
|
199 |
+
"sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank\">Ajuda</a>"
|
200 |
+
|
201 |
+
#: php/admin-menus/class-manage-menu.php:87
|
202 |
+
msgid "Snippet <strong>activated</strong>."
|
203 |
+
msgstr "Snippet <strong>ativado</strong>."
|
204 |
+
|
205 |
+
#: php/admin-menus/class-manage-menu.php:88
|
206 |
+
msgid "Selected snippets <strong>activated</strong>."
|
207 |
+
msgstr "Selecione snippets <strong>ativados</strong>."
|
208 |
+
|
209 |
+
#: php/admin-menus/class-manage-menu.php:89
|
210 |
+
msgid "Snippet <strong>deactivated</strong>."
|
211 |
+
msgstr "Snippet <strong>desativados</strong>."
|
212 |
+
|
213 |
+
#: php/admin-menus/class-manage-menu.php:90
|
214 |
+
msgid "Selected snippets <strong>deactivated</strong>."
|
215 |
+
msgstr "Selecione snippets <strong>desativados</strong>."
|
216 |
+
|
217 |
+
#: php/admin-menus/class-manage-menu.php:91
|
218 |
+
msgid "Snippet <strong>deleted</strong>."
|
219 |
+
msgstr "Snippet <strong>removidos</strong>."
|
220 |
+
|
221 |
+
#: php/admin-menus/class-manage-menu.php:92
|
222 |
+
msgid "Selected snippets <strong>deleted</strong>."
|
223 |
+
msgstr "Selecione snippets <strong>removidos</strong>."
|
224 |
+
|
225 |
+
#: php/admin-menus/class-settings-menu.php:16
|
226 |
+
msgctxt "menu label"
|
227 |
+
msgid "Settings"
|
228 |
+
msgstr "Configurações"
|
229 |
+
|
230 |
+
#: php/admin-menus/class-settings-menu.php:17
|
231 |
+
msgid "Snippets Settings"
|
232 |
+
msgstr "Configurações dos Snippets"
|
233 |
+
|
234 |
+
#: php/admin-menus/class-settings-menu.php:39 php/views/edit.php:135
|
235 |
+
msgid "Settings"
|
236 |
+
msgstr "Configurações"
|
237 |
+
|
238 |
+
#: php/class-admin.php:143
|
239 |
+
msgid "Manage your existing snippets"
|
240 |
+
msgstr "Gerencie seus snippets existentes"
|
241 |
+
|
242 |
+
#: php/class-admin.php:174
|
243 |
+
msgid "Visit the WordPress.org plugin page"
|
244 |
+
msgstr "Visite a página do plugin no WordPress.org"
|
245 |
+
|
246 |
+
#: php/class-admin.php:175
|
247 |
+
msgid "About"
|
248 |
+
msgstr "Sobre"
|
249 |
+
|
250 |
+
#: php/class-admin.php:179
|
251 |
+
msgid "Visit the support forums"
|
252 |
+
msgstr "Visite o forum para suporte"
|
253 |
+
|
254 |
+
#: php/class-admin.php:180
|
255 |
+
msgid "Support"
|
256 |
+
msgstr "Suporte"
|
257 |
+
|
258 |
+
#: php/class-admin.php:184
|
259 |
+
msgid "Support this plugin's development"
|
260 |
+
msgstr "Ajude o desenvolvimento deste plugin"
|
261 |
+
|
262 |
+
#: php/class-admin.php:185
|
263 |
+
msgid "Donate"
|
264 |
+
msgstr "Doação"
|
265 |
+
|
266 |
+
#: php/class-admin.php:216
|
267 |
+
msgid ""
|
268 |
+
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
269 |
+
"answer a short survey on how you use this plugin and what you'd like to see "
|
270 |
+
"changed or added in the future."
|
271 |
+
msgstr ""
|
272 |
+
"<strong>Quer receber feedback do Code Snippets?</strong> Por favor leve um tempo "
|
273 |
+
"para responder esta curta enquete de como usar este plugin e o que você gostaria de ver "
|
274 |
+
"alterar ou adicionar no futuro."
|
275 |
+
|
276 |
+
#: php/class-admin.php:220
|
277 |
+
msgid "Take the survey now"
|
278 |
+
msgstr "Responda a pesquisa agora"
|
279 |
+
|
280 |
+
#: php/class-admin.php:223
|
281 |
+
msgid "Dismiss"
|
282 |
+
msgstr "Dispensar"
|
283 |
+
|
284 |
+
#: php/class-contextual-help.php:40
|
285 |
+
msgid "For more information:"
|
286 |
+
msgstr "Para mais informações"
|
287 |
+
|
288 |
+
#: php/class-contextual-help.php:41
|
289 |
+
msgid "About Plugin"
|
290 |
+
msgstr "Sobre o Plugin"
|
291 |
+
|
292 |
+
#: php/class-contextual-help.php:42
|
293 |
+
msgid "FAQ"
|
294 |
+
msgstr "FAQ"
|
295 |
+
|
296 |
+
#: php/class-contextual-help.php:43
|
297 |
+
msgid "Support Forums"
|
298 |
+
msgstr "Fórums de ajuda"
|
299 |
+
|
300 |
+
#: php/class-contextual-help.php:44
|
301 |
+
msgid "Plugin Website"
|
302 |
+
msgstr "Site do plugin"
|
303 |
+
|
304 |
+
#: php/class-contextual-help.php:55 php/class-contextual-help.php:81
|
305 |
+
#: php/class-contextual-help.php:121
|
306 |
+
msgid "Overview"
|
307 |
+
msgstr "Resumo"
|
308 |
+
|
309 |
+
#: php/class-contextual-help.php:56
|
310 |
+
msgid ""
|
311 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
312 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
313 |
+
"of code, and do not put as much load on your server. Here you can manage "
|
314 |
+
"your existing snippets and perform tasks on them such as activating, "
|
315 |
+
"deactivating, deleting and exporting."
|
316 |
+
msgstr ""
|
317 |
+
"Snippets são parecidos com plugins - ambos extendem e expandem as "
|
318 |
+
"funcionalidades do WordPress. Snippets são mais leves, com poucas linhas "
|
319 |
+
"de código, e não colocam muita carga no seu servidor. Aqui você pode gerenciar "
|
320 |
+
"seus snippets existentes e fazer tarefas como ativar, "
|
321 |
+
"desativar, remover e exportar."
|
322 |
+
|
323 |
+
#: php/class-contextual-help.php:61
|
324 |
+
msgid "Safe Mode"
|
325 |
+
msgstr "Modo seguro"
|
326 |
+
|
327 |
+
#: php/class-contextual-help.php:62
|
328 |
+
msgid ""
|
329 |
+
"Be sure to check your snippets for errors before you activate them, as a "
|
330 |
+
"faulty snippet could bring your whole blog down. If your site starts doing "
|
331 |
+
"strange things, deactivate all your snippets and activate them one at a time."
|
332 |
+
msgstr ""
|
333 |
+
|
334 |
+
#: php/class-contextual-help.php:63
|
335 |
+
msgid ""
|
336 |
+
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
337 |
+
"cause all snippets to stop executing by adding "
|
338 |
+
"<code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-"
|
339 |
+
"config.php</code> file. After you have deactivated the offending snippet, "
|
340 |
+
"you can turn off safe mode by removing this line or replacing <strong>true</"
|
341 |
+
"strong> with <strong>false</strong>."
|
342 |
+
msgstr ""
|
343 |
+
|
344 |
+
#: php/class-contextual-help.php:68
|
345 |
+
msgid "Uninstall"
|
346 |
+
msgstr "Desinstalar"
|
347 |
+
|
348 |
+
#: php/class-contextual-help.php:69
|
349 |
+
#, php-format
|
350 |
+
msgid ""
|
351 |
+
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
352 |
+
"clear up the <code>%1$s</code> table and a few other bits of data stored in "
|
353 |
+
"the database. If you want to keep this data (ie: you are only temporally "
|
354 |
+
"uninstalling Code Snippets) then remove the <code>%2$s</code> folder using "
|
355 |
+
"FTP."
|
356 |
+
msgstr ""
|
357 |
+
"Quando remover o Code Snippets através do menu de plugins do WordPress isto irá "
|
358 |
+
"limpar a tabela <code>%1$s</code> e alguns outros outros bits de dados armazenados no "
|
359 |
+
"banco de dados. Se você quer manter esses dados(ex: você está apenas temporariamente "
|
360 |
+
"desintalando o Code Snippets) então remova a pasta <code>%2$s</code> usando "
|
361 |
+
"FTP."
|
362 |
+
|
363 |
+
#: php/class-contextual-help.php:70
|
364 |
+
msgid ""
|
365 |
+
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
366 |
+
"this WordPress installation, you may want to use the export feature to back "
|
367 |
+
"up your snippets."
|
368 |
+
msgstr ""
|
369 |
+
"Mesmo que você esteja certo que não quer usar o Code Snippets novamente "
|
370 |
+
"nesta instalação do WordPress, você pode querer usar o recurso de exportar o backup "
|
371 |
+
"dos seus snippets."
|
372 |
+
|
373 |
+
#: php/class-contextual-help.php:82
|
374 |
+
msgid ""
|
375 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
376 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
377 |
+
"of code, and do not put as much load on your server. Here you can add a new "
|
378 |
+
"snippet, or edit an existing one."
|
379 |
+
msgstr ""
|
380 |
+
"Snippets são parecidos com plugins - ambos extendem e expandem as "
|
381 |
+
"funcionalidades do WordPress. Snippets são mais levest, com poucas linhas "
|
382 |
+
"de código, e não colocam muita carga no seu servidor. Aqui você pode adicionar um novo "
|
383 |
+
"snippet, ou editar um existente."
|
384 |
+
|
385 |
+
#: php/class-contextual-help.php:86
|
386 |
+
msgid "WP-Snippets"
|
387 |
+
msgstr "WP-Snippets"
|
388 |
+
|
389 |
+
#: php/class-contextual-help.php:86
|
390 |
+
msgid "http://wp-snippets.com"
|
391 |
+
msgstr "http://wp-snippets.com"
|
392 |
+
|
393 |
+
#: php/class-contextual-help.php:87
|
394 |
+
msgid "WP Snipp"
|
395 |
+
msgstr "WP Snipp"
|
396 |
+
|
397 |
+
#: php/class-contextual-help.php:87
|
398 |
+
msgid "http://wpsnipp.com"
|
399 |
+
msgstr "http://wpsnipp.com"
|
400 |
+
|
401 |
+
#: php/class-contextual-help.php:88
|
402 |
+
msgid "Cats Who Code"
|
403 |
+
msgstr "Cats Who Code"
|
404 |
+
|
405 |
+
#: php/class-contextual-help.php:88
|
406 |
+
msgid "http://www.catswhocode.com/blog/snippets"
|
407 |
+
msgstr "http://www.catswhocode.com/blog/snippets"
|
408 |
+
|
409 |
+
#: php/class-contextual-help.php:89
|
410 |
+
msgid "WP Function Me"
|
411 |
+
msgstr "WP Function Me"
|
412 |
+
|
413 |
+
#: php/class-contextual-help.php:89
|
414 |
+
msgid "http://www.wpfunction.me"
|
415 |
+
msgstr "http://www.wpfunction.me"
|
416 |
+
|
417 |
+
#: php/class-contextual-help.php:99
|
418 |
+
msgid "Finding Snippets"
|
419 |
+
msgstr "Encontrando Snippets"
|
420 |
+
|
421 |
+
#: php/class-contextual-help.php:100
|
422 |
+
msgid ""
|
423 |
+
"Here are some links to websites which host a large number of snippets that "
|
424 |
+
"you can add to your site:"
|
425 |
+
msgstr ""
|
426 |
+
"Aqui alguns links para sites quais hospedam um grande número de snippets que "
|
427 |
+
"você pode adicionar ao seu site:"
|
428 |
+
|
429 |
+
#: php/class-contextual-help.php:102
|
430 |
+
msgid ""
|
431 |
+
"More places to find snippets, as well as a selection of example snippets, "
|
432 |
+
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/"
|
433 |
+
"wiki/Finding-snippets\">plugin documentation</a>"
|
434 |
+
msgstr ""
|
435 |
+
"Mais lugares para encontrar snippets, além de uma seleção de snippets de exemplo, "
|
436 |
+
"podem ser encontrados em <a href=\"https://github.com/sheabunge/code-snippets/"
|
437 |
+
"wiki/Finding-snippets\">documentação do plugin</a>"
|
438 |
+
|
439 |
+
#: php/class-contextual-help.php:107
|
440 |
+
msgid "Adding Snippets"
|
441 |
+
msgstr "Adicionando Snippets"
|
442 |
+
|
443 |
+
#: php/class-contextual-help.php:108
|
444 |
+
msgid ""
|
445 |
+
"You need to fill out the name and code fields for your snippet to be added. "
|
446 |
+
"While the description field will add more information about how your snippet "
|
447 |
+
"works, what is does and where you found it, it is completely optional."
|
448 |
+
msgstr ""
|
449 |
+
"Você precisa preencer o nome e o código para seu snippet ser adicionado. "
|
450 |
+
"Quando adicionado o campo de descrição ele irá adicionar mais informações de como seu snippet "
|
451 |
+
"trabalha, o que isso faz e conde encontrar, isto é completamente adicionado."
|
452 |
+
|
453 |
+
#: php/class-contextual-help.php:109
|
454 |
+
msgid ""
|
455 |
+
"Please be sure to check that your snippet is valid PHP code and will not "
|
456 |
+
"produce errors before adding it through this page. While doing so will not "
|
457 |
+
"become active straight away, it will help to minimise the chance of a faulty "
|
458 |
+
"snippet becoming active on your site."
|
459 |
+
msgstr ""
|
460 |
+
"Por favor esteja certo de checar que o seu snippet é um código PHP válido e não"
|
461 |
+
"ir produzir erros ander de adicionar a esta págin. Enquando não fizer isso não"
|
462 |
+
"ative, isto irá ajudar a minimizar a chande de snippets falhos se tornaram ativo"
|
463 |
+
"no seu site."
|
464 |
+
|
465 |
+
#: php/class-contextual-help.php:122
|
466 |
+
msgid ""
|
467 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
468 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
469 |
+
"of code, and do not put as much load on your server. Here you can load "
|
470 |
+
"snippets from a Code Snippets (.xml) import file into the database with your "
|
471 |
+
"existing snippets."
|
472 |
+
msgstr ""
|
473 |
+
"Snippets são parecidos com plugins - ambos extendem e expandem as "
|
474 |
+
"funcionalidades do WordPress. Snippets são mais leves, com poucas linhas "
|
475 |
+
"de código, e não colocam muita carga no seu servidor. Aqui você pode carregar "
|
476 |
+
"seus snippets de um arquivo importado de Code Snippet para o banco de dados com "
|
477 |
+
" seus snippets existentes."
|
478 |
+
|
479 |
+
|
480 |
+
#: php/class-contextual-help.php:127
|
481 |
+
msgid "Importing"
|
482 |
+
msgstr "Importando"
|
483 |
+
|
484 |
+
#: php/class-contextual-help.php:128
|
485 |
+
msgid ""
|
486 |
+
"You can load your snippets from a code snippets (.xml) export file using "
|
487 |
+
"this page."
|
488 |
+
msgstr ""
|
489 |
+
"Você carregar seus snippets de um arquivo com trechos de código exportado (.xml) usando "
|
490 |
+
"essa página."
|
491 |
+
|
492 |
+
#: php/class-contextual-help.php:129
|
493 |
+
#, php-format
|
494 |
+
msgid ""
|
495 |
+
"Snippets will be added to the database along with your existing snippets. "
|
496 |
+
"Regardless of whether the snippets were active on the previous site, "
|
497 |
+
"imported snippets are always inactive until activated using the <a href=\"%s"
|
498 |
+
"\">All Snippets</a> page.</p>"
|
499 |
+
msgstr ""
|
500 |
+
"Snippets serão adicionados ao banco de dados junto com seus snippets existententes. "
|
501 |
+
"Independente se os snippets estavam ativos no site anterior, "
|
502 |
+
"snippets importados são sempre desativados até acessar a página <a href=\"%s"
|
503 |
+
"\">Todos os Snippets</a></p>"
|
504 |
+
|
505 |
+
#: php/class-contextual-help.php:134
|
506 |
+
msgid "Exporting"
|
507 |
+
msgstr "Exportando"
|
508 |
+
|
509 |
+
#: php/class-contextual-help.php:135
|
510 |
+
#, php-format
|
511 |
+
msgid ""
|
512 |
+
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
513 |
+
"<a href=\"%s\">Manage Snippets</a> page."
|
514 |
+
msgstr ""
|
515 |
+
"Você pode salvar seus snippets para um arquivo de exportação Code Snippets (.xml) "
|
516 |
+
"usando a página <a href=\"%s\"> Snippets</a>."
|
517 |
+
|
518 |
+
#: php/class-export.php:87
|
519 |
+
msgid ""
|
520 |
+
"This is a code snippets export file generated by the Code Snippets WordPress "
|
521 |
+
"plugin."
|
522 |
+
msgstr ""
|
523 |
+
"Esse é um arquivo exportado de trecho de código gerado pelo plugin Code Snippets WordPress "
|
524 |
+
|
525 |
+
#: php/class-export.php:89
|
526 |
+
msgid "To import these snippets a WordPress site follow these steps:"
|
527 |
+
msgstr "Para importar esses snippets para um site WordPress siga esses passos:"
|
528 |
+
|
529 |
+
#: php/class-export.php:90
|
530 |
+
msgid "1. Log in to that site as an administrator."
|
531 |
+
msgstr "1. Faça o log in do site como administrador."
|
532 |
+
|
533 |
+
#: php/class-export.php:91
|
534 |
+
msgid ""
|
535 |
+
"2. Install the Code Snippets plugin using the directions provided at the "
|
536 |
+
"above link."
|
537 |
+
msgstr ""
|
538 |
+
"2. Instalar o Code Snippets plugin usando as diresções providas no "
|
539 |
+
"link acima."
|
540 |
+
|
541 |
+
#: php/class-export.php:92
|
542 |
+
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
543 |
+
msgstr "3. Vá para 'Ferramentas: Impotar' no painel de administração do WordPress."
|
544 |
+
|
545 |
+
#: php/class-export.php:93
|
546 |
+
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
547 |
+
msgstr "4. Clique no importador \"Code Snippets\" nesta lista"
|
548 |
+
|
549 |
+
#: php/class-export.php:94
|
550 |
+
msgid "5. Upload this file using the form provided on that page."
|
551 |
+
msgstr "5. Faça o upload deste arquivo usando o formulário desta página."
|
552 |
+
|
553 |
+
#: php/class-export.php:95
|
554 |
+
msgid ""
|
555 |
+
"6. Code Snippets will then import all of the snippets and associated "
|
556 |
+
"information contained in this file into your site."
|
557 |
+
msgstr ""
|
558 |
+
"6. Code Snippets irá então importar todos os snippets e associar "
|
559 |
+
"as informações contidas no arquivo dentro do seu site."
|
560 |
+
|
561 |
+
#: php/class-export.php:96
|
562 |
+
msgid ""
|
563 |
+
"7. You will then have to visit the 'Snippets: All Snippets' admin menu and "
|
564 |
+
"activate desired snippets."
|
565 |
+
msgstr ""
|
566 |
+
"7. Você tem que visitar 'Snippets: Todos Snippets' no menu de administração "
|
567 |
+
"e ativar os snippets desejados."
|
568 |
+
|
569 |
+
#: php/class-list-table.php:58
|
570 |
+
msgid "Snippets per page"
|
571 |
+
msgstr "Snippets por página"
|
572 |
+
|
573 |
+
#: php/class-list-table.php:119 php/class-list-table.php:387
|
574 |
+
msgid "Network Deactivate"
|
575 |
+
msgstr "Desativar na rede"
|
576 |
+
|
577 |
+
#: php/class-list-table.php:119 php/class-list-table.php:191
|
578 |
+
#: php/class-list-table.php:387
|
579 |
+
msgid "Deactivate"
|
580 |
+
msgstr "Desativar"
|
581 |
+
|
582 |
+
#: php/class-list-table.php:128 php/class-list-table.php:386
|
583 |
+
msgid "Network Activate"
|
584 |
+
msgstr "Ativar na rede"
|
585 |
+
|
586 |
+
#: php/class-list-table.php:128 php/class-list-table.php:191
|
587 |
+
#: php/class-list-table.php:386
|
588 |
+
msgid "Activate"
|
589 |
+
msgstr "Ativar"
|
590 |
+
|
591 |
+
#: php/class-list-table.php:138 php/class-list-table.php:207
|
592 |
+
msgid "Edit"
|
593 |
+
msgstr "Editar"
|
594 |
+
|
595 |
+
#: php/class-list-table.php:144 php/class-list-table.php:213
|
596 |
+
#: php/class-list-table.php:388 php/views/edit.php:111
|
597 |
+
msgid "Export"
|
598 |
+
msgstr "Exportar"
|
599 |
+
|
600 |
+
#: php/class-list-table.php:153 php/class-list-table.php:225
|
601 |
+
#: php/class-list-table.php:389 php/views/edit.php:124
|
602 |
+
msgid "Delete"
|
603 |
+
msgstr "Remover"
|
604 |
+
|
605 |
+
#: php/class-list-table.php:160 php/class-list-table.php:235
|
606 |
+
msgid "You are about to permanently delete the selected item."
|
607 |
+
msgstr "Você está prestes a remover permanentemente os itens selecionados"
|
608 |
+
|
609 |
+
#: php/class-list-table.php:161 php/class-list-table.php:236
|
610 |
+
#: php/views/edit.php:119
|
611 |
+
msgid "'Cancel' to stop, 'OK' to delete."
|
612 |
+
msgstr "'Cancelar' para parar, 'OK' para remover."
|
613 |
+
|
614 |
+
#: php/class-list-table.php:168
|
615 |
+
msgid "Network Active"
|
616 |
+
msgstr "Ativo na rede"
|
617 |
+
|
618 |
+
#: php/class-list-table.php:170
|
619 |
+
msgid "Network Only"
|
620 |
+
msgstr "Somente na rede"
|
621 |
+
|
622 |
+
#: php/class-list-table.php:255
|
623 |
+
#, php-format
|
624 |
+
msgid "Untitled #%d"
|
625 |
+
msgstr "Sem título #%d"
|
626 |
+
|
627 |
+
#: php/class-list-table.php:278
|
628 |
+
msgid "Shared on Network"
|
629 |
+
msgstr "Compartilhado na rede"
|
630 |
+
|
631 |
+
#: php/class-list-table.php:339 php/views/edit.php:48
|
632 |
+
msgid "Name"
|
633 |
+
msgstr "Nome"
|
634 |
+
|
635 |
+
#: php/class-list-table.php:340
|
636 |
+
msgid "ID"
|
637 |
+
msgstr "ID"
|
638 |
+
|
639 |
+
#: php/class-list-table.php:390
|
640 |
+
msgid "Export to PHP"
|
641 |
+
msgstr "Exportar para PHP"
|
642 |
+
|
643 |
+
#: php/class-list-table.php:428
|
644 |
+
#, php-format
|
645 |
+
msgid "All <span class=\"count\">(%s)</span>"
|
646 |
+
msgid_plural "All <span class=\"count\">(%s)</span>"
|
647 |
+
msgstr[0] "Todos <span class=\"count\">(%s)</span>"
|
648 |
+
msgstr[1] "Todos <span class=\"count\">(%s)</span>"
|
649 |
+
|
650 |
+
#: php/class-list-table.php:429
|
651 |
+
#, php-format
|
652 |
+
msgid "Active <span class=\"count\">(%s)</span>"
|
653 |
+
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
654 |
+
msgstr[0] "Ativo <span class=\"count\">(%s)</span>"
|
655 |
+
msgstr[1] "Ativo <span class=\"count\">(%s)</span>"
|
656 |
+
|
657 |
+
#: php/class-list-table.php:430
|
658 |
+
#, php-format
|
659 |
+
msgid "Inactive <span class=\"count\">(%s)</span>"
|
660 |
+
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
661 |
+
msgstr[0] "Inativo <span class=\"count\">(%s)</span>"
|
662 |
+
msgstr[1] "Inativo <span class=\"count\">(%s)</span>"
|
663 |
+
|
664 |
+
#: php/class-list-table.php:431
|
665 |
+
#, php-format
|
666 |
+
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
667 |
+
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
668 |
+
msgstr[0] "Recentemente ativo<span class=\"count\">(%s)</span>"
|
669 |
+
msgstr[1] "Recentemente ativo <span class=\"count\">(%s)</span>"
|
670 |
+
|
671 |
+
#: php/class-list-table.php:494
|
672 |
+
msgid "Show all tags"
|
673 |
+
msgstr "Mostrar todas as tags"
|
674 |
+
|
675 |
+
#: php/class-list-table.php:508
|
676 |
+
msgid "Filter"
|
677 |
+
msgstr "Filtro"
|
678 |
+
|
679 |
+
#: php/class-list-table.php:516
|
680 |
+
msgid "Clear List"
|
681 |
+
msgstr "Limpar lista"
|
682 |
+
|
683 |
+
#: php/class-list-table.php:702
|
684 |
+
msgid "Whoops, it looks like no snippets could be found."
|
685 |
+
msgstr "Ops, parece que nenhum snippet pode ser encontrado."
|
686 |
+
|
687 |
+
#: php/class-list-table.php:706
|
688 |
+
msgid "Perhaps you would like to add a new one?"
|
689 |
+
msgstr "Talvez você gostaria de adicionar um novo?"
|
690 |
+
|
691 |
+
#: php/class-list-table.php:1000
|
692 |
+
msgid "Search results"
|
693 |
+
msgstr "Procurar resultados"
|
694 |
+
|
695 |
+
#: php/class-list-table.php:1003
|
696 |
+
#, php-format
|
697 |
+
msgid " for “%s”"
|
698 |
+
msgstr " para “%s”"
|
699 |
+
|
700 |
+
#: php/class-list-table.php:1007
|
701 |
+
#, php-format
|
702 |
+
msgid " in tag “%s”"
|
703 |
+
msgstr " na tag “%s”"
|
704 |
+
|
705 |
+
#: php/class-list-table.php:1015
|
706 |
+
msgid "Clear Filters"
|
707 |
+
msgstr "Limpar filtros"
|
708 |
+
|
709 |
+
#: php/settings/settings-fields.php:42
|
710 |
+
msgid "Activate by Default"
|
711 |
+
msgstr "Ativar por padrão"
|
712 |
+
|
713 |
+
#: php/settings/settings-fields.php:44
|
714 |
+
msgid ""
|
715 |
+
"Make the 'Save and Activate' button the default action when saving a snippet."
|
716 |
+
msgstr ""
|
717 |
+
"Faça 'Salvar e ativar' botão ação padrão quando salvar um snippet."
|
718 |
+
|
719 |
+
#: php/settings/settings-fields.php:49
|
720 |
+
msgid "Enable Scope Selector"
|
721 |
+
msgstr "Habilitar seletor de escopo"
|
722 |
+
|
723 |
+
#: php/settings/settings-fields.php:51
|
724 |
+
msgid "Enable the scope selector when editing a snippet"
|
725 |
+
msgstr "Habilitar o seletor de escopo quando editando um snippet"
|
726 |
+
|
727 |
+
#: php/settings/settings-fields.php:56
|
728 |
+
msgid "Enable Snippet Tags"
|
729 |
+
msgstr "Habilitar tag de Snippet"
|
730 |
+
|
731 |
+
#: php/settings/settings-fields.php:58
|
732 |
+
msgid "Show snippet tags on admin pages"
|
733 |
+
msgstr "Mostrar tag de snippet na página de administração"
|
734 |
+
|
735 |
+
#: php/settings/settings-fields.php:63
|
736 |
+
msgid "Enable Snippet Descriptions"
|
737 |
+
msgstr "Habilitar descrição de Snippet"
|
738 |
+
|
739 |
+
#: php/settings/settings-fields.php:65
|
740 |
+
msgid "Show snippet descriptions on admin pages"
|
741 |
+
msgstr "Mostar descrição de snippets na página de administração"
|
742 |
+
|
743 |
+
#: php/settings/settings-fields.php:70
|
744 |
+
msgid "Show Network Snippets"
|
745 |
+
msgstr "Mostar Snippets da rede"
|
746 |
+
|
747 |
+
#: php/settings/settings-fields.php:72
|
748 |
+
msgid "Show network-wide snippets in the snippets table on subsites"
|
749 |
+
msgstr "Mostrar todos os snippets da rede na tabela de snippets nos subsites "
|
750 |
+
|
751 |
+
#: php/settings/settings-fields.php:77
|
752 |
+
msgid "Disable shortcode syntax highlighter"
|
753 |
+
msgstr "Desabilitar atalhos para destaque de sintaxe"
|
754 |
+
|
755 |
+
#: php/settings/settings-fields.php:79
|
756 |
+
msgid ""
|
757 |
+
"Disable the syntax highlighting for the [code_snippet] shortcode on the "
|
758 |
+
"front-end"
|
759 |
+
msgstr ""
|
760 |
+
"Desabilite o destaque da sintaxe do [code_snippet] para atalhos no "
|
761 |
+
"front-end"
|
762 |
+
|
763 |
+
#: php/settings/settings-fields.php:92
|
764 |
+
msgid "Row Height"
|
765 |
+
msgstr "Altura da linha"
|
766 |
+
|
767 |
+
#: php/settings/settings-fields.php:94
|
768 |
+
msgid "rows"
|
769 |
+
msgstr "linhas"
|
770 |
+
|
771 |
+
#: php/settings/settings-fields.php:100
|
772 |
+
msgid "Use Full Editor"
|
773 |
+
msgstr "Use o editor completo"
|
774 |
+
|
775 |
+
#: php/settings/settings-fields.php:102
|
776 |
+
msgid "Enable all features of the visual editor"
|
777 |
+
msgstr "Habilite todos os recursos do editor visual"
|
778 |
+
|
779 |
+
#: php/settings/settings-fields.php:107
|
780 |
+
msgid "Media Buttons"
|
781 |
+
msgstr "Botões de mídia"
|
782 |
+
|
783 |
+
#: php/settings/settings-fields.php:109
|
784 |
+
msgid "Enable the add media buttons"
|
785 |
+
msgstr "Habilite o botão de adicionar mídia"
|
786 |
+
|
787 |
+
#: php/settings/settings-fields.php:118
|
788 |
+
msgid "Theme"
|
789 |
+
msgstr "Tema"
|
790 |
+
|
791 |
+
#: php/settings/settings-fields.php:125
|
792 |
+
msgid "Indent With Tabs"
|
793 |
+
msgstr "Indentar com tabulação"
|
794 |
+
|
795 |
+
#: php/settings/settings-fields.php:127
|
796 |
+
msgid "Use hard tabs (not spaces) for indentation."
|
797 |
+
msgstr "Use tabulações (Ao invés de espaços) para indentação."
|
798 |
+
|
799 |
+
#: php/settings/settings-fields.php:133
|
800 |
+
msgid "Tab Size"
|
801 |
+
msgstr "Largura da tabulação"
|
802 |
+
|
803 |
+
#: php/settings/settings-fields.php:135
|
804 |
+
msgid "The width of a tab character."
|
805 |
+
msgstr "A largura do carácter de tabulação."
|
806 |
+
|
807 |
+
#: php/settings/settings-fields.php:142
|
808 |
+
msgid "Indent Unit"
|
809 |
+
msgstr "Unidade de identação"
|
810 |
+
|
811 |
+
#: php/settings/settings-fields.php:144
|
812 |
+
msgid "How many spaces a block should be indented."
|
813 |
+
msgstr "Com quantos espaços um bloco deve ser indentado"
|
814 |
+
|
815 |
+
#: php/settings/settings-fields.php:151
|
816 |
+
msgid "Wrap Lines"
|
817 |
+
msgstr "Envolver linhas"
|
818 |
+
|
819 |
+
#: php/settings/settings-fields.php:153
|
820 |
+
msgid "Whether the editor should scroll or wrap for long lines."
|
821 |
+
msgstr "Se o editor deve fazer rolagem ou envolver longas linhas"
|
822 |
+
|
823 |
+
#: php/settings/settings-fields.php:159
|
824 |
+
msgid "Line Numbers"
|
825 |
+
msgstr "Números de linha"
|
826 |
+
|
827 |
+
#: php/settings/settings-fields.php:161
|
828 |
+
msgid "Show line numbers to the left of the editor."
|
829 |
+
msgstr "Mostrar números da linha à esquerda do editor "
|
830 |
+
|
831 |
+
#: php/settings/settings-fields.php:167
|
832 |
+
msgid "Auto Close Brackets"
|
833 |
+
msgstr "Fechar colchetes automaticamente"
|
834 |
+
|
835 |
+
#: php/settings/settings-fields.php:169
|
836 |
+
msgid "Auto-close brackets and quotes when typed."
|
837 |
+
msgstr "Feche os colchetes automaticamente e aspas quando digitado"
|
838 |
+
|
839 |
+
#: php/settings/settings-fields.php:175
|
840 |
+
msgid "Highlight Selection Matches"
|
841 |
+
msgstr "Destaque as seleções que combinam"
|
842 |
+
|
843 |
+
#: php/settings/settings-fields.php:176
|
844 |
+
msgid "Highlight all instances of a currently selected word."
|
845 |
+
msgstr "Destaque todas as instâncias da atual palavra selecionada"
|
846 |
+
|
847 |
+
#: php/settings/settings.php:68
|
848 |
+
msgid "General"
|
849 |
+
msgstr "Geral"
|
850 |
+
|
851 |
+
#: php/settings/settings.php:69
|
852 |
+
msgid "Description Editor"
|
853 |
+
msgstr "Editor de descrição"
|
854 |
+
|
855 |
+
#: php/settings/settings.php:70
|
856 |
+
msgid "Code Editor"
|
857 |
+
msgstr "Editor de código"
|
858 |
+
|
859 |
+
#: php/settings/settings.php:119
|
860 |
+
msgid "Editor Preview"
|
861 |
+
msgstr "Editor de pré-visualização"
|
862 |
+
|
863 |
+
#: php/settings/settings.php:176
|
864 |
+
msgid "Settings saved."
|
865 |
+
msgstr "Configurações salvas"
|
866 |
+
|
867 |
+
#: php/views/edit.php:28 php/views/manage.php:22
|
868 |
+
msgctxt "snippet"
|
869 |
+
msgid "Add New"
|
870 |
+
msgstr "Adicionar novo"
|
871 |
+
|
872 |
+
#: php/views/edit.php:49
|
873 |
+
msgid "Enter title here"
|
874 |
+
msgstr "Coloque o título aqui"
|
875 |
+
|
876 |
+
#: php/views/edit.php:54
|
877 |
+
msgid "Code"
|
878 |
+
msgstr "Código"
|
879 |
+
|
880 |
+
#: php/views/edit.php:81 php/views/edit.php:95
|
881 |
+
msgid "Save Changes and Activate"
|
882 |
+
msgstr "Salve alterações e ative"
|
883 |
+
|
884 |
+
#: php/views/edit.php:101
|
885 |
+
msgid "Save Changes and Deactivate"
|
886 |
+
msgstr "Salve alterações e desative"
|
887 |
+
|
888 |
+
#: php/views/edit.php:118
|
889 |
+
msgid "You are about to permanently delete this snippet."
|
890 |
+
msgstr "Você está prestes a deletar este snippter permanentemente"
|
891 |
+
|
892 |
+
#: php/views/import.php:21
|
893 |
+
msgid ""
|
894 |
+
"Howdy! Upload your Code Snippets export file and we’ll import the "
|
895 |
+
"snippets to this site."
|
896 |
+
msgstr ""
|
897 |
+
"Olá! Faça o upload dos seus aquivos com trechos de código exportado e we’ll importe "
|
898 |
+
"os snippets para este site."
|
899 |
+
|
900 |
+
#: php/views/import.php:23
|
901 |
+
#, php-format
|
902 |
+
msgid ""
|
903 |
+
"You will need to go to the <a href=\"%s\">All Snippets</a> page to activate "
|
904 |
+
"the imported snippets."
|
905 |
+
msgstr ""
|
906 |
+
"Você precisará ir na página <a href=\"%s\">Todos os Snippets</a> para ativar"
|
907 |
+
"os snippets importados."
|
908 |
+
|
909 |
+
#: php/views/import.php:25
|
910 |
+
msgid ""
|
911 |
+
"Choose a Code Snippets (.xml) file to upload, then click Upload file and "
|
912 |
+
"import."
|
913 |
+
msgstr ""
|
914 |
+
"Escolha um aquirvo de Code Snippets (.xml) parar upload, então clique em Upload de arquivo e"
|
915 |
+
"importe."
|
916 |
+
|
917 |
+
#: php/views/import.php:32
|
918 |
+
msgid "Choose a file from your computer:"
|
919 |
+
msgstr "Escolha um arquivo do seu computador:"
|
920 |
+
|
921 |
+
#: php/views/import.php:33
|
922 |
+
msgid "(Maximum size: 8MB)"
|
923 |
+
msgstr "(Tamanho máximo: 8MB)"
|
924 |
+
|
925 |
+
#: php/views/import.php:39
|
926 |
+
msgid "Upload file and import"
|
927 |
+
msgstr "Upload arquivo e importe"
|
928 |
+
|
929 |
+
#: php/views/manage.php:34
|
930 |
+
msgid "Search Installed Snippets"
|
931 |
+
msgstr "Procure Snippets instalados"
|
languages/code-snippets.pot
CHANGED
@@ -6,9 +6,9 @@
|
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
-
"Project-Id-Version: code-snippets 2.
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2018-01-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -23,7 +23,7 @@ msgid "You are not authorized to access this page."
|
|
23 |
msgstr ""
|
24 |
|
25 |
#: php/admin-menus/class-edit-menu.php:13
|
26 |
-
#: php/admin-menus/class-edit-menu.php:14 php/views/edit.php:
|
27 |
msgid "Edit Snippet"
|
28 |
msgstr ""
|
29 |
|
@@ -32,104 +32,112 @@ msgctxt "menu label"
|
|
32 |
msgid "Add New"
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: php/admin-menus/class-edit-menu.php:40 php/views/edit.php:
|
36 |
msgid "Add New Snippet"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: php/admin-menus/class-edit-menu.php:
|
40 |
msgid "Don't Panic"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: php/admin-menus/class-edit-menu.php:
|
44 |
#, php-format
|
45 |
msgid ""
|
46 |
"The code snippet you are trying to save produced a fatal error on line %d:"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: php/admin-menus/class-edit-menu.php:
|
50 |
msgid ""
|
51 |
"The previous version of the snippet is unchanged, and the rest of this site "
|
52 |
"should be functioning normally as before."
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: php/admin-menus/class-edit-menu.php:
|
56 |
msgid ""
|
57 |
"Please use the back button in your browser to return to the previous page "
|
58 |
"and try to fix the code error."
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: php/admin-menus/class-edit-menu.php:
|
62 |
msgid ""
|
63 |
"If you prefer, you can close this page and discard the changes you just "
|
64 |
"made. No changes will be made to this site."
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: php/admin-menus/class-edit-menu.php:
|
68 |
msgid "Description"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: php/admin-menus/class-edit-menu.php:
|
72 |
msgid "Tags"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: php/admin-menus/class-edit-menu.php:
|
76 |
msgid "Enter a list of tags; separated by commas"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: php/admin-menus/class-edit-menu.php:
|
80 |
msgid "Run snippet everywhere"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: php/admin-menus/class-edit-menu.php:
|
84 |
msgid "Only run in administration area"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: php/admin-menus/class-edit-menu.php:
|
88 |
msgid "Only run on site front-end"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: php/admin-menus/class-edit-menu.php:
|
|
|
|
|
|
|
|
|
92 |
msgid "Scope"
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: php/admin-menus/class-edit-menu.php:
|
96 |
msgid "Sharing Settings"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: php/admin-menus/class-edit-menu.php:
|
100 |
msgid "Allow this snippet to be activated on individual sites on the network"
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: php/admin-menus/class-edit-menu.php:
|
104 |
#, php-format
|
105 |
msgid "The snippet has been deactivated due to an error on line %d:"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: php/admin-menus/class-edit-menu.php:
|
109 |
msgid "The snippet has been deactivated due to an error in the code."
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: php/admin-menus/class-edit-menu.php:
|
113 |
msgid "An error occurred when saving the snippet."
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: php/admin-menus/class-edit-menu.php:
|
117 |
msgid "Snippet <strong>added</strong>."
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: php/admin-menus/class-edit-menu.php:
|
121 |
msgid "Snippet <strong>updated</strong>."
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: php/admin-menus/class-edit-menu.php:
|
125 |
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
126 |
msgstr ""
|
127 |
|
128 |
-
#: php/admin-menus/class-edit-menu.php:
|
|
|
|
|
|
|
|
|
129 |
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
130 |
msgstr ""
|
131 |
|
132 |
-
#: php/admin-menus/class-edit-menu.php:
|
133 |
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
134 |
msgstr ""
|
135 |
|
@@ -142,15 +150,15 @@ msgstr ""
|
|
142 |
msgid "Import Snippets"
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: php/admin-menus/class-import-menu.php:
|
146 |
msgid "Code Snippets"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: php/admin-menus/class-import-menu.php:
|
150 |
msgid "Import snippets from a code snippets export file"
|
151 |
msgstr ""
|
152 |
|
153 |
-
#: php/admin-menus/class-import-menu.php:
|
154 |
#, php-format
|
155 |
msgid ""
|
156 |
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
@@ -161,7 +169,7 @@ msgid_plural ""
|
|
161 |
msgstr[0] ""
|
162 |
msgstr[1] ""
|
163 |
|
164 |
-
#: php/admin-menus/class-import-menu.php:
|
165 |
msgid "An error occurred when processing the import file."
|
166 |
msgstr ""
|
167 |
|
@@ -172,7 +180,7 @@ msgstr ""
|
|
172 |
|
173 |
#: php/admin-menus/class-manage-menu.php:23
|
174 |
#: php/admin-menus/class-manage-menu.php:45 php/class-admin.php:61
|
175 |
-
#: php/class-admin.php:
|
176 |
msgid "Snippets"
|
177 |
msgstr ""
|
178 |
|
@@ -190,26 +198,30 @@ msgid ""
|
|
190 |
msgstr ""
|
191 |
|
192 |
#: php/admin-menus/class-manage-menu.php:87
|
193 |
-
msgid "Snippet <strong>
|
194 |
msgstr ""
|
195 |
|
196 |
#: php/admin-menus/class-manage-menu.php:88
|
197 |
-
msgid "
|
198 |
msgstr ""
|
199 |
|
200 |
#: php/admin-menus/class-manage-menu.php:89
|
201 |
-
msgid "
|
202 |
msgstr ""
|
203 |
|
204 |
#: php/admin-menus/class-manage-menu.php:90
|
205 |
-
msgid "
|
206 |
msgstr ""
|
207 |
|
208 |
#: php/admin-menus/class-manage-menu.php:91
|
209 |
-
msgid "
|
210 |
msgstr ""
|
211 |
|
212 |
#: php/admin-menus/class-manage-menu.php:92
|
|
|
|
|
|
|
|
|
213 |
msgid "Selected snippets <strong>deleted</strong>."
|
214 |
msgstr ""
|
215 |
|
@@ -222,50 +234,58 @@ msgstr ""
|
|
222 |
msgid "Snippets Settings"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: php/admin-menus/class-settings-menu.php:
|
226 |
msgid "Settings"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: php/class-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
msgid "Manage your existing snippets"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: php/class-admin.php:
|
234 |
msgid "Visit the WordPress.org plugin page"
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: php/class-admin.php:
|
238 |
msgid "About"
|
239 |
msgstr ""
|
240 |
|
241 |
-
#: php/class-admin.php:
|
242 |
msgid "Visit the support forums"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: php/class-admin.php:
|
246 |
msgid "Support"
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: php/class-admin.php:
|
250 |
msgid "Support this plugin's development"
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: php/class-admin.php:
|
254 |
msgid "Donate"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: php/class-admin.php:
|
258 |
msgid ""
|
259 |
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
260 |
"answer a short survey on how you use this plugin and what you'd like to see "
|
261 |
"changed or added in the future."
|
262 |
msgstr ""
|
263 |
|
264 |
-
#: php/class-admin.php:
|
265 |
msgid "Take the survey now"
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: php/class-admin.php:
|
269 |
msgid "Dismiss"
|
270 |
msgstr ""
|
271 |
|
@@ -460,45 +480,45 @@ msgid ""
|
|
460 |
"<a href=\"%s\">Manage Snippets</a> page."
|
461 |
msgstr ""
|
462 |
|
463 |
-
#: php/class-export.php:
|
464 |
msgid ""
|
465 |
"This is a code snippets export file generated by the Code Snippets WordPress "
|
466 |
"plugin."
|
467 |
msgstr ""
|
468 |
|
469 |
-
#: php/class-export.php:
|
470 |
msgid "To import these snippets a WordPress site follow these steps:"
|
471 |
msgstr ""
|
472 |
|
473 |
-
#: php/class-export.php:
|
474 |
msgid "1. Log in to that site as an administrator."
|
475 |
msgstr ""
|
476 |
|
477 |
-
#: php/class-export.php:
|
478 |
msgid ""
|
479 |
"2. Install the Code Snippets plugin using the directions provided at the "
|
480 |
"above link."
|
481 |
msgstr ""
|
482 |
|
483 |
-
#: php/class-export.php:
|
484 |
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
485 |
msgstr ""
|
486 |
|
487 |
-
#: php/class-export.php:
|
488 |
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
489 |
msgstr ""
|
490 |
|
491 |
-
#: php/class-export.php:
|
492 |
msgid "5. Upload this file using the form provided on that page."
|
493 |
msgstr ""
|
494 |
|
495 |
-
#: php/class-export.php:
|
496 |
msgid ""
|
497 |
"6. Code Snippets will then import all of the snippets and associated "
|
498 |
"information contained in this file into your site."
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: php/class-export.php:
|
502 |
msgid ""
|
503 |
"7. You will then have to visit the 'Snippets: All Snippets' admin menu and "
|
504 |
"activate desired snippets."
|
@@ -508,139 +528,143 @@ msgstr ""
|
|
508 |
msgid "Snippets per page"
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: php/class-list-table.php:121 php/class-list-table.php:
|
512 |
msgid "Network Deactivate"
|
513 |
msgstr ""
|
514 |
|
515 |
-
#: php/class-list-table.php:121 php/class-list-table.php:
|
516 |
-
#: php/class-list-table.php:
|
517 |
msgid "Deactivate"
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: php/class-list-table.php:
|
|
|
|
|
|
|
|
|
521 |
msgid "Network Activate"
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: php/class-list-table.php:
|
525 |
-
#: php/class-list-table.php:
|
526 |
msgid "Activate"
|
527 |
msgstr ""
|
528 |
|
529 |
-
#: php/class-list-table.php:
|
530 |
msgid "Edit"
|
531 |
msgstr ""
|
532 |
|
533 |
-
#: php/class-list-table.php:
|
534 |
-
#: php/class-list-table.php:
|
535 |
msgid "Export"
|
536 |
msgstr ""
|
537 |
|
538 |
-
#: php/class-list-table.php:
|
539 |
-
#: php/class-list-table.php:
|
540 |
msgid "Delete"
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: php/class-list-table.php:
|
544 |
msgid "You are about to permanently delete the selected item."
|
545 |
msgstr ""
|
546 |
|
547 |
-
#: php/class-list-table.php:
|
548 |
-
#: php/views/edit.php:
|
549 |
msgid "'Cancel' to stop, 'OK' to delete."
|
550 |
msgstr ""
|
551 |
|
552 |
-
#: php/class-list-table.php:
|
553 |
msgid "Network Active"
|
554 |
msgstr ""
|
555 |
|
556 |
-
#: php/class-list-table.php:
|
557 |
msgid "Network Only"
|
558 |
msgstr ""
|
559 |
|
560 |
-
#: php/class-list-table.php:
|
561 |
#, php-format
|
562 |
msgid "Untitled #%d"
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: php/class-list-table.php:
|
566 |
msgid "Shared on Network"
|
567 |
msgstr ""
|
568 |
|
569 |
-
#: php/class-list-table.php:
|
570 |
msgid "Name"
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: php/class-list-table.php:
|
574 |
msgid "ID"
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: php/class-list-table.php:
|
578 |
-
msgid "
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: php/class-list-table.php:
|
582 |
#, php-format
|
583 |
msgid "All <span class=\"count\">(%s)</span>"
|
584 |
msgid_plural "All <span class=\"count\">(%s)</span>"
|
585 |
msgstr[0] ""
|
586 |
msgstr[1] ""
|
587 |
|
588 |
-
#: php/class-list-table.php:
|
589 |
#, php-format
|
590 |
msgid "Active <span class=\"count\">(%s)</span>"
|
591 |
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
592 |
msgstr[0] ""
|
593 |
msgstr[1] ""
|
594 |
|
595 |
-
#: php/class-list-table.php:
|
596 |
#, php-format
|
597 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
598 |
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
599 |
msgstr[0] ""
|
600 |
msgstr[1] ""
|
601 |
|
602 |
-
#: php/class-list-table.php:
|
603 |
#, php-format
|
604 |
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
605 |
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
606 |
msgstr[0] ""
|
607 |
msgstr[1] ""
|
608 |
|
609 |
-
#: php/class-list-table.php:
|
610 |
msgid "Show all tags"
|
611 |
msgstr ""
|
612 |
|
613 |
-
#: php/class-list-table.php:
|
614 |
msgid "Filter"
|
615 |
msgstr ""
|
616 |
|
617 |
-
#: php/class-list-table.php:
|
618 |
msgid "Clear List"
|
619 |
msgstr ""
|
620 |
|
621 |
-
#: php/class-list-table.php:
|
622 |
msgid "Whoops, it looks like no snippets could be found."
|
623 |
msgstr ""
|
624 |
|
625 |
-
#: php/class-list-table.php:
|
626 |
msgid "Perhaps you would like to add a new one?"
|
627 |
msgstr ""
|
628 |
|
629 |
-
#: php/class-list-table.php:
|
630 |
msgid "Search results"
|
631 |
msgstr ""
|
632 |
|
633 |
-
#: php/class-list-table.php:
|
634 |
#, php-format
|
635 |
msgid " for “%s”"
|
636 |
msgstr ""
|
637 |
|
638 |
-
#: php/class-list-table.php:
|
639 |
#, php-format
|
640 |
msgid " in tag “%s”"
|
641 |
msgstr ""
|
642 |
|
643 |
-
#: php/class-list-table.php:
|
644 |
msgid "Clear Filters"
|
645 |
msgstr ""
|
646 |
|
@@ -682,7 +706,9 @@ msgid "Show Network Snippets"
|
|
682 |
msgstr ""
|
683 |
|
684 |
#: php/settings/settings-fields.php:72
|
685 |
-
msgid "
|
|
|
|
|
686 |
msgstr ""
|
687 |
|
688 |
#: php/settings/settings-fields.php:77
|
@@ -779,80 +805,102 @@ msgstr ""
|
|
779 |
msgid "Highlight all instances of a currently selected word."
|
780 |
msgstr ""
|
781 |
|
782 |
-
#: php/settings/settings.php:
|
783 |
msgid "General"
|
784 |
msgstr ""
|
785 |
|
786 |
-
#: php/settings/settings.php:
|
787 |
msgid "Description Editor"
|
788 |
msgstr ""
|
789 |
|
790 |
-
#: php/settings/settings.php:
|
791 |
msgid "Code Editor"
|
792 |
msgstr ""
|
793 |
|
794 |
-
#: php/settings/settings.php:
|
795 |
msgid "Editor Preview"
|
796 |
msgstr ""
|
797 |
|
798 |
-
#: php/
|
799 |
-
msgid "Settings saved."
|
800 |
-
msgstr ""
|
801 |
-
|
802 |
-
#: php/views/edit.php:28 php/views/manage.php:22
|
803 |
msgctxt "snippet"
|
804 |
msgid "Add New"
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: php/views/edit.php:
|
808 |
msgid "Enter title here"
|
809 |
msgstr ""
|
810 |
|
811 |
-
#: php/views/edit.php:
|
812 |
msgid "Code"
|
813 |
msgstr ""
|
814 |
|
815 |
-
#: php/views/edit.php:
|
|
|
|
|
|
|
|
|
816 |
msgid "Save Changes and Activate"
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: php/views/edit.php:
|
820 |
msgid "Save Changes and Deactivate"
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: php/views/edit.php:
|
824 |
msgid "You are about to permanently delete this snippet."
|
825 |
msgstr ""
|
826 |
|
827 |
#: php/views/import.php:21
|
828 |
msgid ""
|
829 |
-
"
|
830 |
-
"
|
831 |
msgstr ""
|
832 |
|
833 |
-
#: php/views/import.php:
|
834 |
#, php-format
|
835 |
msgid ""
|
836 |
-
"
|
837 |
-
"the imported snippets."
|
838 |
msgstr ""
|
839 |
|
840 |
-
#: php/views/import.php:
|
841 |
msgid ""
|
842 |
-
"Choose
|
843 |
-
"import."
|
844 |
msgstr ""
|
845 |
|
846 |
-
#: php/views/import.php:
|
847 |
msgid "Choose a file from your computer:"
|
848 |
msgstr ""
|
849 |
|
850 |
-
#: php/views/import.php:
|
851 |
msgid "(Maximum size: 8MB)"
|
852 |
msgstr ""
|
853 |
|
854 |
-
#: php/views/import.php:
|
855 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
856 |
msgstr ""
|
857 |
|
858 |
#: php/views/manage.php:34
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
+
"Project-Id-Version: code-snippets 2.10.0\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2018-01-18 16:05+1100\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
23 |
msgstr ""
|
24 |
|
25 |
#: php/admin-menus/class-edit-menu.php:13
|
26 |
+
#: php/admin-menus/class-edit-menu.php:14 php/views/edit.php:23
|
27 |
msgid "Edit Snippet"
|
28 |
msgstr ""
|
29 |
|
32 |
msgid "Add New"
|
33 |
msgstr ""
|
34 |
|
35 |
+
#: php/admin-menus/class-edit-menu.php:40 php/views/edit.php:29
|
36 |
msgid "Add New Snippet"
|
37 |
msgstr ""
|
38 |
|
39 |
+
#: php/admin-menus/class-edit-menu.php:162
|
40 |
msgid "Don't Panic"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: php/admin-menus/class-edit-menu.php:163
|
44 |
#, php-format
|
45 |
msgid ""
|
46 |
"The code snippet you are trying to save produced a fatal error on line %d:"
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: php/admin-menus/class-edit-menu.php:165
|
50 |
msgid ""
|
51 |
"The previous version of the snippet is unchanged, and the rest of this site "
|
52 |
"should be functioning normally as before."
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: php/admin-menus/class-edit-menu.php:166
|
56 |
msgid ""
|
57 |
"Please use the back button in your browser to return to the previous page "
|
58 |
"and try to fix the code error."
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: php/admin-menus/class-edit-menu.php:167
|
62 |
msgid ""
|
63 |
"If you prefer, you can close this page and discard the changes you just "
|
64 |
"made. No changes will be made to this site."
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: php/admin-menus/class-edit-menu.php:301 php/class-list-table.php:363
|
68 |
msgid "Description"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: php/admin-menus/class-edit-menu.php:334 php/class-list-table.php:364
|
72 |
msgid "Tags"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: php/admin-menus/class-edit-menu.php:339
|
76 |
msgid "Enter a list of tags; separated by commas"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: php/admin-menus/class-edit-menu.php:362
|
80 |
msgid "Run snippet everywhere"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: php/admin-menus/class-edit-menu.php:363
|
84 |
msgid "Only run in administration area"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: php/admin-menus/class-edit-menu.php:364
|
88 |
msgid "Only run on site front-end"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: php/admin-menus/class-edit-menu.php:365
|
92 |
+
msgid "Only run once"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: php/admin-menus/class-edit-menu.php:368
|
96 |
msgid "Scope"
|
97 |
msgstr ""
|
98 |
|
99 |
+
#: php/admin-menus/class-edit-menu.php:388
|
100 |
msgid "Sharing Settings"
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: php/admin-menus/class-edit-menu.php:392
|
104 |
msgid "Allow this snippet to be activated on individual sites on the network"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: php/admin-menus/class-edit-menu.php:452
|
108 |
#, php-format
|
109 |
msgid "The snippet has been deactivated due to an error on line %d:"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: php/admin-menus/class-edit-menu.php:457
|
113 |
msgid "The snippet has been deactivated due to an error in the code."
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: php/admin-menus/class-edit-menu.php:464
|
117 |
msgid "An error occurred when saving the snippet."
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: php/admin-menus/class-edit-menu.php:469
|
121 |
msgid "Snippet <strong>added</strong>."
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: php/admin-menus/class-edit-menu.php:470
|
125 |
msgid "Snippet <strong>updated</strong>."
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: php/admin-menus/class-edit-menu.php:471
|
129 |
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: php/admin-menus/class-edit-menu.php:472
|
133 |
+
msgid "Snippet <strong>added</strong> and <strong>executed</strong>."
|
134 |
+
msgstr ""
|
135 |
+
|
136 |
+
#: php/admin-menus/class-edit-menu.php:473
|
137 |
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
138 |
msgstr ""
|
139 |
|
140 |
+
#: php/admin-menus/class-edit-menu.php:474
|
141 |
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
142 |
msgstr ""
|
143 |
|
150 |
msgid "Import Snippets"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: php/admin-menus/class-import-menu.php:94
|
154 |
msgid "Code Snippets"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: php/admin-menus/class-import-menu.php:95
|
158 |
msgid "Import snippets from a code snippets export file"
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: php/admin-menus/class-import-menu.php:111
|
162 |
#, php-format
|
163 |
msgid ""
|
164 |
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
169 |
msgstr[0] ""
|
170 |
msgstr[1] ""
|
171 |
|
172 |
+
#: php/admin-menus/class-import-menu.php:123
|
173 |
msgid "An error occurred when processing the import file."
|
174 |
msgstr ""
|
175 |
|
180 |
|
181 |
#: php/admin-menus/class-manage-menu.php:23
|
182 |
#: php/admin-menus/class-manage-menu.php:45 php/class-admin.php:61
|
183 |
+
#: php/class-admin.php:150 php/views/manage.php:19
|
184 |
msgid "Snippets"
|
185 |
msgstr ""
|
186 |
|
198 |
msgstr ""
|
199 |
|
200 |
#: php/admin-menus/class-manage-menu.php:87
|
201 |
+
msgid "Snippet <strong>executed</strong>."
|
202 |
msgstr ""
|
203 |
|
204 |
#: php/admin-menus/class-manage-menu.php:88
|
205 |
+
msgid "Snippet <strong>activated</strong>."
|
206 |
msgstr ""
|
207 |
|
208 |
#: php/admin-menus/class-manage-menu.php:89
|
209 |
+
msgid "Selected snippets <strong>activated</strong>."
|
210 |
msgstr ""
|
211 |
|
212 |
#: php/admin-menus/class-manage-menu.php:90
|
213 |
+
msgid "Snippet <strong>deactivated</strong>."
|
214 |
msgstr ""
|
215 |
|
216 |
#: php/admin-menus/class-manage-menu.php:91
|
217 |
+
msgid "Selected snippets <strong>deactivated</strong>."
|
218 |
msgstr ""
|
219 |
|
220 |
#: php/admin-menus/class-manage-menu.php:92
|
221 |
+
msgid "Snippet <strong>deleted</strong>."
|
222 |
+
msgstr ""
|
223 |
+
|
224 |
+
#: php/admin-menus/class-manage-menu.php:93
|
225 |
msgid "Selected snippets <strong>deleted</strong>."
|
226 |
msgstr ""
|
227 |
|
234 |
msgid "Snippets Settings"
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: php/admin-menus/class-settings-menu.php:46
|
238 |
msgid "Settings"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: php/admin-menus/class-settings-menu.php:81 php/settings/settings.php:204
|
242 |
+
msgid "Settings saved."
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: php/class-admin.php:62
|
246 |
+
msgid "Snippets » Settings"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: php/class-admin.php:149
|
250 |
msgid "Manage your existing snippets"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: php/class-admin.php:180
|
254 |
msgid "Visit the WordPress.org plugin page"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: php/class-admin.php:181
|
258 |
msgid "About"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: php/class-admin.php:185
|
262 |
msgid "Visit the support forums"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: php/class-admin.php:186
|
266 |
msgid "Support"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: php/class-admin.php:190
|
270 |
msgid "Support this plugin's development"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: php/class-admin.php:191
|
274 |
msgid "Donate"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: php/class-admin.php:222
|
278 |
msgid ""
|
279 |
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
280 |
"answer a short survey on how you use this plugin and what you'd like to see "
|
281 |
"changed or added in the future."
|
282 |
msgstr ""
|
283 |
|
284 |
+
#: php/class-admin.php:226
|
285 |
msgid "Take the survey now"
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: php/class-admin.php:229
|
289 |
msgid "Dismiss"
|
290 |
msgstr ""
|
291 |
|
480 |
"<a href=\"%s\">Manage Snippets</a> page."
|
481 |
msgstr ""
|
482 |
|
483 |
+
#: php/class-export.php:89
|
484 |
msgid ""
|
485 |
"This is a code snippets export file generated by the Code Snippets WordPress "
|
486 |
"plugin."
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: php/class-export.php:91
|
490 |
msgid "To import these snippets a WordPress site follow these steps:"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: php/class-export.php:92
|
494 |
msgid "1. Log in to that site as an administrator."
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: php/class-export.php:93
|
498 |
msgid ""
|
499 |
"2. Install the Code Snippets plugin using the directions provided at the "
|
500 |
"above link."
|
501 |
msgstr ""
|
502 |
|
503 |
+
#: php/class-export.php:94
|
504 |
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
505 |
msgstr ""
|
506 |
|
507 |
+
#: php/class-export.php:95
|
508 |
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
509 |
msgstr ""
|
510 |
|
511 |
+
#: php/class-export.php:96
|
512 |
msgid "5. Upload this file using the form provided on that page."
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: php/class-export.php:97
|
516 |
msgid ""
|
517 |
"6. Code Snippets will then import all of the snippets and associated "
|
518 |
"information contained in this file into your site."
|
519 |
msgstr ""
|
520 |
|
521 |
+
#: php/class-export.php:98
|
522 |
msgid ""
|
523 |
"7. You will then have to visit the 'Snippets: All Snippets' admin menu and "
|
524 |
"activate desired snippets."
|
528 |
msgid "Snippets per page"
|
529 |
msgstr ""
|
530 |
|
531 |
+
#: php/class-list-table.php:121 php/class-list-table.php:409
|
532 |
msgid "Network Deactivate"
|
533 |
msgstr ""
|
534 |
|
535 |
+
#: php/class-list-table.php:121 php/class-list-table.php:205
|
536 |
+
#: php/class-list-table.php:409
|
537 |
msgid "Deactivate"
|
538 |
msgstr ""
|
539 |
|
540 |
+
#: php/class-list-table.php:131
|
541 |
+
msgid "Run Once"
|
542 |
+
msgstr ""
|
543 |
+
|
544 |
+
#: php/class-list-table.php:141 php/class-list-table.php:408
|
545 |
msgid "Network Activate"
|
546 |
msgstr ""
|
547 |
|
548 |
+
#: php/class-list-table.php:141 php/class-list-table.php:205
|
549 |
+
#: php/class-list-table.php:408
|
550 |
msgid "Activate"
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: php/class-list-table.php:151 php/class-list-table.php:221
|
554 |
msgid "Edit"
|
555 |
msgstr ""
|
556 |
|
557 |
+
#: php/class-list-table.php:157 php/class-list-table.php:227
|
558 |
+
#: php/class-list-table.php:411 php/views/edit.php:122
|
559 |
msgid "Export"
|
560 |
msgstr ""
|
561 |
|
562 |
+
#: php/class-list-table.php:166 php/class-list-table.php:239
|
563 |
+
#: php/class-list-table.php:412 php/views/edit.php:135
|
564 |
msgid "Delete"
|
565 |
msgstr ""
|
566 |
|
567 |
+
#: php/class-list-table.php:173 php/class-list-table.php:249
|
568 |
msgid "You are about to permanently delete the selected item."
|
569 |
msgstr ""
|
570 |
|
571 |
+
#: php/class-list-table.php:174 php/class-list-table.php:250
|
572 |
+
#: php/views/edit.php:130
|
573 |
msgid "'Cancel' to stop, 'OK' to delete."
|
574 |
msgstr ""
|
575 |
|
576 |
+
#: php/class-list-table.php:181
|
577 |
msgid "Network Active"
|
578 |
msgstr ""
|
579 |
|
580 |
+
#: php/class-list-table.php:183
|
581 |
msgid "Network Only"
|
582 |
msgstr ""
|
583 |
|
584 |
+
#: php/class-list-table.php:270
|
585 |
#, php-format
|
586 |
msgid "Untitled #%d"
|
587 |
msgstr ""
|
588 |
|
589 |
+
#: php/class-list-table.php:298
|
590 |
msgid "Shared on Network"
|
591 |
msgstr ""
|
592 |
|
593 |
+
#: php/class-list-table.php:361 php/views/edit.php:46
|
594 |
msgid "Name"
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: php/class-list-table.php:362
|
598 |
msgid "ID"
|
599 |
msgstr ""
|
600 |
|
601 |
+
#: php/class-list-table.php:410 php/views/edit.php:117
|
602 |
+
msgid "Download"
|
603 |
msgstr ""
|
604 |
|
605 |
+
#: php/class-list-table.php:450
|
606 |
#, php-format
|
607 |
msgid "All <span class=\"count\">(%s)</span>"
|
608 |
msgid_plural "All <span class=\"count\">(%s)</span>"
|
609 |
msgstr[0] ""
|
610 |
msgstr[1] ""
|
611 |
|
612 |
+
#: php/class-list-table.php:451
|
613 |
#, php-format
|
614 |
msgid "Active <span class=\"count\">(%s)</span>"
|
615 |
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
616 |
msgstr[0] ""
|
617 |
msgstr[1] ""
|
618 |
|
619 |
+
#: php/class-list-table.php:452
|
620 |
#, php-format
|
621 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
622 |
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
623 |
msgstr[0] ""
|
624 |
msgstr[1] ""
|
625 |
|
626 |
+
#: php/class-list-table.php:453
|
627 |
#, php-format
|
628 |
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
629 |
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
630 |
msgstr[0] ""
|
631 |
msgstr[1] ""
|
632 |
|
633 |
+
#: php/class-list-table.php:516
|
634 |
msgid "Show all tags"
|
635 |
msgstr ""
|
636 |
|
637 |
+
#: php/class-list-table.php:530
|
638 |
msgid "Filter"
|
639 |
msgstr ""
|
640 |
|
641 |
+
#: php/class-list-table.php:538
|
642 |
msgid "Clear List"
|
643 |
msgstr ""
|
644 |
|
645 |
+
#: php/class-list-table.php:729
|
646 |
msgid "Whoops, it looks like no snippets could be found."
|
647 |
msgstr ""
|
648 |
|
649 |
+
#: php/class-list-table.php:733
|
650 |
msgid "Perhaps you would like to add a new one?"
|
651 |
msgstr ""
|
652 |
|
653 |
+
#: php/class-list-table.php:1031
|
654 |
msgid "Search results"
|
655 |
msgstr ""
|
656 |
|
657 |
+
#: php/class-list-table.php:1034
|
658 |
#, php-format
|
659 |
msgid " for “%s”"
|
660 |
msgstr ""
|
661 |
|
662 |
+
#: php/class-list-table.php:1038
|
663 |
#, php-format
|
664 |
msgid " in tag “%s”"
|
665 |
msgstr ""
|
666 |
|
667 |
+
#: php/class-list-table.php:1046
|
668 |
msgid "Clear Filters"
|
669 |
msgstr ""
|
670 |
|
706 |
msgstr ""
|
707 |
|
708 |
#: php/settings/settings-fields.php:72
|
709 |
+
msgid ""
|
710 |
+
"Show network-wide snippets in the snippets table on subsites to super "
|
711 |
+
"administrators only"
|
712 |
msgstr ""
|
713 |
|
714 |
#: php/settings/settings-fields.php:77
|
805 |
msgid "Highlight all instances of a currently selected word."
|
806 |
msgstr ""
|
807 |
|
808 |
+
#: php/settings/settings.php:88
|
809 |
msgid "General"
|
810 |
msgstr ""
|
811 |
|
812 |
+
#: php/settings/settings.php:89
|
813 |
msgid "Description Editor"
|
814 |
msgstr ""
|
815 |
|
816 |
+
#: php/settings/settings.php:90
|
817 |
msgid "Code Editor"
|
818 |
msgstr ""
|
819 |
|
820 |
+
#: php/settings/settings.php:147
|
821 |
msgid "Editor Preview"
|
822 |
msgstr ""
|
823 |
|
824 |
+
#: php/views/edit.php:26 php/views/manage.php:22
|
|
|
|
|
|
|
|
|
825 |
msgctxt "snippet"
|
826 |
msgid "Add New"
|
827 |
msgstr ""
|
828 |
|
829 |
+
#: php/views/edit.php:47
|
830 |
msgid "Enter title here"
|
831 |
msgstr ""
|
832 |
|
833 |
+
#: php/views/edit.php:52
|
834 |
msgid "Code"
|
835 |
msgstr ""
|
836 |
|
837 |
+
#: php/views/edit.php:77
|
838 |
+
msgid "Save Changes and Execute Once"
|
839 |
+
msgstr ""
|
840 |
+
|
841 |
+
#: php/views/edit.php:86 php/views/edit.php:100
|
842 |
msgid "Save Changes and Activate"
|
843 |
msgstr ""
|
844 |
|
845 |
+
#: php/views/edit.php:106
|
846 |
msgid "Save Changes and Deactivate"
|
847 |
msgstr ""
|
848 |
|
849 |
+
#: php/views/edit.php:129
|
850 |
msgid "You are about to permanently delete this snippet."
|
851 |
msgstr ""
|
852 |
|
853 |
#: php/views/import.php:21
|
854 |
msgid ""
|
855 |
+
"Upload one or more Code Snippets export files and the snippets will be "
|
856 |
+
"imported."
|
857 |
msgstr ""
|
858 |
|
859 |
+
#: php/views/import.php:25
|
860 |
#, php-format
|
861 |
msgid ""
|
862 |
+
"Afterwards, you will need to go to the <a href=\"%s\">All Snippets</a> page "
|
863 |
+
"to activate the imported snippets."
|
864 |
msgstr ""
|
865 |
|
866 |
+
#: php/views/import.php:29
|
867 |
msgid ""
|
868 |
+
"Choose one or more Code Snippets (.xml or .json) files to upload, then click "
|
869 |
+
"\"Upload files and import\"."
|
870 |
msgstr ""
|
871 |
|
872 |
+
#: php/views/import.php:36
|
873 |
msgid "Choose a file from your computer:"
|
874 |
msgstr ""
|
875 |
|
876 |
+
#: php/views/import.php:37
|
877 |
msgid "(Maximum size: 8MB)"
|
878 |
msgstr ""
|
879 |
|
880 |
+
#: php/views/import.php:44
|
881 |
+
msgid ""
|
882 |
+
"What should happen if an existing snippet is found with an identical name to "
|
883 |
+
"an imported snippet?"
|
884 |
+
msgstr ""
|
885 |
+
|
886 |
+
#: php/views/import.php:50
|
887 |
+
msgid ""
|
888 |
+
"Ignore any duplicate snippets: import all snippets from the file regardless "
|
889 |
+
"and leave all existing snippets unchanged."
|
890 |
+
msgstr ""
|
891 |
+
|
892 |
+
#: php/views/import.php:57
|
893 |
+
msgid ""
|
894 |
+
"Replace any existing snippets with a newly imported snippet of the same name."
|
895 |
+
msgstr ""
|
896 |
+
|
897 |
+
#: php/views/import.php:64
|
898 |
+
msgid ""
|
899 |
+
"Do not import any duplicate snippets; leave all existing snippets unchanged."
|
900 |
+
msgstr ""
|
901 |
+
|
902 |
+
#: php/views/import.php:70
|
903 |
+
msgid "Upload files and import"
|
904 |
msgstr ""
|
905 |
|
906 |
#: php/views/manage.php:34
|
php/admin-menus/class-edit-menu.php
CHANGED
@@ -76,7 +76,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
76 |
add_action( 'code_snippets/admin/single', array( $this, 'render_scope_setting' ), 1 );
|
77 |
}
|
78 |
|
79 |
-
if (
|
80 |
add_action( 'code_snippets/admin/single', array( $this, 'render_multisite_sharing_setting' ), 1 );
|
81 |
}
|
82 |
|
@@ -93,7 +93,8 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
93 |
return;
|
94 |
}
|
95 |
|
96 |
-
if ( isset( $_POST['save_snippet'] ) || isset( $_POST['
|
|
|
97 |
$this->save_posted_snippet();
|
98 |
}
|
99 |
|
@@ -110,6 +111,11 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
110 |
if ( isset( $_POST['export_snippet'] ) ) {
|
111 |
export_snippets( $_POST['snippet_id'] );
|
112 |
}
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
}
|
115 |
|
@@ -203,10 +209,17 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
203 |
}
|
204 |
}
|
205 |
|
|
|
|
|
|
|
|
|
|
|
206 |
/* Activate or deactivate the snippet before saving if we clicked the button */
|
207 |
|
208 |
-
|
209 |
-
|
|
|
|
|
210 |
$snippet->active = 0;
|
211 |
unset( $_POST['save_snippet_activate'], $_POST['save_snippet_deactivate'] );
|
212 |
} elseif ( isset( $_POST['save_snippet_activate'] ) ) {
|
@@ -216,7 +229,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
216 |
}
|
217 |
|
218 |
/* Deactivate snippet if code contains errors */
|
219 |
-
if ( $snippet->active ) {
|
220 |
if ( $code_error = $this->validate_code( $snippet ) ) {
|
221 |
$snippet->active = 0;
|
222 |
}
|
@@ -226,7 +239,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
226 |
$snippet_id = save_snippet( $snippet );
|
227 |
|
228 |
/* Update the shared network snippets if necessary */
|
229 |
-
if ( $snippet_id &&
|
230 |
|
231 |
if ( isset( $_POST['snippet_sharing'] ) && 'on' === $_POST['snippet_sharing'] ) {
|
232 |
$shared_snippets = get_site_option( 'shared_network_snippets', array() );
|
@@ -265,6 +278,8 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
265 |
$result .= '-and-activated';
|
266 |
} elseif ( isset( $_POST['save_snippet_deactivate'] ) ) {
|
267 |
$result .= '-and-deactivated';
|
|
|
|
|
268 |
}
|
269 |
|
270 |
/* Redirect to edit snippet page */
|
@@ -341,20 +356,21 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
341 |
*/
|
342 |
function render_scope_setting( Code_Snippet $snippet ) {
|
343 |
|
344 |
-
$
|
345 |
-
__( 'Run snippet everywhere', 'code-snippets' ),
|
346 |
-
__( 'Only run in administration area', 'code-snippets' ),
|
347 |
-
__( 'Only run on site front-end', 'code-snippets' ),
|
348 |
-
);
|
349 |
|
350 |
-
$
|
|
|
|
|
|
|
|
|
|
|
351 |
|
352 |
-
echo '<h2 class="screen-reader-text">' .
|
353 |
|
354 |
-
foreach (
|
355 |
-
printf( '<label><input type="radio" name="snippet_scope" value="%
|
356 |
checked( $scope, $snippet->scope );
|
357 |
-
printf( '> <span class="dashicons dashicons
|
358 |
}
|
359 |
|
360 |
echo '</p>';
|
@@ -373,7 +389,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
373 |
<label for="snippet_sharing">
|
374 |
<input type="checkbox" name="snippet_sharing"
|
375 |
<?php checked( in_array( $snippet->id, $shared_snippets ) ); ?>>
|
376 |
-
<?php
|
377 |
</label>
|
378 |
</div>
|
379 |
|
@@ -453,6 +469,7 @@ class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
|
453 |
'added' => __( 'Snippet <strong>added</strong>.', 'code-snippets' ),
|
454 |
'updated' => __( 'Snippet <strong>updated</strong>.', 'code-snippets' ),
|
455 |
'added-and-activated' => __( 'Snippet <strong>added</strong> and <strong>activated</strong>.', 'code-snippets' ),
|
|
|
456 |
'updated-and-activated' => __( 'Snippet <strong>updated</strong> and <strong>activated</strong>.', 'code-snippets' ),
|
457 |
'updated-and-deactivated' => __( 'Snippet <strong>updated</strong> and <strong>deactivated</strong>.', 'code-snippets' ),
|
458 |
);
|
76 |
add_action( 'code_snippets/admin/single', array( $this, 'render_scope_setting' ), 1 );
|
77 |
}
|
78 |
|
79 |
+
if ( is_network_admin() ) {
|
80 |
add_action( 'code_snippets/admin/single', array( $this, 'render_multisite_sharing_setting' ), 1 );
|
81 |
}
|
82 |
|
93 |
return;
|
94 |
}
|
95 |
|
96 |
+
if ( isset( $_POST['save_snippet'] ) || isset( $_POST['save_snippet_execute'] ) ||
|
97 |
+
isset( $_POST['save_snippet_activate'] ) || isset( $_POST['save_snippet_deactivate'] ) ) {
|
98 |
$this->save_posted_snippet();
|
99 |
}
|
100 |
|
111 |
if ( isset( $_POST['export_snippet'] ) ) {
|
112 |
export_snippets( $_POST['snippet_id'] );
|
113 |
}
|
114 |
+
|
115 |
+
/* Download the snippet if the button was clicked */
|
116 |
+
if ( isset( $_POST['download_snippet'] ) ) {
|
117 |
+
export_snippets( $_POST['snippet_id'], null, 'php' );
|
118 |
+
}
|
119 |
}
|
120 |
}
|
121 |
|
209 |
}
|
210 |
}
|
211 |
|
212 |
+
if ( isset( $_POST['save_snippet_execute'] ) && 'single-use' !== $snippet->scope ) {
|
213 |
+
unset( $_POST['save_snippet_execute'] );
|
214 |
+
$_POST['save_snippet'] = 'yes';
|
215 |
+
}
|
216 |
+
|
217 |
/* Activate or deactivate the snippet before saving if we clicked the button */
|
218 |
|
219 |
+
if ( isset( $_POST['save_snippet_execute'] ) ) {
|
220 |
+
$snippet->active = 1;
|
221 |
+
} elseif ( isset( $_POST['snippet_sharing'] ) && 'on' === $_POST['snippet_sharing'] ) {
|
222 |
+
// Shared network snippets cannot be network activated
|
223 |
$snippet->active = 0;
|
224 |
unset( $_POST['save_snippet_activate'], $_POST['save_snippet_deactivate'] );
|
225 |
} elseif ( isset( $_POST['save_snippet_activate'] ) ) {
|
229 |
}
|
230 |
|
231 |
/* Deactivate snippet if code contains errors */
|
232 |
+
if ( $snippet->active && 'single-use' !== $snippet->scope ) {
|
233 |
if ( $code_error = $this->validate_code( $snippet ) ) {
|
234 |
$snippet->active = 0;
|
235 |
}
|
239 |
$snippet_id = save_snippet( $snippet );
|
240 |
|
241 |
/* Update the shared network snippets if necessary */
|
242 |
+
if ( $snippet_id && is_network_admin() ) {
|
243 |
|
244 |
if ( isset( $_POST['snippet_sharing'] ) && 'on' === $_POST['snippet_sharing'] ) {
|
245 |
$shared_snippets = get_site_option( 'shared_network_snippets', array() );
|
278 |
$result .= '-and-activated';
|
279 |
} elseif ( isset( $_POST['save_snippet_deactivate'] ) ) {
|
280 |
$result .= '-and-deactivated';
|
281 |
+
} elseif ( isset( $_POST['save_snippet_execute'] ) ) {
|
282 |
+
$result .= '-and-executed';
|
283 |
}
|
284 |
|
285 |
/* Redirect to edit snippet page */
|
356 |
*/
|
357 |
function render_scope_setting( Code_Snippet $snippet ) {
|
358 |
|
359 |
+
$icons = Code_Snippet::get_scope_icons();
|
|
|
|
|
|
|
|
|
360 |
|
361 |
+
$labels = array(
|
362 |
+
'global' => __( 'Run snippet everywhere', 'code-snippets' ),
|
363 |
+
'admin' => __( 'Only run in administration area', 'code-snippets' ),
|
364 |
+
'front-end' => __( 'Only run on site front-end', 'code-snippets' ),
|
365 |
+
'single-use' => __( 'Only run once', 'code-snippets' ),
|
366 |
+
);
|
367 |
|
368 |
+
echo '<h2 class="screen-reader-text">' . esc_html__( 'Scope', 'code-snippets' ) . '</h2><p class="snippet-scope">';
|
369 |
|
370 |
+
foreach ( Code_Snippet::get_all_scopes() as $scope ) {
|
371 |
+
printf( '<label><input type="radio" name="snippet_scope" value="%s"', $scope );
|
372 |
checked( $scope, $snippet->scope );
|
373 |
+
printf( '> <span class="dashicons dashicons-%s"></span> %s</label>', $icons[ $scope ], esc_html( $labels[ $scope ] ) );
|
374 |
}
|
375 |
|
376 |
echo '</p>';
|
389 |
<label for="snippet_sharing">
|
390 |
<input type="checkbox" name="snippet_sharing"
|
391 |
<?php checked( in_array( $snippet->id, $shared_snippets ) ); ?>>
|
392 |
+
<?php esc_html_e( 'Allow this snippet to be activated on individual sites on the network', 'code-snippets' ); ?>
|
393 |
</label>
|
394 |
</div>
|
395 |
|
469 |
'added' => __( 'Snippet <strong>added</strong>.', 'code-snippets' ),
|
470 |
'updated' => __( 'Snippet <strong>updated</strong>.', 'code-snippets' ),
|
471 |
'added-and-activated' => __( 'Snippet <strong>added</strong> and <strong>activated</strong>.', 'code-snippets' ),
|
472 |
+
'updated-and-executed' => __( 'Snippet <strong>added</strong> and <strong>executed</strong>.', 'code-snippets' ),
|
473 |
'updated-and-activated' => __( 'Snippet <strong>updated</strong> and <strong>activated</strong>.', 'code-snippets' ),
|
474 |
'updated-and-deactivated' => __( 'Snippet <strong>updated</strong> and <strong>deactivated</strong>.', 'code-snippets' ),
|
475 |
);
|
php/admin-menus/class-import-menu.php
CHANGED
@@ -35,35 +35,45 @@ class Code_Snippets_Import_Menu extends Code_Snippets_Admin_Menu {
|
|
35 |
$contextual_help = new Code_Snippets_Contextual_Help( 'import' );
|
36 |
$contextual_help->load();
|
37 |
|
38 |
-
$this->
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
-
* Process the uploaded import
|
43 |
*
|
44 |
* @uses import_snippets() to process the import file
|
45 |
* @uses wp_redirect() to pass the import results to the page
|
46 |
* @uses add_query_arg() to append the results to the current URI
|
47 |
*/
|
48 |
-
private function
|
49 |
|
50 |
/* Ensure the import file exists */
|
51 |
-
if ( ! isset( $_FILES['
|
52 |
return;
|
53 |
}
|
54 |
|
55 |
-
$
|
|
|
|
|
56 |
|
57 |
-
/*
|
58 |
-
$result = import_snippets( $_FILES['code_snippets_import_file']['tmp_name'], $network );
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
$result ?
|
63 |
-
array( 'imported' => count( $result ) ) :
|
64 |
-
array( 'error' => true )
|
65 |
-
);
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
wp_redirect( esc_url_raw( $url ) );
|
68 |
exit;
|
69 |
}
|
@@ -94,14 +104,15 @@ class Code_Snippets_Import_Menu extends Code_Snippets_Admin_Menu {
|
|
94 |
if ( isset( $_REQUEST['imported'] ) ) {
|
95 |
echo '<div id="message" class="updated fade"><p>';
|
96 |
|
|
|
|
|
97 |
printf(
|
98 |
_n(
|
99 |
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
|
100 |
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
|
101 |
-
|
102 |
-
'code-snippets'
|
103 |
),
|
104 |
-
$
|
105 |
code_snippets()->get_menu_url( 'manage' )
|
106 |
);
|
107 |
|
35 |
$contextual_help = new Code_Snippets_Contextual_Help( 'import' );
|
36 |
$contextual_help->load();
|
37 |
|
38 |
+
$this->process_import_files();
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
+
* Process the uploaded import files
|
43 |
*
|
44 |
* @uses import_snippets() to process the import file
|
45 |
* @uses wp_redirect() to pass the import results to the page
|
46 |
* @uses add_query_arg() to append the results to the current URI
|
47 |
*/
|
48 |
+
private function process_import_files() {
|
49 |
|
50 |
/* Ensure the import file exists */
|
51 |
+
if ( ! isset( $_FILES['code_snippets_import_files'] ) || ! count( $_FILES['code_snippets_import_files'] ) ) {
|
52 |
return;
|
53 |
}
|
54 |
|
55 |
+
$count = 0;
|
56 |
+
$network = is_network_admin();
|
57 |
+
$dup_action = isset( $_POST['duplicate_action'] ) ? $_POST['duplicate_action'] : 'ignore';
|
58 |
|
59 |
+
/* Loop through the uploaded files and import the snippets */
|
|
|
60 |
|
61 |
+
foreach ( $_FILES['code_snippets_import_files']['tmp_name'] as $i => $import_file ) {
|
62 |
+
$file_type = $_FILES['code_snippets_import_files']['type'][ $i ];
|
|
|
|
|
|
|
|
|
63 |
|
64 |
+
if ( 'application/json' === $file_type ) {
|
65 |
+
$result = import_snippets_json( $import_file, $network, $dup_action );
|
66 |
+
} elseif ( 'text/xml' === $file_type ) {
|
67 |
+
$result = import_snippets_xml( $import_file, $network, $dup_action );
|
68 |
+
} else {
|
69 |
+
continue;
|
70 |
+
}
|
71 |
+
|
72 |
+
$count += count( $result );
|
73 |
+
}
|
74 |
+
|
75 |
+
/* Send the amount of imported snippets to the page */
|
76 |
+
$url = add_query_arg( $count > 0 ? array( 'imported' => $count ) : array( 'error' => true ) );
|
77 |
wp_redirect( esc_url_raw( $url ) );
|
78 |
exit;
|
79 |
}
|
104 |
if ( isset( $_REQUEST['imported'] ) ) {
|
105 |
echo '<div id="message" class="updated fade"><p>';
|
106 |
|
107 |
+
$imported = intval( $_REQUEST['imported'] );
|
108 |
+
|
109 |
printf(
|
110 |
_n(
|
111 |
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
|
112 |
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
|
113 |
+
$imported, 'code-snippets'
|
|
|
114 |
),
|
115 |
+
$imported,
|
116 |
code_snippets()->get_menu_url( 'manage' )
|
117 |
);
|
118 |
|
php/admin-menus/class-manage-menu.php
CHANGED
@@ -84,6 +84,7 @@ class Code_Snippets_Manage_Menu extends Code_Snippets_Admin_Menu {
|
|
84 |
|
85 |
echo $this->get_result_message(
|
86 |
array(
|
|
|
87 |
'activated' => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
|
88 |
'activated-multi' => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
|
89 |
'deactivated' => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
|
84 |
|
85 |
echo $this->get_result_message(
|
86 |
array(
|
87 |
+
'executed' => __( 'Snippet <strong>executed</strong>.', 'code-snippets' ),
|
88 |
'activated' => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
|
89 |
'activated-multi' => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
|
90 |
'deactivated' => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
|
php/admin-menus/class-settings-menu.php
CHANGED
@@ -25,8 +25,13 @@ class Code_Snippets_Settings_Menu extends Code_Snippets_Admin_Menu {
|
|
25 |
parent::load();
|
26 |
|
27 |
if ( is_network_admin() ) {
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
}
|
32 |
|
@@ -34,13 +39,15 @@ class Code_Snippets_Settings_Menu extends Code_Snippets_Admin_Menu {
|
|
34 |
* Render the admin screen
|
35 |
*/
|
36 |
function render() {
|
|
|
|
|
37 |
?>
|
38 |
<div class="wrap">
|
39 |
<h1><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h1>
|
40 |
|
41 |
<?php settings_errors( 'code-snippets-settings-notices' ); ?>
|
42 |
|
43 |
-
<form action="<?php echo esc_url(
|
44 |
<?php
|
45 |
|
46 |
settings_fields( 'code-snippets' );
|
@@ -52,4 +59,32 @@ class Code_Snippets_Settings_Menu extends Code_Snippets_Admin_Menu {
|
|
52 |
</div>
|
53 |
<?php
|
54 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
25 |
parent::load();
|
26 |
|
27 |
if ( is_network_admin() ) {
|
28 |
+
|
29 |
+
if ( code_snippets_unified_settings() ) {
|
30 |
+
$this->update_network_options();
|
31 |
+
} else {
|
32 |
+
wp_redirect( code_snippets()->get_menu_url( 'settings', 'admin' ) );
|
33 |
+
exit;
|
34 |
+
}
|
35 |
}
|
36 |
}
|
37 |
|
39 |
* Render the admin screen
|
40 |
*/
|
41 |
function render() {
|
42 |
+
$update_url = is_network_admin() ? add_query_arg( 'update_site_option', true ) : admin_url( 'options.php' );
|
43 |
+
|
44 |
?>
|
45 |
<div class="wrap">
|
46 |
<h1><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h1>
|
47 |
|
48 |
<?php settings_errors( 'code-snippets-settings-notices' ); ?>
|
49 |
|
50 |
+
<form action="<?php echo esc_url( $update_url ); ?>" method="post">
|
51 |
<?php
|
52 |
|
53 |
settings_fields( 'code-snippets' );
|
59 |
</div>
|
60 |
<?php
|
61 |
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Fill in for the Settings API in the Network Admin
|
65 |
+
*/
|
66 |
+
function update_network_options() {
|
67 |
+
|
68 |
+
/* Ensure the settings have been saved */
|
69 |
+
if ( ! isset( $_GET['update_site_option'], $_POST['code_snippets_settings'] ) || ! $_GET['update_site_option'] ) {
|
70 |
+
return;
|
71 |
+
}
|
72 |
+
|
73 |
+
check_admin_referer( 'code-snippets-options' );
|
74 |
+
|
75 |
+
/* Retrieve the saved options and save them to the database */
|
76 |
+
$value = wp_unslash( $_POST['code_snippets_settings'] );
|
77 |
+
update_site_option( 'code_snippets_settings', $value );
|
78 |
+
|
79 |
+
/* Add an updated notice */
|
80 |
+
if ( ! count( get_settings_errors() ) ) {
|
81 |
+
add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'updated' );
|
82 |
+
}
|
83 |
+
set_transient( 'settings_errors', get_settings_errors(), 30 );
|
84 |
+
|
85 |
+
/* Redirect back to the settings menu */
|
86 |
+
$goback = add_query_arg( 'settings-updated', 'true', remove_query_arg( 'update_site_option', wp_get_referer() ) );
|
87 |
+
wp_redirect( $goback );
|
88 |
+
exit;
|
89 |
+
}
|
90 |
}
|
php/class-admin.php
CHANGED
@@ -21,7 +21,7 @@ class Code_Snippets_Admin {
|
|
21 |
$this->menus['edit'] = new Code_Snippets_Edit_Menu();
|
22 |
$this->menus['import'] = new Code_Snippets_Import_Menu();
|
23 |
|
24 |
-
if (
|
25 |
$this->menus['settings'] = new Code_Snippets_Settings_Menu();
|
26 |
}
|
27 |
|
@@ -59,6 +59,7 @@ class Code_Snippets_Admin {
|
|
59 |
*/
|
60 |
function mu_menu_items( $menu_items ) {
|
61 |
$menu_items['snippets'] = __( 'Snippets', 'code-snippets' );
|
|
|
62 |
return $menu_items;
|
63 |
}
|
64 |
|
21 |
$this->menus['edit'] = new Code_Snippets_Edit_Menu();
|
22 |
$this->menus['import'] = new Code_Snippets_Import_Menu();
|
23 |
|
24 |
+
if ( is_network_admin() === code_snippets_unified_settings() ) {
|
25 |
$this->menus['settings'] = new Code_Snippets_Settings_Menu();
|
26 |
}
|
27 |
|
59 |
*/
|
60 |
function mu_menu_items( $menu_items ) {
|
61 |
$menu_items['snippets'] = __( 'Snippets', 'code-snippets' );
|
62 |
+
$menu_items['snippets_settings'] = __( 'Snippets » Settings', 'code-snippets' );
|
63 |
return $menu_items;
|
64 |
}
|
65 |
|
php/class-db.php
CHANGED
@@ -54,8 +54,8 @@ class Code_Snippets_DB {
|
|
54 |
}
|
55 |
|
56 |
/* If $multisite is null, try to base it on the current admin page */
|
57 |
-
if ( is_null( $network ) && function_exists( '
|
58 |
-
$network =
|
59 |
}
|
60 |
|
61 |
return $network;
|
@@ -130,13 +130,13 @@ class Code_Snippets_DB {
|
|
130 |
|
131 |
/* Create the database table */
|
132 |
$sql = "CREATE TABLE $table_name (
|
133 |
-
id bigint(20)
|
134 |
-
name tinytext
|
135 |
-
description text
|
136 |
-
code longtext
|
137 |
-
tags longtext
|
138 |
-
scope
|
139 |
-
active tinyint(1)
|
140 |
PRIMARY KEY (id)
|
141 |
) $charset_collate;";
|
142 |
|
54 |
}
|
55 |
|
56 |
/* If $multisite is null, try to base it on the current admin page */
|
57 |
+
if ( is_null( $network ) && function_exists( 'is_network_admin' ) ) {
|
58 |
+
$network = is_network_admin();
|
59 |
}
|
60 |
|
61 |
return $network;
|
130 |
|
131 |
/* Create the database table */
|
132 |
$sql = "CREATE TABLE $table_name (
|
133 |
+
id bigint(20) NOT NULL AUTO_INCREMENT,
|
134 |
+
name tinytext NOT NULL default '',
|
135 |
+
description text NOT NULL default '',
|
136 |
+
code longtext NOT NULL default '',
|
137 |
+
tags longtext NOT NULL default '',
|
138 |
+
scope varchar(15) NOT NULL default 'global',
|
139 |
+
active tinyint(1) NOT NULL default 0,
|
140 |
PRIMARY KEY (id)
|
141 |
) $charset_collate;";
|
142 |
|
php/class-export.php
CHANGED
@@ -44,6 +44,8 @@ class Code_Snippets_Export {
|
|
44 |
*/
|
45 |
protected $root;
|
46 |
|
|
|
|
|
47 |
/**
|
48 |
* Constructor function
|
49 |
*
|
@@ -51,10 +53,10 @@ class Code_Snippets_Export {
|
|
51 |
* @param string $table The name of the table to fetch snippets from
|
52 |
* @param string $format The format of the export file
|
53 |
*/
|
54 |
-
public function __construct( $ids, $table, $format = '
|
55 |
$this->snippet_ids = (array) $ids;
|
56 |
$this->table_name = $table;
|
57 |
-
$this->format =
|
58 |
}
|
59 |
|
60 |
/**
|
@@ -118,11 +120,26 @@ class Code_Snippets_Export {
|
|
118 |
$this->dom->appendChild( $gen );
|
119 |
}
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
/**
|
122 |
* Process all snippet items
|
123 |
*/
|
124 |
protected function do_items() {
|
125 |
-
global $wpdb;
|
126 |
|
127 |
if ( 'xml' === $this->format ) {
|
128 |
|
@@ -132,17 +149,13 @@ class Code_Snippets_Export {
|
|
132 |
}
|
133 |
|
134 |
/* Loop through the snippets */
|
135 |
-
foreach ( $this->
|
136 |
-
|
137 |
-
/* Grab the snippet from the database */
|
138 |
-
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $id ), ARRAY_A );
|
139 |
-
$snippet = new Code_Snippet( $snippet );
|
140 |
|
141 |
/* Process the snippet item */
|
142 |
if ( 'php' === $this->format ) {
|
143 |
$this->do_item_php( $snippet );
|
144 |
} else {
|
145 |
-
$this->
|
146 |
}
|
147 |
}
|
148 |
}
|
@@ -152,7 +165,7 @@ class Code_Snippets_Export {
|
|
152 |
*
|
153 |
* @param Code_Snippet $snippet
|
154 |
*/
|
155 |
-
protected function
|
156 |
$item_element = $this->dom->createElement( 'snippet' );
|
157 |
$item = $this->root->appendChild( $item_element );
|
158 |
|
@@ -210,6 +223,43 @@ class Code_Snippets_Export {
|
|
210 |
$filename = $this->get_filename();
|
211 |
header( 'Content-Disposition: attachment; filename=' . $filename );
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
if ( 'xml' === $this->format ) {
|
214 |
|
215 |
/* Set the HTTP content type header */
|
@@ -224,7 +274,7 @@ class Code_Snippets_Export {
|
|
224 |
}
|
225 |
|
226 |
elseif ( 'php' === $this->format ) {
|
227 |
-
echo
|
228 |
}
|
229 |
|
230 |
/* Process the snippet items */
|
44 |
*/
|
45 |
protected $root;
|
46 |
|
47 |
+
public static $supported_formats = array( 'json', 'xml', 'php' );
|
48 |
+
|
49 |
/**
|
50 |
* Constructor function
|
51 |
*
|
53 |
* @param string $table The name of the table to fetch snippets from
|
54 |
* @param string $format The format of the export file
|
55 |
*/
|
56 |
+
public function __construct( $ids, $table, $format = 'json' ) {
|
57 |
$this->snippet_ids = (array) $ids;
|
58 |
$this->table_name = $table;
|
59 |
+
$this->format = in_array( $format, self::$supported_formats ) ? $format : 'json';
|
60 |
}
|
61 |
|
62 |
/**
|
120 |
$this->dom->appendChild( $gen );
|
121 |
}
|
122 |
|
123 |
+
protected function get_snippets() {
|
124 |
+
global $wpdb;
|
125 |
+
|
126 |
+
$snippets = array();
|
127 |
+
|
128 |
+
foreach ( $this->snippet_ids as $id ) {
|
129 |
+
/* Grab the snippet from the database */
|
130 |
+
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $id ), ARRAY_A );
|
131 |
+
$snippet = new Code_Snippet( $snippet );
|
132 |
+
|
133 |
+
$snippets[] = $snippet;
|
134 |
+
}
|
135 |
+
|
136 |
+
return $snippets;
|
137 |
+
}
|
138 |
+
|
139 |
/**
|
140 |
* Process all snippet items
|
141 |
*/
|
142 |
protected function do_items() {
|
|
|
143 |
|
144 |
if ( 'xml' === $this->format ) {
|
145 |
|
149 |
}
|
150 |
|
151 |
/* Loop through the snippets */
|
152 |
+
foreach ( $this->get_snippets() as $snippet ) {
|
|
|
|
|
|
|
|
|
153 |
|
154 |
/* Process the snippet item */
|
155 |
if ( 'php' === $this->format ) {
|
156 |
$this->do_item_php( $snippet );
|
157 |
} else {
|
158 |
+
$this->do_item_xml( $snippet );
|
159 |
}
|
160 |
}
|
161 |
}
|
165 |
*
|
166 |
* @param Code_Snippet $snippet
|
167 |
*/
|
168 |
+
protected function do_item_xml( Code_Snippet $snippet ) {
|
169 |
$item_element = $this->dom->createElement( 'snippet' );
|
170 |
$item = $this->root->appendChild( $item_element );
|
171 |
|
223 |
$filename = $this->get_filename();
|
224 |
header( 'Content-Disposition: attachment; filename=' . $filename );
|
225 |
|
226 |
+
if ( 'json' === $this->format ) {
|
227 |
+
global $wpdb;
|
228 |
+
|
229 |
+
/* Set the HTTP content type header */
|
230 |
+
header( 'Content-Type: application/json; charset=' . get_bloginfo( 'charset' ) );
|
231 |
+
|
232 |
+
$snippets = array();
|
233 |
+
|
234 |
+
foreach ( $this->snippet_ids as $id ) {
|
235 |
+
/* Grab the snippet from the database */
|
236 |
+
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $id ), ARRAY_A );
|
237 |
+
$snippet = new Code_Snippet( $snippet );
|
238 |
+
|
239 |
+
$fields = array( 'name', 'desc', 'tags', 'scope', 'code' );
|
240 |
+
$final_snippet = array();
|
241 |
+
|
242 |
+
foreach ( $fields as $field ) {
|
243 |
+
if ( ! empty( $snippet->$field ) ) {
|
244 |
+
$final_snippet[ $field ] = $snippet->$field;
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
if ( $final_snippet ) {
|
249 |
+
$snippets[] = $final_snippet;
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
$data = array(
|
254 |
+
'generator' => 'Code Snippets v' . CODE_SNIPPETS_VERSION,
|
255 |
+
'date_created' => date( 'Y-m-d H:i' ),
|
256 |
+
'snippets' => $snippets,
|
257 |
+
);
|
258 |
+
|
259 |
+
echo json_encode( $data, apply_filters( 'code_snippets/export/json_encode_options', 0 ) );
|
260 |
+
exit;
|
261 |
+
}
|
262 |
+
|
263 |
if ( 'xml' === $this->format ) {
|
264 |
|
265 |
/* Set the HTTP content type header */
|
274 |
}
|
275 |
|
276 |
elseif ( 'php' === $this->format ) {
|
277 |
+
echo "<?php\n";
|
278 |
}
|
279 |
|
280 |
/* Process the snippet items */
|
php/class-list-table.php
CHANGED
@@ -38,7 +38,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
38 |
public function __construct() {
|
39 |
global $status, $page;
|
40 |
$screen = get_current_screen();
|
41 |
-
$this->is_network =
|
42 |
|
43 |
/* Determine the status */
|
44 |
$status = 'all';
|
@@ -124,6 +124,17 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
124 |
'id' => $snippet->id,
|
125 |
) ) )
|
126 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
} else {
|
128 |
$actions['activate'] = sprintf(
|
129 |
$link_format,
|
@@ -201,7 +212,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
201 |
}
|
202 |
|
203 |
/* Don't add Edit/Export/Delete actions for if current user can't manage network snippets */
|
204 |
-
if ( ! current_user_can(
|
205 |
return $actions;
|
206 |
}
|
207 |
|
@@ -262,22 +273,27 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
262 |
apply_filters( 'code_snippets/list_table/row_actions_always_visible', true )
|
263 |
);
|
264 |
|
265 |
-
$out =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
/* Add a link to the snippet if it isn't an unreadable network-only snippet */
|
268 |
if ( $this->is_network || ! $snippet->network || current_user_can( code_snippets()->get_network_cap_name() ) ) {
|
269 |
|
270 |
$out = sprintf(
|
271 |
-
'<a href="%s"
|
272 |
code_snippets()->get_snippet_edit_url( $snippet->id, $snippet->network ? 'network' : 'admin' ),
|
273 |
$out
|
274 |
);
|
275 |
}
|
276 |
|
277 |
-
if ( $snippet->shared_network && ! current_user_can( apply_filters( 'code_snippets_network_cap', 'manage_network_snippets' ) ) ) {
|
278 |
-
$out = sprintf( '<a><strong>%s</strong></a>', esc_html( $title ) );
|
279 |
-
}
|
280 |
-
|
281 |
if ( $snippet->shared_network ) {
|
282 |
$out .= ' <span class="badge">' . esc_html__( 'Shared on Network', 'code-snippets' ) . '</span>';
|
283 |
}
|
@@ -391,9 +407,9 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
391 |
$actions = array(
|
392 |
'activate-selected' => $this->is_network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
|
393 |
'deactivate-selected' => $this->is_network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
|
394 |
-
'
|
395 |
-
'
|
396 |
-
'
|
397 |
);
|
398 |
return apply_filters( 'code_snippets/list_table/bulk_actions', $actions );
|
399 |
}
|
@@ -592,6 +608,10 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
592 |
activate_snippet( $id, $this->is_network );
|
593 |
$result = 'activated';
|
594 |
}
|
|
|
|
|
|
|
|
|
595 |
elseif ( 'deactivate' === $action ) {
|
596 |
deactivate_snippet( $id, $this->is_network );
|
597 |
$result = 'deactivated';
|
@@ -619,7 +639,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
619 |
elseif ( 'export' === $action ) {
|
620 |
export_snippets( array( $id ), $this->is_network );
|
621 |
}
|
622 |
-
elseif ( '
|
623 |
export_snippets( array( $id ), $this->is_network, 'php' );
|
624 |
}
|
625 |
|
@@ -681,7 +701,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
681 |
export_snippets( $ids, $this->is_network );
|
682 |
break;
|
683 |
|
684 |
-
case '
|
685 |
export_snippets( $ids, $this->is_network, 'php' );
|
686 |
break;
|
687 |
|
@@ -781,7 +801,8 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
781 |
$snippets = array_fill_keys( $this->statuses, array() );
|
782 |
|
783 |
/* Fetch all snippets */
|
784 |
-
if ( is_multisite() && ! $this->is_network &&
|
|
|
785 |
$network_snippets = get_snippets( array(), true );
|
786 |
$network_snippets = array_filter( $network_snippets, array( $this, 'exclude_shared_network_snippets' ) );
|
787 |
|
@@ -807,8 +828,8 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
807 |
if ( code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
808 |
foreach ( $snippets['all'] as $snippet ) {
|
809 |
|
810 |
-
if (
|
811 |
-
$snippet->tags = array_merge( $snippet->tags, array( $snippet->
|
812 |
}
|
813 |
}
|
814 |
}
|
@@ -1036,7 +1057,7 @@ class Code_Snippets_List_Table extends WP_List_Table {
|
|
1036 |
$row_class = ( $snippet->active ? 'active' : 'inactive' );
|
1037 |
|
1038 |
if ( code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
1039 |
-
$row_class .= sprintf( ' %s-scope', $snippet->
|
1040 |
}
|
1041 |
|
1042 |
if ( $snippet->shared_network ) {
|
38 |
public function __construct() {
|
39 |
global $status, $page;
|
40 |
$screen = get_current_screen();
|
41 |
+
$this->is_network = is_network_admin();
|
42 |
|
43 |
/* Determine the status */
|
44 |
$status = 'all';
|
124 |
'id' => $snippet->id,
|
125 |
) ) )
|
126 |
);
|
127 |
+
} elseif ( 'single-use' === $snippet->scope ) {
|
128 |
+
|
129 |
+
$actions['run_once'] = sprintf(
|
130 |
+
$link_format,
|
131 |
+
esc_html__( 'Run Once', 'code-snippets' ),
|
132 |
+
esc_url( add_query_arg( array(
|
133 |
+
'action' => 'run-once',
|
134 |
+
'id' => $snippet->id,
|
135 |
+
) ) )
|
136 |
+
);
|
137 |
+
|
138 |
} else {
|
139 |
$actions['activate'] = sprintf(
|
140 |
$link_format,
|
212 |
}
|
213 |
|
214 |
/* Don't add Edit/Export/Delete actions for if current user can't manage network snippets */
|
215 |
+
if ( ! current_user_can( code_snippets()->get_network_cap_name() ) ) {
|
216 |
return $actions;
|
217 |
}
|
218 |
|
273 |
apply_filters( 'code_snippets/list_table/row_actions_always_visible', true )
|
274 |
);
|
275 |
|
276 |
+
$out = esc_html( $title );
|
277 |
+
|
278 |
+
if ( 'global' !== $snippet->scope ) {
|
279 |
+
$out .= ' <span class="dashicons dashicons-' . $snippet->scope_icon . '"></span>';
|
280 |
+
}
|
281 |
+
|
282 |
+
/* Only bold active snippets */
|
283 |
+
if ( $snippet->active ) {
|
284 |
+
$out = sprintf( '<strong>%s</strong>', $out );
|
285 |
+
}
|
286 |
|
287 |
/* Add a link to the snippet if it isn't an unreadable network-only snippet */
|
288 |
if ( $this->is_network || ! $snippet->network || current_user_can( code_snippets()->get_network_cap_name() ) ) {
|
289 |
|
290 |
$out = sprintf(
|
291 |
+
'<a href="%s">%s</a>',
|
292 |
code_snippets()->get_snippet_edit_url( $snippet->id, $snippet->network ? 'network' : 'admin' ),
|
293 |
$out
|
294 |
);
|
295 |
}
|
296 |
|
|
|
|
|
|
|
|
|
297 |
if ( $snippet->shared_network ) {
|
298 |
$out .= ' <span class="badge">' . esc_html__( 'Shared on Network', 'code-snippets' ) . '</span>';
|
299 |
}
|
407 |
$actions = array(
|
408 |
'activate-selected' => $this->is_network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
|
409 |
'deactivate-selected' => $this->is_network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
|
410 |
+
'download-selected' => __( 'Download', 'code-snippets' ),
|
411 |
+
'export-selected' => __( 'Export', 'code-snippets' ),
|
412 |
+
'delete-selected' => __( 'Delete', 'code-snippets' ),
|
413 |
);
|
414 |
return apply_filters( 'code_snippets/list_table/bulk_actions', $actions );
|
415 |
}
|
608 |
activate_snippet( $id, $this->is_network );
|
609 |
$result = 'activated';
|
610 |
}
|
611 |
+
elseif ( 'run-once' === $action ) {
|
612 |
+
activate_snippet( $id, $this->is_network );
|
613 |
+
$result = 'executed';
|
614 |
+
}
|
615 |
elseif ( 'deactivate' === $action ) {
|
616 |
deactivate_snippet( $id, $this->is_network );
|
617 |
$result = 'deactivated';
|
639 |
elseif ( 'export' === $action ) {
|
640 |
export_snippets( array( $id ), $this->is_network );
|
641 |
}
|
642 |
+
elseif ( 'download' === $action ) {
|
643 |
export_snippets( array( $id ), $this->is_network, 'php' );
|
644 |
}
|
645 |
|
701 |
export_snippets( $ids, $this->is_network );
|
702 |
break;
|
703 |
|
704 |
+
case 'download-selected':
|
705 |
export_snippets( $ids, $this->is_network, 'php' );
|
706 |
break;
|
707 |
|
801 |
$snippets = array_fill_keys( $this->statuses, array() );
|
802 |
|
803 |
/* Fetch all snippets */
|
804 |
+
if ( is_multisite() && ! $this->is_network && current_user_can( code_snippets()->get_network_cap_name() ) &&
|
805 |
+
code_snippets_get_setting( 'general', 'show_network_snippets' ) ) {
|
806 |
$network_snippets = get_snippets( array(), true );
|
807 |
$network_snippets = array_filter( $network_snippets, array( $this, 'exclude_shared_network_snippets' ) );
|
808 |
|
828 |
if ( code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
829 |
foreach ( $snippets['all'] as $snippet ) {
|
830 |
|
831 |
+
if ( 'global' !== $snippet->scope ) {
|
832 |
+
$snippet->tags = array_merge( $snippet->tags, array( $snippet->scope ) );
|
833 |
}
|
834 |
}
|
835 |
}
|
1057 |
$row_class = ( $snippet->active ? 'active' : 'inactive' );
|
1058 |
|
1059 |
if ( code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
1060 |
+
$row_class .= sprintf( ' %s-scope', $snippet->scope );
|
1061 |
}
|
1062 |
|
1063 |
if ( $snippet->shared_network ) {
|
php/class-snippet.php
CHANGED
@@ -16,8 +16,9 @@
|
|
16 |
* @property bool $network true if is multisite-wide snippet, false if site-wide
|
17 |
* @property bool $shared_network Whether the snippet is a shared network snippet
|
18 |
*
|
19 |
-
* @property-read array $tags_list
|
20 |
* @property-read string $scope_name The name of the scope
|
|
|
21 |
*/
|
22 |
class Code_Snippet {
|
23 |
|
@@ -32,16 +33,24 @@ class Code_Snippet {
|
|
32 |
'desc' => '',
|
33 |
'code' => '',
|
34 |
'tags' => array(),
|
35 |
-
'scope' =>
|
36 |
'active' => false,
|
37 |
'network' => null,
|
38 |
'shared_network' => null,
|
39 |
);
|
40 |
|
41 |
-
private $field_aliases = array(
|
42 |
'description' => 'desc',
|
43 |
);
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
/**
|
46 |
* Set all of the snippet fields from an array or object.
|
47 |
* Invalid fields will be ignored
|
@@ -66,12 +75,8 @@ class Code_Snippet {
|
|
66 |
}
|
67 |
}
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
* @param array|object $fields Initial snippet fields
|
72 |
-
*/
|
73 |
-
public function __construct( $fields = null ) {
|
74 |
-
$this->set_fields( $fields );
|
75 |
}
|
76 |
|
77 |
/**
|
@@ -84,8 +89,8 @@ class Code_Snippet {
|
|
84 |
private function validate_field_name( $field ) {
|
85 |
|
86 |
/* If a field alias is set, remap it to the valid field name */
|
87 |
-
if ( isset(
|
88 |
-
return
|
89 |
}
|
90 |
|
91 |
return $field;
|
@@ -150,7 +155,7 @@ class Code_Snippet {
|
|
150 |
* @return array
|
151 |
*/
|
152 |
public function get_allowed_fields() {
|
153 |
-
return array_keys( $this->fields ) + array_keys(
|
154 |
}
|
155 |
|
156 |
/**
|
@@ -161,7 +166,7 @@ class Code_Snippet {
|
|
161 |
* @return bool true if the is allowed, false if invalid
|
162 |
*/
|
163 |
public function is_allowed_field( $field ) {
|
164 |
-
return array_key_exists( $field, $this->fields ) || array_key_exists( $field,
|
165 |
}
|
166 |
|
167 |
/**
|
@@ -213,12 +218,16 @@ class Code_Snippet {
|
|
213 |
* @return int The field in the correct format
|
214 |
*/
|
215 |
private function prepare_scope( $scope ) {
|
216 |
-
$
|
217 |
|
218 |
-
if ( in_array( $scope,
|
219 |
return $scope;
|
220 |
}
|
221 |
|
|
|
|
|
|
|
|
|
222 |
return $this->fields['scope'];
|
223 |
}
|
224 |
|
@@ -237,6 +246,7 @@ class Code_Snippet {
|
|
237 |
* @return bool The field in the correct format
|
238 |
*/
|
239 |
private function prepare_active( $active ) {
|
|
|
240 |
if ( is_bool( $active ) ) {
|
241 |
return $active;
|
242 |
}
|
@@ -251,8 +261,8 @@ class Code_Snippet {
|
|
251 |
*/
|
252 |
private function prepare_network( $network ) {
|
253 |
|
254 |
-
if ( null === $network && function_exists( '
|
255 |
-
return
|
256 |
}
|
257 |
|
258 |
return true === $network;
|
@@ -266,22 +276,42 @@ class Code_Snippet {
|
|
266 |
return implode( ', ', $this->fields['tags'] );
|
267 |
}
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
/**
|
270 |
* Retrieve the string representation of the scope
|
271 |
-
* @
|
272 |
-
* @return string The name of the scope
|
273 |
*/
|
274 |
-
private function get_scope_name(
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
}
|
286 |
|
287 |
/**
|
16 |
* @property bool $network true if is multisite-wide snippet, false if site-wide
|
17 |
* @property bool $shared_network Whether the snippet is a shared network snippet
|
18 |
*
|
19 |
+
* @property-read array $tags_list The tags in string list format
|
20 |
* @property-read string $scope_name The name of the scope
|
21 |
+
* @property-read string $scope_icon The dashicon used to represent the current scope
|
22 |
*/
|
23 |
class Code_Snippet {
|
24 |
|
33 |
'desc' => '',
|
34 |
'code' => '',
|
35 |
'tags' => array(),
|
36 |
+
'scope' => 'global',
|
37 |
'active' => false,
|
38 |
'network' => null,
|
39 |
'shared_network' => null,
|
40 |
);
|
41 |
|
42 |
+
private static $field_aliases = array(
|
43 |
'description' => 'desc',
|
44 |
);
|
45 |
|
46 |
+
/**
|
47 |
+
* Constructor function
|
48 |
+
* @param array|object $fields Initial snippet fields
|
49 |
+
*/
|
50 |
+
public function __construct( $fields = null ) {
|
51 |
+
$this->set_fields( $fields );
|
52 |
+
}
|
53 |
+
|
54 |
/**
|
55 |
* Set all of the snippet fields from an array or object.
|
56 |
* Invalid fields will be ignored
|
75 |
}
|
76 |
}
|
77 |
|
78 |
+
public function get_fields() {
|
79 |
+
return $this->fields;
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
/**
|
89 |
private function validate_field_name( $field ) {
|
90 |
|
91 |
/* If a field alias is set, remap it to the valid field name */
|
92 |
+
if ( isset( self::$field_aliases[ $field ] ) ) {
|
93 |
+
return self::$field_aliases[ $field ];
|
94 |
}
|
95 |
|
96 |
return $field;
|
155 |
* @return array
|
156 |
*/
|
157 |
public function get_allowed_fields() {
|
158 |
+
return array_keys( $this->fields ) + array_keys( self::$field_aliases );
|
159 |
}
|
160 |
|
161 |
/**
|
166 |
* @return bool true if the is allowed, false if invalid
|
167 |
*/
|
168 |
public function is_allowed_field( $field ) {
|
169 |
+
return array_key_exists( $field, $this->fields ) || array_key_exists( $field, self::$field_aliases );
|
170 |
}
|
171 |
|
172 |
/**
|
218 |
* @return int The field in the correct format
|
219 |
*/
|
220 |
private function prepare_scope( $scope ) {
|
221 |
+
$scopes = self::get_all_scopes();
|
222 |
|
223 |
+
if ( in_array( $scope, $scopes ) ) {
|
224 |
return $scope;
|
225 |
}
|
226 |
|
227 |
+
if ( is_numeric( $scope ) && isset( $scopes[ $scope ] ) ) {
|
228 |
+
return $scopes[ $scope ];
|
229 |
+
}
|
230 |
+
|
231 |
return $this->fields['scope'];
|
232 |
}
|
233 |
|
246 |
* @return bool The field in the correct format
|
247 |
*/
|
248 |
private function prepare_active( $active ) {
|
249 |
+
|
250 |
if ( is_bool( $active ) ) {
|
251 |
return $active;
|
252 |
}
|
261 |
*/
|
262 |
private function prepare_network( $network ) {
|
263 |
|
264 |
+
if ( null === $network && function_exists( 'is_network_admin' ) ) {
|
265 |
+
return is_network_admin();
|
266 |
}
|
267 |
|
268 |
return true === $network;
|
276 |
return implode( ', ', $this->fields['tags'] );
|
277 |
}
|
278 |
|
279 |
+
/**
|
280 |
+
* Retrieve a list of all available scopes
|
281 |
+
* @return array
|
282 |
+
*/
|
283 |
+
public static function get_all_scopes() {
|
284 |
+
return array( 'global', 'admin', 'front-end', 'single-use' );
|
285 |
+
}
|
286 |
+
|
287 |
+
/**
|
288 |
+
* Retrieve a list of all scope icons
|
289 |
+
* @return array
|
290 |
+
*/
|
291 |
+
public static function get_scope_icons() {
|
292 |
+
return array(
|
293 |
+
'global' => 'admin-site',
|
294 |
+
'admin' => 'admin-tools',
|
295 |
+
'front-end' => 'admin-appearance',
|
296 |
+
'single-use' => 'clock',
|
297 |
+
);
|
298 |
+
}
|
299 |
+
|
300 |
/**
|
301 |
* Retrieve the string representation of the scope
|
302 |
+
* @return string The name of the scope
|
|
|
303 |
*/
|
304 |
+
private function get_scope_name() {
|
305 |
+
return $this->scope;
|
306 |
+
}
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Retrieve the icon used for the current scope
|
310 |
+
* @return string a dashicon name
|
311 |
+
*/
|
312 |
+
private function get_scope_icon() {
|
313 |
+
$icons = self::get_scope_icons();
|
314 |
+
return $icons[ $this->scope ];
|
315 |
}
|
316 |
|
317 |
/**
|
php/settings/settings-fields.php
CHANGED
@@ -69,8 +69,8 @@ function code_snippets_get_settings_fields() {
|
|
69 |
'show_network_snippets' => array(
|
70 |
'name' => __( 'Show Network Snippets', 'code-snippets' ),
|
71 |
'type' => 'checkbox',
|
72 |
-
'label' => __( 'Show network-wide snippets in the snippets table on subsites', 'code-snippets' ),
|
73 |
-
'default' =>
|
74 |
),
|
75 |
|
76 |
'disable_prism' => array(
|
@@ -81,7 +81,7 @@ function code_snippets_get_settings_fields() {
|
|
81 |
),
|
82 |
);
|
83 |
|
84 |
-
if ( ! is_multisite() ) {
|
85 |
unset( $fields['general']['show_network_snippets'] );
|
86 |
}
|
87 |
|
69 |
'show_network_snippets' => array(
|
70 |
'name' => __( 'Show Network Snippets', 'code-snippets' ),
|
71 |
'type' => 'checkbox',
|
72 |
+
'label' => __( 'Show network-wide snippets in the snippets table on subsites to super administrators only', 'code-snippets' ),
|
73 |
+
'default' => false,
|
74 |
),
|
75 |
|
76 |
'disable_prism' => array(
|
81 |
),
|
82 |
);
|
83 |
|
84 |
+
if ( ! is_multisite() || ! current_user_can( code_snippets()->get_network_cap_name() ) ) {
|
85 |
unset( $fields['general']['show_network_snippets'] );
|
86 |
}
|
87 |
|
php/settings/settings.php
CHANGED
@@ -6,6 +6,24 @@
|
|
6 |
* @package Code_Snippets
|
7 |
*/
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
/**
|
10 |
* Retrieve the setting values from the database.
|
11 |
* If a setting does not exist in the database, the default value will be returned.
|
@@ -23,7 +41,9 @@ function code_snippets_get_settings() {
|
|
23 |
$settings = code_snippets_get_default_settings();
|
24 |
|
25 |
/* Retrieve saved settings from the database */
|
26 |
-
$saved =
|
|
|
|
|
27 |
|
28 |
/* Replace the default field values with the ones saved in the database */
|
29 |
if ( function_exists( 'array_replace_recursive' ) ) {
|
@@ -78,8 +98,16 @@ function code_snippets_get_settings_sections() {
|
|
78 |
*/
|
79 |
function code_snippets_register_settings() {
|
80 |
|
81 |
-
if (
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
}
|
84 |
|
85 |
/* Register the setting */
|
6 |
* @package Code_Snippets
|
7 |
*/
|
8 |
|
9 |
+
/**
|
10 |
+
* Returns 'true' if plugin settings are unified on a multisite installation
|
11 |
+
* under the Network Admin settings menu
|
12 |
+
*
|
13 |
+
* This option is controlled by the "Enable administration menus" setting on the Network Settings menu
|
14 |
+
*
|
15 |
+
* @return bool
|
16 |
+
*/
|
17 |
+
function code_snippets_unified_settings() {
|
18 |
+
|
19 |
+
if ( ! is_multisite() ) {
|
20 |
+
return false;
|
21 |
+
}
|
22 |
+
|
23 |
+
$menu_perms = get_site_option( 'menu_items', array() );
|
24 |
+
return empty( $menu_perms['snippets_settings'] );
|
25 |
+
}
|
26 |
+
|
27 |
/**
|
28 |
* Retrieve the setting values from the database.
|
29 |
* If a setting does not exist in the database, the default value will be returned.
|
41 |
$settings = code_snippets_get_default_settings();
|
42 |
|
43 |
/* Retrieve saved settings from the database */
|
44 |
+
$saved = code_snippets_unified_settings() ?
|
45 |
+
get_site_option( 'code_snippets_settings', array() ) :
|
46 |
+
get_option( 'code_snippets_settings', array() );
|
47 |
|
48 |
/* Replace the default field values with the ones saved in the database */
|
49 |
if ( function_exists( 'array_replace_recursive' ) ) {
|
98 |
*/
|
99 |
function code_snippets_register_settings() {
|
100 |
|
101 |
+
if ( code_snippets_unified_settings() ) {
|
102 |
+
|
103 |
+
if ( ! get_site_option( 'code_snippets_settings', false ) ) {
|
104 |
+
add_site_option( 'code_snippets_settings', code_snippets_get_default_settings() );
|
105 |
+
}
|
106 |
+
} else {
|
107 |
+
|
108 |
+
if ( ! get_option( 'code_snippets_settings', false ) ) {
|
109 |
+
add_option( 'code_snippets_settings', code_snippets_get_default_settings() );
|
110 |
+
}
|
111 |
}
|
112 |
|
113 |
/* Register the setting */
|
php/snippet-ops.php
CHANGED
@@ -325,6 +325,68 @@ function update_snippet_fields( $snippet_id, $fields, $network = null ) {
|
|
325 |
do_action( 'code_snippets/update_snippet', $snippet->id, $table );
|
326 |
}
|
327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
/**
|
329 |
* Imports snippets from an XML file
|
330 |
*
|
@@ -332,11 +394,13 @@ function update_snippet_fields( $snippet_id, $fields, $network = null ) {
|
|
332 |
*
|
333 |
* @uses save_snippet() to add the snippets to the database
|
334 |
*
|
335 |
-
* @param
|
336 |
-
* @param
|
337 |
-
* @
|
|
|
|
|
338 |
*/
|
339 |
-
function
|
340 |
|
341 |
if ( ! file_exists( $file ) || ! is_file( $file ) ) {
|
342 |
return false;
|
@@ -347,7 +411,19 @@ function import_snippets( $file, $multisite = null ) {
|
|
347 |
|
348 |
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
|
349 |
$fields = array( 'name', 'description', 'desc', 'code', 'tags', 'scope' );
|
350 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
|
352 |
/* Loop through all snippets */
|
353 |
|
@@ -374,18 +450,26 @@ function import_snippets( $file, $multisite = null ) {
|
|
374 |
$snippet->scope = $scope;
|
375 |
}
|
376 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
/* Save the snippet and increase the counter if successful */
|
378 |
if ( $snippet_id = save_snippet( $snippet ) ) {
|
379 |
-
$
|
380 |
}
|
381 |
}
|
382 |
|
383 |
-
do_action( 'code_snippets/import', $
|
384 |
-
return $
|
385 |
}
|
386 |
|
387 |
/**
|
388 |
-
* Exports snippets as an XML file
|
389 |
*
|
390 |
* @since 2.0
|
391 |
* @uses Code_Snippets_Export to export selected snippets
|
@@ -393,9 +477,9 @@ function import_snippets( $file, $multisite = null ) {
|
|
393 |
*
|
394 |
* @param array $ids The IDs of the snippets to export
|
395 |
* @param bool|null $multisite Is the snippet a network-wide or site-wide snippet?
|
396 |
-
* @param string $format Export to xml or php?
|
397 |
*/
|
398 |
-
function export_snippets( $ids, $multisite = null, $format = '
|
399 |
$table = code_snippets()->db->get_table_name( $multisite );
|
400 |
|
401 |
if ( ! class_exists( 'Code_Snippets_Export' ) ) {
|
@@ -457,12 +541,14 @@ function execute_active_snippets() {
|
|
457 |
/** @var wpdb $wpdb */
|
458 |
global $wpdb;
|
459 |
|
460 |
-
$current_scope = is_admin() ?
|
461 |
$queries = array();
|
462 |
|
|
|
|
|
463 |
/* Fetch snippets from site table */
|
464 |
if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->snippets'" ) === $wpdb->snippets ) {
|
465 |
-
$queries[ $wpdb->snippets ] = $wpdb->prepare(
|
466 |
}
|
467 |
|
468 |
/* Fetch snippets from the network table */
|
@@ -476,14 +562,14 @@ function execute_active_snippets() {
|
|
476 |
$active_shared_ids_format = implode( ',', array_fill( 0, count( $active_shared_ids ), '%d' ) );
|
477 |
|
478 |
/* Include them in the query */
|
479 |
-
$sql =
|
480 |
|
481 |
/* Add the scope number to the IDs array, so that it is the first variable in the query */
|
482 |
array_unshift( $active_shared_ids, $current_scope );
|
483 |
$queries[ $wpdb->ms_snippets ] = $wpdb->prepare( $sql, $active_shared_ids );
|
484 |
|
485 |
} else {
|
486 |
-
$sql =
|
487 |
$queries[ $wpdb->ms_snippets ] = $wpdb->prepare( $sql, $current_scope );
|
488 |
}
|
489 |
}
|
@@ -496,6 +582,10 @@ function execute_active_snippets() {
|
|
496 |
$snippet_id = intval( $snippet['id'] );
|
497 |
$code = $snippet['code'];
|
498 |
|
|
|
|
|
|
|
|
|
499 |
if ( apply_filters( 'code_snippets/allow_execute_snippet', true, $snippet_id, $table_name ) ) {
|
500 |
execute_snippet( $code, $snippet_id );
|
501 |
}
|
325 |
do_action( 'code_snippets/update_snippet', $snippet->id, $table );
|
326 |
}
|
327 |
|
328 |
+
/**
|
329 |
+
* Imports snippets from a JSON file
|
330 |
+
*
|
331 |
+
* @since 2.9.7
|
332 |
+
*
|
333 |
+
* @uses save_snippet() to add the snippets to the database
|
334 |
+
*
|
335 |
+
* @param string $file The path to the file to import
|
336 |
+
* @param bool|null $multisite Import into network-wide table or site-wide table?
|
337 |
+
* @param string $dup_action Action to take if duplicate snippets are detected. Can be 'skip', 'ignore', or 'replace'
|
338 |
+
*
|
339 |
+
* @return array|bool An array of imported snippet IDs on success, false on failure
|
340 |
+
*/
|
341 |
+
function import_snippets_json( $file, $multisite = null, $dup_action = 'ignore' ) {
|
342 |
+
|
343 |
+
if ( ! file_exists( $file ) || ! is_file( $file ) ) {
|
344 |
+
return false;
|
345 |
+
}
|
346 |
+
|
347 |
+
$raw_data = file_get_contents( $file );
|
348 |
+
$data = json_decode( $raw_data, true );
|
349 |
+
|
350 |
+
$imported = array();
|
351 |
+
|
352 |
+
/* Get a list of existing snippet names keyed to their IDs */
|
353 |
+
$existing_snippets = array();
|
354 |
+
if ( 'replace' == $dup_action || 'skip' === $dup_action ) {
|
355 |
+
$all_snippets = get_snippets( array(), $multisite );
|
356 |
+
|
357 |
+
foreach ( $all_snippets as $snippet ) {
|
358 |
+
if ( $snippet->name ) {
|
359 |
+
$existing_snippets[ $snippet->name ] = $snippet->id;
|
360 |
+
}
|
361 |
+
}
|
362 |
+
}
|
363 |
+
|
364 |
+
/* Loop through all snippets */
|
365 |
+
|
366 |
+
/** @var DOMElement $snippet_xml */
|
367 |
+
foreach ( $data['snippets'] as $snippet ) {
|
368 |
+
$snippet = new Code_Snippet( $snippet );
|
369 |
+
$snippet->network = $multisite;
|
370 |
+
|
371 |
+
if ( 'ignore' !== $dup_action && isset( $existing_snippets[ $snippet->name ] ) ) {
|
372 |
+
|
373 |
+
if ( 'replace' === $dup_action ) {
|
374 |
+
$snippet->id = $existing_snippets[ $snippet->name ];
|
375 |
+
} elseif ( 'skip' === $dup_action ) {
|
376 |
+
continue;
|
377 |
+
}
|
378 |
+
}
|
379 |
+
|
380 |
+
/* Save the snippet and increase the counter if successful */
|
381 |
+
if ( $snippet_id = save_snippet( $snippet ) ) {
|
382 |
+
$imported[] = $snippet_id;
|
383 |
+
}
|
384 |
+
}
|
385 |
+
|
386 |
+
do_action( 'code_snippets/import/json', $file, $multisite );
|
387 |
+
return $imported;
|
388 |
+
}
|
389 |
+
|
390 |
/**
|
391 |
* Imports snippets from an XML file
|
392 |
*
|
394 |
*
|
395 |
* @uses save_snippet() to add the snippets to the database
|
396 |
*
|
397 |
+
* @param string $file The path to the file to import
|
398 |
+
* @param bool|null $multisite Import into network-wide table or site-wide table?
|
399 |
+
* @param string $dup_action Action to take if duplicate snippets are detected. Can be 'skip', 'ignore', or 'replace'
|
400 |
+
*
|
401 |
+
* @return array|bool An array of imported snippet IDs on success, false on failure
|
402 |
*/
|
403 |
+
function import_snippets_xml( $file, $multisite = null, $dup_action = 'ignore' ) {
|
404 |
|
405 |
if ( ! file_exists( $file ) || ! is_file( $file ) ) {
|
406 |
return false;
|
411 |
|
412 |
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
|
413 |
$fields = array( 'name', 'description', 'desc', 'code', 'tags', 'scope' );
|
414 |
+
$imported = array();
|
415 |
+
|
416 |
+
/* Get a list of existing snippet names keyed to their IDs */
|
417 |
+
$existing_snippets = array();
|
418 |
+
if ( 'replace' == $dup_action || 'skip' === $dup_action ) {
|
419 |
+
$all_snippets = get_snippets( array(), $multisite );
|
420 |
+
|
421 |
+
foreach ( $all_snippets as $snippet ) {
|
422 |
+
if ( $snippet->name ) {
|
423 |
+
$existing_snippets[ $snippet->name ] = $snippet->id;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
|
428 |
/* Loop through all snippets */
|
429 |
|
450 |
$snippet->scope = $scope;
|
451 |
}
|
452 |
|
453 |
+
if ( 'ignore' !== $dup_action && isset( $existing_snippets[ $snippet->name ] ) ) {
|
454 |
+
if ( 'replace' === $dup_action ) {
|
455 |
+
$snippet->id = $existing_snippets[ $snippet->name ];
|
456 |
+
} elseif ( 'skip' === $dup_action ) {
|
457 |
+
continue;
|
458 |
+
}
|
459 |
+
}
|
460 |
+
|
461 |
/* Save the snippet and increase the counter if successful */
|
462 |
if ( $snippet_id = save_snippet( $snippet ) ) {
|
463 |
+
$imported[] = $snippet_id;
|
464 |
}
|
465 |
}
|
466 |
|
467 |
+
do_action( 'code_snippets/import/xml', $file, $multisite );
|
468 |
+
return $imported;
|
469 |
}
|
470 |
|
471 |
/**
|
472 |
+
* Exports snippets as an XML, JSON or PHP file
|
473 |
*
|
474 |
* @since 2.0
|
475 |
* @uses Code_Snippets_Export to export selected snippets
|
477 |
*
|
478 |
* @param array $ids The IDs of the snippets to export
|
479 |
* @param bool|null $multisite Is the snippet a network-wide or site-wide snippet?
|
480 |
+
* @param string $format Export to json, xml or php?
|
481 |
*/
|
482 |
+
function export_snippets( $ids, $multisite = null, $format = 'json' ) {
|
483 |
$table = code_snippets()->db->get_table_name( $multisite );
|
484 |
|
485 |
if ( ! class_exists( 'Code_Snippets_Export' ) ) {
|
541 |
/** @var wpdb $wpdb */
|
542 |
global $wpdb;
|
543 |
|
544 |
+
$current_scope = is_admin() ? 'admin' : 'front-end';
|
545 |
$queries = array();
|
546 |
|
547 |
+
$sql_format = "SELECT id, code, scope FROM %s WHERE scope IN ('global', 'single-use', %%s) ";
|
548 |
+
|
549 |
/* Fetch snippets from site table */
|
550 |
if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->snippets'" ) === $wpdb->snippets ) {
|
551 |
+
$queries[ $wpdb->snippets ] = $wpdb->prepare( sprintf( $sql_format, $wpdb->snippets ) . 'AND active=1', $current_scope );
|
552 |
}
|
553 |
|
554 |
/* Fetch snippets from the network table */
|
562 |
$active_shared_ids_format = implode( ',', array_fill( 0, count( $active_shared_ids ), '%d' ) );
|
563 |
|
564 |
/* Include them in the query */
|
565 |
+
$sql = sprintf( $sql_format, $wpdb->ms_snippets ) . " AND (active=1 OR id IN ($active_shared_ids_format))";
|
566 |
|
567 |
/* Add the scope number to the IDs array, so that it is the first variable in the query */
|
568 |
array_unshift( $active_shared_ids, $current_scope );
|
569 |
$queries[ $wpdb->ms_snippets ] = $wpdb->prepare( $sql, $active_shared_ids );
|
570 |
|
571 |
} else {
|
572 |
+
$sql = sprintf( $sql_format, $wpdb->ms_snippets ) . 'AND active=1';
|
573 |
$queries[ $wpdb->ms_snippets ] = $wpdb->prepare( $sql, $current_scope );
|
574 |
}
|
575 |
}
|
582 |
$snippet_id = intval( $snippet['id'] );
|
583 |
$code = $snippet['code'];
|
584 |
|
585 |
+
if ( 'single-use' === $snippet['scope'] ) {
|
586 |
+
$wpdb->update( $table_name, array( 'active' => '0' ), array( 'id' => $snippet_id ), array( '%d' ), array( '%d' ) );
|
587 |
+
}
|
588 |
+
|
589 |
if ( apply_filters( 'code_snippets/allow_execute_snippet', true, $snippet_id, $table_name ) ) {
|
590 |
execute_snippet( $code, $snippet_id );
|
591 |
}
|
php/upgrade.php
CHANGED
@@ -14,6 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
* @since 2.0
|
15 |
*/
|
16 |
function code_snippets_upgrader() {
|
|
|
17 |
|
18 |
/* Get the current plugin version from the database */
|
19 |
$prev_version = get_option( 'code_snippets_version' );
|
@@ -27,6 +28,13 @@ function code_snippets_upgrader() {
|
|
27 |
/* Update the plugin version stored in the database */
|
28 |
update_option( 'code_snippets_version', CODE_SNIPPETS_VERSION );
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
/* Custom capabilities were removed after version 2.9.5 */
|
31 |
if ( version_compare( $prev_version, '2.9.5', '<=' ) ) {
|
32 |
$role = get_role( apply_filters( 'code_snippets_role', 'administrator' ) );
|
@@ -47,6 +55,12 @@ function code_snippets_upgrader() {
|
|
47 |
/* Update the plugin version stored in the database */
|
48 |
update_site_option( 'code_snippets_version', CODE_SNIPPETS_VERSION );
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
/* Custom capabilities were removed after version 2.9.5 */
|
52 |
if ( version_compare( $prev_ms_version, '2.9.5', '<=' ) ) {
|
14 |
* @since 2.0
|
15 |
*/
|
16 |
function code_snippets_upgrader() {
|
17 |
+
global $wpdb;
|
18 |
|
19 |
/* Get the current plugin version from the database */
|
20 |
$prev_version = get_option( 'code_snippets_version' );
|
28 |
/* Update the plugin version stored in the database */
|
29 |
update_option( 'code_snippets_version', CODE_SNIPPETS_VERSION );
|
30 |
|
31 |
+
/* Update the scope column of the database */
|
32 |
+
if ( version_compare( $prev_version, '2.10.0', '<' ) ) {
|
33 |
+
$wpdb->query( "UPDATE {$wpdb->snippets} SET scope = 'global' WHERE scope = 0" );
|
34 |
+
$wpdb->query( "UPDATE {$wpdb->snippets} SET scope = 'admin' WHERE scope = 1" );
|
35 |
+
$wpdb->query( "UPDATE {$wpdb->snippets} SET scope = 'front-end' WHERE scope = 2" );
|
36 |
+
}
|
37 |
+
|
38 |
/* Custom capabilities were removed after version 2.9.5 */
|
39 |
if ( version_compare( $prev_version, '2.9.5', '<=' ) ) {
|
40 |
$role = get_role( apply_filters( 'code_snippets_role', 'administrator' ) );
|
55 |
/* Update the plugin version stored in the database */
|
56 |
update_site_option( 'code_snippets_version', CODE_SNIPPETS_VERSION );
|
57 |
|
58 |
+
/* Update the scope column of the database */
|
59 |
+
if ( version_compare( $prev_version, '2.10.0', '<' ) ) {
|
60 |
+
$wpdb->query( "UPDATE {$wpdb->ms_snippets} SET scope = 'global' WHERE scope = 0" );
|
61 |
+
$wpdb->query( "UPDATE {$wpdb->ms_snippets} SET scope = 'admin' WHERE scope = 1" );
|
62 |
+
$wpdb->query( "UPDATE {$wpdb->ms_snippets} SET scope = 'front-end' WHERE scope = 2" );
|
63 |
+
}
|
64 |
|
65 |
/* Custom capabilities were removed after version 2.9.5 */
|
66 |
if ( version_compare( $prev_ms_version, '2.9.5', '<=' ) ) {
|
php/views/edit.php
CHANGED
@@ -12,8 +12,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
12 |
return;
|
13 |
}
|
14 |
|
15 |
-
global $pagenow;
|
16 |
-
|
17 |
$table = code_snippets()->db->get_table_name();
|
18 |
$edit_id = code_snippets()->get_menu_slug( 'edit' ) === $_REQUEST['page'] ? absint( $_REQUEST['id'] ) : 0;
|
19 |
$snippet = get_snippet( $edit_id );
|
@@ -64,6 +62,7 @@ $snippet = get_snippet( $edit_id );
|
|
64 |
|
65 |
/* Add a nonce for security */
|
66 |
wp_nonce_field( 'save_snippet' );
|
|
|
67 |
?>
|
68 |
|
69 |
<p class="submit">
|
@@ -71,7 +70,13 @@ $snippet = get_snippet( $edit_id );
|
|
71 |
|
72 |
/* Make the 'Save and Activate' button the default if the setting is enabled */
|
73 |
|
74 |
-
if ( $snippet->
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
submit_button( null, 'primary', 'save_snippet', false );
|
77 |
|
@@ -106,6 +111,12 @@ $snippet = get_snippet( $edit_id );
|
|
106 |
|
107 |
if ( 0 !== $snippet->id ) {
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/* Export button */
|
110 |
|
111 |
submit_button( __( 'Export', 'code-snippets' ), 'secondary', 'export_snippet', false );
|
12 |
return;
|
13 |
}
|
14 |
|
|
|
|
|
15 |
$table = code_snippets()->db->get_table_name();
|
16 |
$edit_id = code_snippets()->get_menu_slug( 'edit' ) === $_REQUEST['page'] ? absint( $_REQUEST['id'] ) : 0;
|
17 |
$snippet = get_snippet( $edit_id );
|
62 |
|
63 |
/* Add a nonce for security */
|
64 |
wp_nonce_field( 'save_snippet' );
|
65 |
+
|
66 |
?>
|
67 |
|
68 |
<p class="submit">
|
70 |
|
71 |
/* Make the 'Save and Activate' button the default if the setting is enabled */
|
72 |
|
73 |
+
if ( 'single-use' === $snippet->scope ) {
|
74 |
+
|
75 |
+
submit_button( null, 'primary', 'save_snippet', false );
|
76 |
+
|
77 |
+
submit_button( __( 'Save Changes and Execute Once', 'code-snippets' ), 'secondary', 'save_snippet_execute', false );
|
78 |
+
|
79 |
+
} elseif ( $snippet->shared_network && is_network_admin() ) {
|
80 |
|
81 |
submit_button( null, 'primary', 'save_snippet', false );
|
82 |
|
111 |
|
112 |
if ( 0 !== $snippet->id ) {
|
113 |
|
114 |
+
/* Download button */
|
115 |
+
|
116 |
+
if ( apply_filters( 'code_snippets/enable_downloads', true ) ) {
|
117 |
+
submit_button( __( 'Download', 'code-snippets' ), 'secondary', 'download_snippet', false );
|
118 |
+
}
|
119 |
+
|
120 |
/* Export button */
|
121 |
|
122 |
submit_button( __( 'Export', 'code-snippets' ), 'secondary', 'export_snippet', false );
|
php/views/import.php
CHANGED
@@ -18,25 +18,56 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
18 |
|
19 |
<div class="narrow">
|
20 |
|
21 |
-
<p><?php _e( '
|
22 |
|
23 |
-
<p><?php
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
<p><?php _e( 'Choose
|
26 |
|
27 |
<form enctype="multipart/form-data" method="post" action="" id="import-upload-form" name="code_snippets_import">
|
28 |
<p>
|
29 |
-
<input type="hidden" name="action" value="save"
|
30 |
-
<input type="hidden" name="max_file_size" value="8388608"
|
31 |
|
32 |
<label for="upload"><?php _e( 'Choose a file from your computer:', 'code-snippets' ); ?></label>
|
33 |
<?php _e( '(Maximum size: 8MB)', 'code-snippets' ); ?>
|
34 |
-
<input type="file" id="upload" name="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
</p>
|
36 |
|
37 |
<?php
|
38 |
do_action( 'code_snippets/admin/import_form' );
|
39 |
-
submit_button( __( 'Upload
|
40 |
?>
|
41 |
</form>
|
42 |
</div>
|
18 |
|
19 |
<div class="narrow">
|
20 |
|
21 |
+
<p><?php _e( 'Upload one or more Code Snippets export files and the snippets will be imported.', 'code-snippets' ); ?></p>
|
22 |
|
23 |
+
<p><?php
|
24 |
+
printf(
|
25 |
+
__( 'Afterwards, you will need to go to the <a href="%s">All Snippets</a> page to activate the imported snippets.', 'code-snippets' ),
|
26 |
+
code_snippets()->get_menu_url( 'manage' )
|
27 |
+
); ?></p>
|
28 |
|
29 |
+
<p><?php _e( 'Choose one or more Code Snippets (.xml or .json) files to upload, then click "Upload files and import".', 'code-snippets' ); ?></p>
|
30 |
|
31 |
<form enctype="multipart/form-data" method="post" action="" id="import-upload-form" name="code_snippets_import">
|
32 |
<p>
|
33 |
+
<input type="hidden" name="action" value="save">
|
34 |
+
<input type="hidden" name="max_file_size" value="8388608">
|
35 |
|
36 |
<label for="upload"><?php _e( 'Choose a file from your computer:', 'code-snippets' ); ?></label>
|
37 |
<?php _e( '(Maximum size: 8MB)', 'code-snippets' ); ?>
|
38 |
+
<input type="file" id="upload" name="code_snippets_import_files[]" size="25" accept="text/xml,application/json" multiple="multiple">
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<h2>Duplicate Snippets</h2>
|
42 |
+
|
43 |
+
<p class="description">
|
44 |
+
<?php esc_html_e( 'What should happen if an existing snippet is found with an identical name to an imported snippet?', 'code-snippets' ); ?>
|
45 |
+
</p>
|
46 |
+
|
47 |
+
<p>
|
48 |
+
<label>
|
49 |
+
<input type="radio" name="duplicate_action" value="ignore" checked="checked">
|
50 |
+
<?php esc_html_e( 'Ignore any duplicate snippets: import all snippets from the file regardless and leave all existing snippets unchanged.', 'code-snippets' ); ?>
|
51 |
+
</label>
|
52 |
+
</p>
|
53 |
+
|
54 |
+
<p>
|
55 |
+
<label>
|
56 |
+
<input type="radio" name="duplicate_action" value="replace">
|
57 |
+
<?php esc_html_e( 'Replace any existing snippets with a newly imported snippet of the same name.', 'code-snippets' ); ?>
|
58 |
+
</label>
|
59 |
+
</p>
|
60 |
+
|
61 |
+
<p>
|
62 |
+
<label>
|
63 |
+
<input type="radio" name="duplicate_action" value="skip">
|
64 |
+
<?php esc_html_e( 'Do not import any duplicate snippets; leave all existing snippets unchanged.', 'code-snippets' ); ?>
|
65 |
+
</label>
|
66 |
</p>
|
67 |
|
68 |
<?php
|
69 |
do_action( 'code_snippets/admin/import_form' );
|
70 |
+
submit_button( __( 'Upload files and import', 'code-snippets' ) );
|
71 |
?>
|
72 |
</form>
|
73 |
</div>
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: bungeshea
|
|
3 |
Donate link: https://bungeshea.com/donate/
|
4 |
Tags: code-snippets, snippets, code, php, network, multisite
|
5 |
Requires at least: 3.6
|
6 |
-
Tested up to: 4.9.
|
7 |
-
Stable tag: 2.
|
8 |
License: MIT
|
9 |
License URI: license.txt
|
10 |
|
@@ -111,6 +111,18 @@ That's fantastic! Fork the [repository on GitHub](http://github.com/sheabunge/co
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
= 2.9.6 (14 Jan 2018) =
|
115 |
* Added Brazilian Portuguese translation by [Bruno Borges](http://brunoborges.info)
|
116 |
* Fixed: Use standard WordPress capabilities instead of custom capabilities to prevent lockouts
|
@@ -494,6 +506,9 @@ That's fantastic! Fork the [repository on GitHub](http://github.com/sheabunge/co
|
|
494 |
|
495 |
== Upgrade Notice ==
|
496 |
|
|
|
|
|
|
|
497 |
= 2.9.5 =
|
498 |
Fixed issue with saving snippets on multisite
|
499 |
|
3 |
Donate link: https://bungeshea.com/donate/
|
4 |
Tags: code-snippets, snippets, code, php, network, multisite
|
5 |
Requires at least: 3.6
|
6 |
+
Tested up to: 4.9.2
|
7 |
+
Stable tag: 2.10.0
|
8 |
License: MIT
|
9 |
License URI: license.txt
|
10 |
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 2.10.0 (18 Jan 2018) =
|
115 |
+
* Improved: Added support for importing from multiple export files at once
|
116 |
+
* Improved: Unbold the titles of inactive snippets for greater visual distinction
|
117 |
+
* Added: New scope for single-use snippets
|
118 |
+
* Improved: Don't show network snippets on subsites by default, and only to super admins
|
119 |
+
* Improved: Export snippets to JSON instead of XML
|
120 |
+
* Improved: More options for importing duplicate snippets
|
121 |
+
* Improved: Use strings for representing scopes internally instead of numbers
|
122 |
+
* Added: Allowed plugin settings to be unified on multisite through Network Settings option
|
123 |
+
* Fixed: Issue with incorrectly treating network snippets as site-wide for code validation
|
124 |
+
* Improved: Rename 'Export to PHP' to 'Download', and add button to edit snippet page
|
125 |
+
|
126 |
= 2.9.6 (14 Jan 2018) =
|
127 |
* Added Brazilian Portuguese translation by [Bruno Borges](http://brunoborges.info)
|
128 |
* Fixed: Use standard WordPress capabilities instead of custom capabilities to prevent lockouts
|
506 |
|
507 |
== Upgrade Notice ==
|
508 |
|
509 |
+
= 2.10.0 =
|
510 |
+
Improvements for multisite and new single-use snippet scope
|
511 |
+
|
512 |
= 2.9.5 =
|
513 |
Fixed issue with saving snippets on multisite
|
514 |
|