Version Description
Download this release
Release Info
Developer | artstorm |
Plugin | Post Snippets |
Version | 1.9.6 |
Comparing to | |
See all releases |
Code changes from version 1.9.5 to 1.9.6
- post-snippets.php +7 -4
- readme.txt +5 -1
post-snippets.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Post Snippets
|
4 |
Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
|
5 |
Description: Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes.
|
6 |
-
Version: 1.9.
|
7 |
Author: Johan Steen
|
8 |
Author URI: http://johansteen.se/
|
9 |
Text Domain: post-snippets
|
@@ -705,6 +705,7 @@ function edOpenPostSnippets(myField) {
|
|
705 |
*/
|
706 |
function create_export_file() {
|
707 |
$snippets = serialize(get_option($this->plugin_options));
|
|
|
708 |
$dir = wp_upload_dir();
|
709 |
$upload_dir = $dir['basedir'] . '/';
|
710 |
$upload_url = $dir['baseurl'] . '/';
|
@@ -763,9 +764,11 @@ function edOpenPostSnippets(myField) {
|
|
763 |
// Delete the uploaded archive
|
764 |
unlink($file['file']);
|
765 |
|
766 |
-
$
|
767 |
-
if ($
|
768 |
-
|
|
|
|
|
769 |
|
770 |
// Delete the snippet file
|
771 |
unlink('./post-snippets-export.cfg');
|
3 |
Plugin Name: Post Snippets
|
4 |
Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
|
5 |
Description: Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes.
|
6 |
+
Version: 1.9.6
|
7 |
Author: Johan Steen
|
8 |
Author URI: http://johansteen.se/
|
9 |
Text Domain: post-snippets
|
705 |
*/
|
706 |
function create_export_file() {
|
707 |
$snippets = serialize(get_option($this->plugin_options));
|
708 |
+
$snippets = apply_filters( 'post_snippets_export', $snippets );
|
709 |
$dir = wp_upload_dir();
|
710 |
$upload_dir = $dir['basedir'] . '/';
|
711 |
$upload_url = $dir['baseurl'] . '/';
|
764 |
// Delete the uploaded archive
|
765 |
unlink($file['file']);
|
766 |
|
767 |
+
$snippets = file_get_contents( $upload_dir.'post-snippets-export.cfg' ); // Returns false on failure, else the contents
|
768 |
+
if ($snippets) {
|
769 |
+
$snippets = apply_filters( 'post_snippets_import', $snippets );
|
770 |
+
update_option($this->plugin_options, unserialize($snippets));
|
771 |
+
}
|
772 |
|
773 |
// Delete the snippet file
|
774 |
unlink('./post-snippets-export.cfg');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: artstorm
|
|
3 |
Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.3.1
|
6 |
-
Stable tag: 1.9.
|
7 |
|
8 |
Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
|
9 |
can be set for more flexibility. Inserts directly or as shortcodes.
|
@@ -92,6 +92,10 @@ for questions, answers, support and feature requests.
|
|
92 |
|
93 |
== Changelog ==
|
94 |
|
|
|
|
|
|
|
|
|
95 |
= Version 1.9.5 - 17 Mar 2012 =
|
96 |
* The HTML and scripts for the popup window in the post editor is now only
|
97 |
generated on the screens where it's needed.
|
3 |
Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 3.3.1
|
6 |
+
Stable tag: 1.9.6
|
7 |
|
8 |
Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
|
9 |
can be set for more flexibility. Inserts directly or as shortcodes.
|
92 |
|
93 |
== Changelog ==
|
94 |
|
95 |
+
= Version 1.9.6 - 19 Mar 2012 =
|
96 |
+
* Added two new filters. `post_snippets_import` and `post_snippets_export`.
|
97 |
+
[Read more](http://wpstorm.net/wordpress-plugins/post-snippets/#filters).
|
98 |
+
|
99 |
= Version 1.9.5 - 17 Mar 2012 =
|
100 |
* The HTML and scripts for the popup window in the post editor is now only
|
101 |
generated on the screens where it's needed.
|