Version Description
- Increased installation requirement to Genesis 1.7.1
- Removed PHP4 constructor
- Whitespace, standards, and documentation
Download this release
Release Info
Developer | wpmuguru |
Plugin | Genesis Simple Edits |
Version | 1.7.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.7.1
- plugin.php +54 -47
- readme.txt +10 -5
plugin.php
CHANGED
@@ -1,62 +1,67 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
Plugin Name: Genesis Simple Edits
|
4 |
-
Plugin URI: http://www.studiopress.com/plugins/genesis-simple-edits
|
5 |
-
Description: Genesis Simple Edits lets you edit the three most commonly modified areas in any Genesis theme: the post-info, the post-meta, and the footer area.
|
6 |
-
|
7 |
-
Author:
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
*/
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
class Genesis_Simple_Edits {
|
12 |
|
13 |
-
|
14 |
function __construct() {
|
15 |
|
16 |
-
register_activation_hook( __FILE__, array(
|
17 |
|
18 |
define( 'GSE_SETTINGS_FIELD', 'gse-settings' );
|
19 |
|
20 |
-
add_action( 'admin_init', array(
|
21 |
-
add_action( 'admin_init', array(
|
22 |
-
add_action( 'admin_init', array(
|
23 |
-
add_action( 'admin_menu', array(
|
24 |
-
add_action( 'admin_notices', array(
|
25 |
|
26 |
-
add_filter( 'genesis_post_info', array(
|
27 |
-
add_filter( 'genesis_post_meta', array(
|
28 |
-
add_filter( 'genesis_footer_backtotop_text', array(
|
29 |
-
add_filter( 'genesis_footer_creds_text', array(
|
30 |
-
add_filter( 'genesis_footer_output', array(
|
31 |
-
|
32 |
-
}
|
33 |
|
34 |
-
// PHP4 Constructor
|
35 |
-
function Genesis_Simple_Edits() {
|
36 |
-
$this->__construct();
|
37 |
}
|
38 |
|
39 |
function activation_hook() {
|
40 |
|
41 |
-
$latest = '1.
|
42 |
-
|
43 |
-
$theme_info = get_theme_data(TEMPLATEPATH.'/style.css');
|
44 |
-
|
45 |
-
|
46 |
-
deactivate_plugins(plugin_basename(__FILE__));
|
47 |
-
|
48 |
}
|
49 |
|
50 |
if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
|
55 |
}
|
56 |
|
57 |
function javascript() {
|
58 |
|
59 |
-
wp_enqueue_script( 'genesis-simple-edits-js', plugin_dir_url(__FILE__) . 'js/admin.js', array('jquery'), '', true );
|
60 |
|
61 |
}
|
62 |
|
@@ -67,10 +72,10 @@ class Genesis_Simple_Edits {
|
|
67 |
|
68 |
function reset() {
|
69 |
|
70 |
-
if ( !isset($_REQUEST['page']) || $_REQUEST['page']
|
71 |
return;
|
72 |
|
73 |
-
if ( genesis_get_option('reset', GSE_SETTINGS_FIELD) ) {
|
74 |
update_option( GSE_SETTINGS_FIELD, $this->settings_defaults() );
|
75 |
wp_redirect( admin_url( 'admin.php?page=genesis-simple-edits&reset=true' ) );
|
76 |
exit;
|
@@ -80,14 +85,14 @@ class Genesis_Simple_Edits {
|
|
80 |
|
81 |
function notices() {
|
82 |
|
83 |
-
if ( !isset($_REQUEST['page']) || $_REQUEST['page']
|
84 |
return;
|
85 |
|
86 |
-
if ( isset( $_REQUEST['reset'] ) && $_REQUEST['reset']
|
87 |
-
echo '<div id="message" class="updated"><p><strong>'.__('Simple Edits Reset', 'gse').'</strong></p></div>';
|
88 |
}
|
89 |
-
elseif ( isset($_REQUEST['updated']) && $_REQUEST['updated']
|
90 |
-
echo '<div id="message" class="updated"><p><strong>'.__('Simple Edits Saved', 'gse').'</strong></p></div>';
|
91 |
}
|
92 |
|
93 |
}
|
@@ -106,17 +111,19 @@ class Genesis_Simple_Edits {
|
|
106 |
}
|
107 |
|
108 |
function add_menu() {
|
109 |
-
|
|
|
|
|
110 |
}
|
111 |
|
112 |
function admin_page() { ?>
|
113 |
|
114 |
<div class="wrap">
|
115 |
<form method="post" action="options.php">
|
116 |
-
<?php settings_fields(GSE_SETTINGS_FIELD); // important! ?>
|
117 |
|
118 |
-
<?php screen_icon('options-general'); ?>
|
119 |
-
<h2><?php
|
120 |
|
121 |
<table class="form-table"><tbody>
|
122 |
|
@@ -140,7 +147,7 @@ class Genesis_Simple_Edits {
|
|
140 |
<tr class="post-shortcodes" style="display: none;">
|
141 |
<th scope="row"><p><span class="description"><?php _e('Shortcode Reference'); ?></span></p></th>
|
142 |
<td>
|
143 |
-
<p><span class="description"><?php _e('NOTE: For a more comprehensive shortcode usage guide, <a href="http://
|
144 |
<p>
|
145 |
<ul>
|
146 |
<li>[post_date] - <span class="description"><?php _e('Date the post was published', ''); ?></span></li>
|
@@ -187,7 +194,7 @@ class Genesis_Simple_Edits {
|
|
187 |
<tr class="footer-shortcodes" style="display: none;">
|
188 |
<th scope="row"><p><span class="description"><?php _e('Shortcode Reference'); ?></span></p></th>
|
189 |
<td>
|
190 |
-
<p><span class="description"><?php _e('NOTE: For a more comprehensive shortcode usage guide, <a href="http://
|
191 |
<p>
|
192 |
<ul>
|
193 |
<li>[footer_backtotop] - <span class="description"><?php _e('The "Back to Top" Link', ''); ?></span></li>
|
1 |
<?php
|
2 |
/*
|
3 |
+
Plugin Name: Genesis Simple Edits
|
4 |
+
Plugin URI: http://www.studiopress.com/plugins/genesis-simple-edits
|
5 |
+
Description: Genesis Simple Edits lets you edit the three most commonly modified areas in any Genesis theme: the post-info, the post-meta, and the footer area.
|
6 |
+
Author: Nathan Rice
|
7 |
+
Author URI: http://www.nathanrice.net/
|
8 |
+
|
9 |
+
Version: 1.7.1
|
10 |
+
|
11 |
+
License: GNU General Public License v2.0 (or later)
|
12 |
+
License URI: http://www.opensource.org/licenses/gpl-license.php
|
13 |
*/
|
14 |
|
15 |
+
/**
|
16 |
+
* The main class that handles the entire output, content filters, etc., for this plugin.
|
17 |
+
*
|
18 |
+
* @package Genesis Simple Edits
|
19 |
+
* @since 1.0
|
20 |
+
*/
|
21 |
class Genesis_Simple_Edits {
|
22 |
|
23 |
+
/** Constructor */
|
24 |
function __construct() {
|
25 |
|
26 |
+
register_activation_hook( __FILE__, array( $this, 'activation_hook' ) );
|
27 |
|
28 |
define( 'GSE_SETTINGS_FIELD', 'gse-settings' );
|
29 |
|
30 |
+
add_action( 'admin_init', array( $this, 'javascript' ) );
|
31 |
+
add_action( 'admin_init', array( $this, 'reset' ) );
|
32 |
+
add_action( 'admin_init', array( $this, 'register_settings' ) );
|
33 |
+
add_action( 'admin_menu', array( $this, 'add_menu' ), 15 );
|
34 |
+
add_action( 'admin_notices', array( $this, 'notices' ) );
|
35 |
|
36 |
+
add_filter( 'genesis_post_info', array( $this, 'post_info_filter' ), 20 );
|
37 |
+
add_filter( 'genesis_post_meta', array( $this, 'post_meta_filter' ), 20 );
|
38 |
+
add_filter( 'genesis_footer_backtotop_text', array( $this, 'footer_backtotop_filter' ), 20 );
|
39 |
+
add_filter( 'genesis_footer_creds_text', array( $this, 'footer_creds_filter' ), 20 );
|
40 |
+
add_filter( 'genesis_footer_output', array( $this, 'footer_output_filter' ), 20 );
|
|
|
|
|
41 |
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
function activation_hook() {
|
45 |
|
46 |
+
$latest = '1.7.1';
|
47 |
+
|
48 |
+
$theme_info = get_theme_data( TEMPLATEPATH . '/style.css' );
|
49 |
+
|
50 |
+
if ( 'genesis' != basename( TEMPLATEPATH ) ) {
|
51 |
+
deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
|
52 |
+
wp_die( sprintf( __( 'Sorry, you can\'t activate unless you have installed <a href="%s">Genesis</a>', 'apl' ), 'http://www.studiopress.com/themes/genesis' ) );
|
53 |
}
|
54 |
|
55 |
if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
|
56 |
+
deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
|
57 |
+
wp_die( sprintf( __( 'Sorry, you cannot activate without <a href="%s">Genesis %s</a> or greater', 'apl' ), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) );
|
58 |
+
}
|
59 |
|
60 |
}
|
61 |
|
62 |
function javascript() {
|
63 |
|
64 |
+
wp_enqueue_script( 'genesis-simple-edits-js', plugin_dir_url(__FILE__) . 'js/admin.js', array( 'jquery' ), '', true );
|
65 |
|
66 |
}
|
67 |
|
72 |
|
73 |
function reset() {
|
74 |
|
75 |
+
if ( ! isset( $_REQUEST['page'] ) || 'genesis-simple-edits' != $_REQUEST['page'] )
|
76 |
return;
|
77 |
|
78 |
+
if ( genesis_get_option( 'reset', GSE_SETTINGS_FIELD ) ) {
|
79 |
update_option( GSE_SETTINGS_FIELD, $this->settings_defaults() );
|
80 |
wp_redirect( admin_url( 'admin.php?page=genesis-simple-edits&reset=true' ) );
|
81 |
exit;
|
85 |
|
86 |
function notices() {
|
87 |
|
88 |
+
if ( ! isset( $_REQUEST['page'] ) || 'genesis-simple-edits' != $_REQUEST['page'] )
|
89 |
return;
|
90 |
|
91 |
+
if ( isset( $_REQUEST['reset'] ) && 'true' == $_REQUEST['reset'] ) {
|
92 |
+
echo '<div id="message" class="updated"><p><strong>' . __( 'Simple Edits Reset', 'gse' ) . '</strong></p></div>';
|
93 |
}
|
94 |
+
elseif ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] ) {
|
95 |
+
echo '<div id="message" class="updated"><p><strong>' . __( 'Simple Edits Saved', 'gse' ) . '</strong></p></div>';
|
96 |
}
|
97 |
|
98 |
}
|
111 |
}
|
112 |
|
113 |
function add_menu() {
|
114 |
+
|
115 |
+
add_submenu_page('genesis', __('Genesis - Simple Edits','gse'), __('Simple Edits','gse'), 'manage_options', 'genesis-simple-edits', array( &$this, 'admin_page' ) );
|
116 |
+
|
117 |
}
|
118 |
|
119 |
function admin_page() { ?>
|
120 |
|
121 |
<div class="wrap">
|
122 |
<form method="post" action="options.php">
|
123 |
+
<?php settings_fields( GSE_SETTINGS_FIELD ); // important! ?>
|
124 |
|
125 |
+
<?php screen_icon( 'options-general' ); ?>
|
126 |
+
<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
|
127 |
|
128 |
<table class="form-table"><tbody>
|
129 |
|
147 |
<tr class="post-shortcodes" style="display: none;">
|
148 |
<th scope="row"><p><span class="description"><?php _e('Shortcode Reference'); ?></span></p></th>
|
149 |
<td>
|
150 |
+
<p><span class="description"><?php _e('NOTE: For a more comprehensive shortcode usage guide, <a href="http://my.studiopress.com/docs/shortcode-reference/" target="_blank">see this page</a>.') ?>
|
151 |
<p>
|
152 |
<ul>
|
153 |
<li>[post_date] - <span class="description"><?php _e('Date the post was published', ''); ?></span></li>
|
194 |
<tr class="footer-shortcodes" style="display: none;">
|
195 |
<th scope="row"><p><span class="description"><?php _e('Shortcode Reference'); ?></span></p></th>
|
196 |
<td>
|
197 |
+
<p><span class="description"><?php _e('NOTE: For a more comprehensive shortcode usage guide, <a href="http://my.studiopress.com/docs/shortcode-reference/" target="_blank">see this page</a>.') ?>
|
198 |
<p>
|
199 |
<ul>
|
200 |
<li>[footer_backtotop] - <span class="description"><?php _e('The "Back to Top" Link', ''); ?></span></li>
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Plugin Name ===
|
2 |
-
Contributors: nathanrice, studiopress
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
|
4 |
Tags: shortcodes, genesis, genesiswp, studiopress
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
This plugin lets you edit the three most commonly modified areas in any Genesis theme: the post-info (byline), the post-meta, and the footer area.
|
10 |
|
@@ -38,4 +38,9 @@ You must have Genesis (1.3+) or a Genesis child theme installed and activated on
|
|
38 |
== Changelog ==
|
39 |
|
40 |
= 1.0 =
|
41 |
-
* Initial Release
|
|
|
|
|
|
|
|
|
|
1 |
=== Plugin Name ===
|
2 |
+
Contributors: nathanrice, studiopress, wpmuguru
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
|
4 |
Tags: shortcodes, genesis, genesiswp, studiopress
|
5 |
+
Requires at least: 3.2
|
6 |
+
Tested up to: 3.5
|
7 |
+
Stable tag: 1.7.1
|
8 |
|
9 |
This plugin lets you edit the three most commonly modified areas in any Genesis theme: the post-info (byline), the post-meta, and the footer area.
|
10 |
|
38 |
== Changelog ==
|
39 |
|
40 |
= 1.0 =
|
41 |
+
* Initial Release
|
42 |
+
|
43 |
+
= 1.7.1 =
|
44 |
+
* Increased installation requirement to Genesis 1.7.1
|
45 |
+
* Removed PHP4 constructor
|
46 |
+
* Whitespace, standards, and documentation
|