Genesis Simple Edits - Version 2.2.0

Version Description

  • Rewrite based in plugin boilerplate.
  • Update Author and Author URI.
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Genesis Simple Edits
Version 2.2.0
Comparing to
See all releases

Code changes from version 2.1.4 to 2.2.0

README.md ADDED
@@ -0,0 +1 @@
 
1
+
{js → assets/js}/admin.js RENAMED
File without changes
genesis-simple-edits.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The main class that handles the entire output, content filters, etc., for this plugin.
5
+ *
6
+ * @package Genesis Simple Edits
7
+ * @since 1.0
8
+ */
9
+ class Genesis_Simple_Edits {
10
+
11
+ /**
12
+ * Plugin version
13
+ */
14
+ public $plugin_version = '2.2.0';
15
+
16
+ /**
17
+ * Minimum WordPress version.
18
+ */
19
+ public $min_wp_version = '4.7.2';
20
+
21
+ /**
22
+ * Minimum Genesis version.
23
+ */
24
+ public $min_genesis_version = '2.4.2';
25
+
26
+ /**
27
+ * The plugin textdomain, for translations.
28
+ */
29
+ public $plugin_textdomain = 'genesis-simple-edits';
30
+
31
+ /**
32
+ * The url to the plugin directory.
33
+ */
34
+ public $plugin_dir_url;
35
+
36
+ /**
37
+ * The path to the plugin directory.
38
+ */
39
+ public $plugin_dir_path;
40
+
41
+ /**
42
+ * The main settings field for this plugin.
43
+ */
44
+ public $settings_field = 'gse-settings';
45
+
46
+ /**
47
+ * Core functionality.
48
+ */
49
+ public $core;
50
+
51
+ /**
52
+ * Admin menu and settings page.
53
+ */
54
+ public $admin;
55
+
56
+ /**
57
+ * Constructor.
58
+ *
59
+ * @since 2.2.0
60
+ */
61
+ function __construct() {
62
+
63
+ $this->plugin_dir_url = plugin_dir_url( __FILE__ );
64
+ $this->plugin_dir_path = plugin_dir_path( __FILE__ );
65
+
66
+ // For backward compatibility
67
+ define( 'GSE_SETTINGS_FIELD', $this->settings_field );
68
+
69
+ }
70
+
71
+ /**
72
+ * Initialize.
73
+ *
74
+ * @since 2.2.0
75
+ */
76
+ public function init() {
77
+
78
+ $this->load_plugin_textdomain();
79
+
80
+ add_action( 'admin_notices', array( $this, 'requirements_notice' ) );
81
+ add_action( 'genesis_setup', array( $this, 'instantiate' ) );
82
+
83
+ }
84
+
85
+ /**
86
+ * Show admin notice if minimum requirements aren't met.
87
+ *
88
+ * @since 2.2.0
89
+ */
90
+ public function requirements_notice() {
91
+
92
+ if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, $this->min_genesis_version, '>=' ) ) {
93
+
94
+ $action = defined( 'PARENT_THEME_VERSION' ) ? __( 'upgrade to', 'genesis-simple-edits' ) : __( 'install and activate', 'genesis-simple-edits' );
95
+
96
+ $message = sprintf( __( 'Genesis Simple Edits requires WordPress %s and Genesis %s, or greater. Please %s the latest version of <a href="%s" target="_blank">Genesis</a> to use this plugin.', 'genesis-simple-edits' ), $this->min_wp_version, $this->min_genesis_version, $action, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa' );
97
+ echo '<div class="notice notice-warning"><p>' . $message . '</p></div>';
98
+
99
+ }
100
+
101
+ }
102
+
103
+ /**
104
+ * Load the plugin textdomain, for translation.
105
+ *
106
+ * @since 2.2.0
107
+ */
108
+ function load_plugin_textdomain() {
109
+ load_plugin_textdomain( $this->plugin_textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
110
+ }
111
+
112
+ /**
113
+ * Include the class file, instantiate the classes, create objects.
114
+ *
115
+ * @since 2.2.0
116
+ */
117
+ public function instantiate() {
118
+
119
+ require_once( $this->plugin_dir_path . 'includes/class-genesis-simple-edits-core.php' );
120
+ $this->core = new Genesis_Simple_Edits_Core;
121
+ $this->core->init();
122
+
123
+ require_once( $this->plugin_dir_path . 'includes/class-genesis-simple-edits-admin.php' );
124
+ $this->admin = new Genesis_Simple_Edits_Admin;
125
+ $this->admin->init();
126
+
127
+ }
128
+
129
+ }
130
+
131
+ /**
132
+ * Helper function to retrieve the static object without using globals.
133
+ *
134
+ * @since 2.2.0
135
+ */
136
+ function Genesis_Simple_Edits() {
137
+
138
+ static $object;
139
+
140
+ if ( null == $object ) {
141
+ $object = new Genesis_Simple_Edits;
142
+ }
143
+
144
+ return $object;
145
+
146
+ }
147
+
148
+ /**
149
+ * Initialize the object on `plugins_loaded`.
150
+ */
151
+ add_action( 'plugins_loaded', array( Genesis_Simple_Edits(), 'init' ) );
includes/class-genesis-simple-edits-admin.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Genesis_Simple_Edits_Admin extends Genesis_Admin_Form {
4
+
5
+ /**
6
+ * Settings field.
7
+ *
8
+ * @since 2.1.0
9
+ */
10
+ public $settings_field;
11
+
12
+ /**
13
+ * Constructor.
14
+ */
15
+ public function __construct() {
16
+
17
+ $this->settings_field = Genesis_Simple_Edits()->settings_field;
18
+
19
+ }
20
+
21
+ public function init() {
22
+
23
+ add_action( 'genesis_admin_menu', array( $this, 'admin_menu' ) );
24
+
25
+ }
26
+
27
+ /**
28
+ * Create an admin menu item and settings page.
29
+ *
30
+ * @since 1.0.0
31
+ *
32
+ * @uses Genesis_Admin::create() Register the admin page
33
+ *
34
+ * @see Genesis_Admin_Import_Export::actions() Handle creating, editing, and deleting sidebars.
35
+ */
36
+ public function admin_menu() {
37
+
38
+ $page_id = 'genesis-simple-edits';
39
+
40
+ $menu_ops = array(
41
+ 'submenu' => array(
42
+ 'parent_slug' => 'genesis',
43
+ 'page_title' => __( 'Genesis - Simple Edits', 'genesis-simple-sidebars' ),
44
+ 'menu_title' => __( 'Simple Edits', 'genesis-simple-sidebars' )
45
+ )
46
+ );
47
+
48
+ // Use Genesis default
49
+ $page_ops = array();
50
+
51
+ $this->create( $page_id, $menu_ops, $page_ops, $this->settings_field, $this->get_default_settings() );
52
+
53
+ }
54
+
55
+ /**
56
+ * Get the default settings.
57
+ *
58
+ * @since 2.2.0
59
+ */
60
+ public function get_default_settings() {
61
+
62
+ $footer_html5 = sprintf( '<p>[footer_copyright before="%s "] &middot; [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] &middot; [footer_wordpress_link] &middot; [footer_loginout]</p>', __( 'Copyright', 'genesis-simple-edits' ), __( 'On', 'genesis-simple-edits' ) );
63
+ $footer_xhtml = '<div class="gototop"><p>[footer_backtotop]</p></div><div class="creds"><p>' . __( 'Copyright', 'genesis-simple-edits' ) . ' [footer_copyright] [footer_childtheme_link] &middot; [footer_genesis_link] [footer_studiopress_link] &middot; [footer_wordpress_link] &middot; [footer_loginout]</p></div>';
64
+
65
+ return array(
66
+ 'post_info' => '[post_date] ' . __( 'By', 'genesis-simple-edits' ) . ' [post_author_posts_link] [post_comments] [post_edit]',
67
+ 'post_meta' => '[post_categories] [post_tags]',
68
+ 'footer_backtotop_text' => '[footer_backtotop]',
69
+ 'footer_creds_text' => sprintf( '[footer_copyright before="%s "] &middot; [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] &middot; [footer_wordpress_link] &middot; [footer_loginout]', __( 'Copyright', 'genesis-simple-edits' ), __( 'On', 'genesis-simple-edits' ) ),
70
+ 'footer_output_on' => 0,
71
+ 'footer_output' => current_theme_supports( 'html5' ) ? $footer_html5 : $footer_xhtml,
72
+ );
73
+
74
+ }
75
+
76
+ public function scripts() {
77
+
78
+ wp_enqueue_script( 'genesis-simple-edits-admin-js', Genesis_Simple_Edits()->plugin_dir_url . 'assets/js/admin.js', array( 'jquery' ), Genesis_Simple_Edits()->plugin_version, true );
79
+
80
+ }
81
+
82
+ /**
83
+ * Callback for displaying the Simple Sidebars admin form.
84
+ *
85
+ * @since 2.1.0
86
+ *
87
+ */
88
+ public function form() {
89
+
90
+ require_once( Genesis_Simple_Edits()->plugin_dir_path . 'includes/views/admin.php' );
91
+
92
+ }
93
+
94
+ }
includes/class-genesis-simple-edits-core.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Genesis_Simple_Edits_Core {
4
+
5
+ /**
6
+ * Settings field.
7
+ *
8
+ * @since 2.1.0
9
+ */
10
+ private $settings_field;
11
+
12
+ /**
13
+ * Constructor.
14
+ */
15
+ public function __construct() {
16
+
17
+ $this->settings_field = Genesis_Simple_Edits()->settings_field;
18
+
19
+ }
20
+
21
+ public function init() {
22
+
23
+ add_filter( 'genesis_post_info', array( $this, 'post_info_filter' ), 19 );
24
+ add_filter( 'genesis_post_meta', array( $this, 'post_meta_filter' ), 19 );
25
+ add_filter( 'genesis_footer_backtotop_text', array( $this, 'footer_backtotop_filter' ), 19 );
26
+ add_filter( 'genesis_footer_creds_text', array( $this, 'footer_creds_filter' ), 19 );
27
+ add_filter( 'genesis_footer_output', array( $this, 'footer_output_filter' ), 19 );
28
+
29
+ }
30
+
31
+
32
+ function post_info_filter( $output ) {
33
+
34
+ return genesis_get_option( 'post_info', $this->settings_field );
35
+
36
+ }
37
+
38
+ function post_meta_filter( $output ) {
39
+
40
+ return genesis_get_option( 'post_meta', $this->settings_field );
41
+
42
+ }
43
+
44
+ function footer_backtotop_filter( $output ) {
45
+
46
+ return genesis_get_option( 'footer_backtotop_text', $this->settings_field );
47
+
48
+ }
49
+
50
+ function footer_creds_filter( $output ) {
51
+
52
+ return genesis_get_option( 'footer_creds_text', $this->settings_field );
53
+
54
+ }
55
+
56
+ function footer_output_filter( $output ) {
57
+
58
+ if ( genesis_get_option( 'footer_output_on', $this->settings_field ) ) {
59
+ return genesis_get_option( 'footer_output', $this->settings_field );
60
+ }
61
+
62
+ return $output;
63
+
64
+ }
65
+
66
+ }
includes/views/admin.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table class="form-table"><tbody>
2
+
3
+ <tr>
4
+ <th scope="row"><p><label for="<?php $this->field_id( 'post_info' ); ?>"><b><?php _e( 'Entry Meta (above content)', 'genesis-simple-edits' ); ?></b></label></p></th>
5
+ <td>
6
+ <p><input type="text" name="<?php $this->field_name( 'post_info' ); ?>" id="<?php $this->field_id( 'post_info' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'post_info' ) ); ?>" size="125" /></p>
7
+ </td>
8
+ </tr>
9
+
10
+ <tr>
11
+ <th scope="row"><p><label for="<?php $this->field_id( 'post_meta' ); ?>"><b><?php _e( 'Entry Meta (below content)', 'genesis-simple-edits' ); ?></b></label></p></th>
12
+ <td>
13
+ <p><input type="text" name="<?php $this->field_name( 'post_meta' ); ?>" id="<?php $this->field_id( 'post_meta' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'post_meta' ) ); ?>" size="125" /></p>
14
+
15
+ <p><small><a class="post-shortcodes-toggle" href="#"><?php _e( 'Show available entry meta shortcodes', 'genesis-simple-edits' ) ?></a></small></p>
16
+
17
+ </td>
18
+ </tr>
19
+
20
+ <tr class="post-shortcodes" style="display: none;">
21
+ <th scope="row"><p><span class="description"><?php _e( 'Shortcode Reference', 'genesis-simple-edits' ); ?></span></p></th>
22
+ <td>
23
+ <p><span class="description"><?php printf( __( 'NOTE: For a more comprehensive shortcode usage guide, see the <a href="%s" target="_blank">post shortcode reference</a>.', 'genesis-simple-edits' ), 'http://my.studiopress.com/documentation/customization/shortcodes-reference/post-shortcode-reference/' ); ?></span></p>
24
+ <p>
25
+ <ul>
26
+ <li>[post_date] - <span class="description"><?php _e( 'Date the entry was published', 'genesis-simple-edits' ); ?></span></li>
27
+ <li>[post_modified_date] - <span class="description"><?php _e( 'Date the entry was last modified', 'genesis-simple-edits' ); ?></span></li>
28
+ <li>[post_time] - <span class="description"><?php _e( 'Time the entry was published', 'genesis-simple-edits' ); ?></span></li>
29
+ <li>[post_modified_time] - <span class="description"><?php _e( 'Time the entry was last modified', 'genesis-simple-edits' ); ?></span></li>
30
+ <li>[post_author] - <span class="description"><?php _e( 'Entry author display name', 'genesis-simple-edits' ); ?></span></li>
31
+ <li>[post_author_link] - <span class="description"><?php _e( 'Entry author display name, linked to their website', 'genesis-simple-edits' ); ?></span></li>
32
+ <li>[post_author_posts_link] - <span class="description"><?php _e( 'Entry author display name, linked to their archive', 'genesis-simple-edits' ); ?></span></li>
33
+ <li>[post_comments] - <span class="description"><?php _e( 'Entry comments link', 'genesis-simple-edits' ); ?></span></li>
34
+ <li>[post_tags] - <span class="description"><?php _e( 'List of entry tags', 'genesis-simple-edits' ); ?></span></li>
35
+ <li>[post_categories] - <span class="description"><?php _e( 'List of entry categories', 'genesis-simple-edits' ); ?></span></li>
36
+ <li>[post_edit] - <span class="description"><?php _e( 'Entry edit link (visible to admins)', 'genesis-simple-edits' ); ?></span></li>
37
+ </ul>
38
+ </p>
39
+ </td>
40
+ </tr>
41
+
42
+ <?php if ( ! genesis_html5() ) : ?>
43
+ <tr>
44
+ <th scope="row"><p><label for="<?php $this->field_id( 'footer_backtotop_text' ); ?>"><b><?php _e( 'Footer "Back to Top" Link', 'genesis-simple-edits' ); ?></b></label></p></th>
45
+ <td>
46
+ <p><input type="text" name="<?php $this->field_name( 'footer_backtotop_text' ); ?>" id="<?php $this->field_id( 'footer_backtotop_text' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'footer_backtotop_text' ) ); ?>" size="125" /></p>
47
+ </td>
48
+ </tr>
49
+ <?php endif; ?>
50
+
51
+ <tr>
52
+ <th scope="row"><p><label for="<?php $this->field_id( 'footer_creds_text' ); ?>"><b><?php _e( 'Footer Credits Text', 'genesis-simple-edits' ); ?></b></label></p></th>
53
+ <td>
54
+ <p><input type="text" name="<?php $this->field_name( 'footer_creds_text' ); ?>" id="<?php $this->field_name( 'footer_creds_text' ); ?>" value="<?php echo esc_attr( $this->get_field_value( 'footer_creds_text' ) ); ?>" size="125" /></p>
55
+ </td>
56
+ </tr>
57
+
58
+ <tr>
59
+ <th scope="row"><p><b><?php _e( 'Footer Output', 'genesis-simple-edits' ); ?></b></p></th>
60
+ <td>
61
+ <p><input type="checkbox" name="<?php $this->field_name( 'footer_output_on' ); ?>" id="<?php $this->field_id( 'footer_output_on' ); ?>" value="1" <?php checked( 1, $this->get_field_value( 'footer_output_on' ) ); ?> /> <label for="<?php $this->field_id( 'footer_output_on' ); ?>"><?php _e( 'Modify Entire Footer Text (including markup)?', 'genesis-simple-edits' ); ?></label></p>
62
+
63
+ <p><span class="description"><?php _e( 'NOTE: Checking this option will use the content of the box below, and override the options above.', 'genesis-simple-edits' ); ?></span></p>
64
+
65
+ <p><textarea name="<?php $this->field_name( 'footer_output' ); ?>" cols="80" rows="5"><?php echo esc_textarea( $this->get_field_value( 'footer_output' ) ); ?></textarea></p>
66
+
67
+ <p><small><a class="footer-shortcodes-toggle" href="#"><?php _e( 'Show available footer shortcodes', 'genesis-simple-edits' ); ?></a></small></p>
68
+ </td>
69
+ </tr>
70
+
71
+ <tr class="footer-shortcodes" style="display: none;">
72
+ <th scope="row"><p><span class="description"><?php _e( 'Shortcode Reference', 'genesis-simple-edits' ); ?></span></p></th>
73
+ <td>
74
+ <p><span class="description"><?php printf( __( 'NOTE: For a more comprehensive shortcode usage guide, see the <a href="%s" target="_blank">footer shortcode reference</a>.', 'genesis-simple-edits' ), 'http://my.studiopress.com/documentation/customization/shortcodes-reference/footer-shortcode-reference/' ); ?></span></p>
75
+ <p>
76
+ <ul>
77
+ <?php if ( ! genesis_html5() ) : ?>
78
+ <li>[footer_backtotop] - <span class="description"><?php _e( 'The "Back to Top" Link', 'genesis-simple-edits'); ?></span></li>
79
+ <?php endif; ?>
80
+ <li>[footer_copyright] - <span class="description"><?php _e( 'The Copyright notice', 'genesis-simple-edits' ); ?></span></li>
81
+ <li>[footer_childtheme_link] - <span class="description"><?php _e( 'The Child Theme Link', 'genesis-simple-edits' ); ?></span></li>
82
+ <li>[footer_genesis_link] - <span class="description"><?php _e( 'The Genesis Link', 'genesis-simple-edits' ); ?></span></li>
83
+ <li>[footer_studiopress_link] - <span class="description"><?php _e( 'The StudioPress Link', 'genesis-simple-edits' ); ?></span></li>
84
+ <li>[footer_wordpress_link] - <span class="description"><?php _e( 'The WordPress Link', 'genesis-simple-edits' ); ?></span></li>
85
+ <li>[footer_loginout] - <span class="description"><?php _e( 'Log In/Out Link', 'genesis-simple-edits' ); ?></span></li>
86
+ </ul>
87
+ </p>
88
+ </td>
89
+ </tr>
90
+
91
+ </tbody></table>
package.json CHANGED
@@ -29,7 +29,7 @@
29
  "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.",
30
  "author": "StudioPress",
31
  "authoruri": "http://www.studiopress.com/",
32
- "version": "2.1.4",
33
  "license": "GPL-2.0+",
34
  "licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
35
  "textdomain": "genesis-simple-edits"
29
  "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.",
30
  "author": "StudioPress",
31
  "authoruri": "http://www.studiopress.com/",
32
+ "version": "2.1.3",
33
  "license": "GPL-2.0+",
34
  "licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
35
  "textdomain": "genesis-simple-edits"
plugin.php CHANGED
@@ -1,267 +1,20 @@
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: 2.1.4
10
 
11
- Text Domain: genesis-simple-edits
12
- Domain Path: /languages
13
 
14
- License: GNU General Public License v2.0 (or later)
15
- License URI: http://www.opensource.org/licenses/gpl-license.php
16
- */
17
-
18
- /**
19
- * The main class that handles the entire output, content filters, etc., for this plugin.
20
- *
21
- * @package Genesis Simple Edits
22
- * @since 1.0
23
- */
24
- class Genesis_Simple_Edits {
25
-
26
- /** Constructor */
27
- function __construct() {
28
-
29
- register_activation_hook( __FILE__, array( $this, 'activation_hook' ) );
30
-
31
- define( 'GSE_SETTINGS_FIELD', 'gse-settings' );
32
-
33
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
34
-
35
- add_action( 'admin_init', array( $this, 'javascript' ) );
36
- add_action( 'admin_init', array( $this, 'reset' ) );
37
- add_action( 'admin_init', array( $this, 'register_settings' ) );
38
- add_action( 'admin_menu', array( $this, 'add_menu' ), 15 );
39
- add_action( 'admin_notices', array( $this, 'notices' ) );
40
-
41
- add_filter( 'genesis_post_info', array( $this, 'post_info_filter' ), 20 );
42
- add_filter( 'genesis_post_meta', array( $this, 'post_meta_filter' ), 20 );
43
- add_filter( 'genesis_footer_backtotop_text', array( $this, 'footer_backtotop_filter' ), 20 );
44
- add_filter( 'genesis_footer_creds_text', array( $this, 'footer_creds_filter' ), 20 );
45
- add_filter( 'genesis_footer_output', array( $this, 'footer_output_filter' ), 20 );
46
-
47
- }
48
-
49
- function activation_hook() {
50
-
51
- if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.1.0', '>=' ) ) {
52
- deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
53
- wp_die( sprintf( __( 'Sorry, you cannot activate without <a href="%s">Genesis %s</a> or greater', 'genesis-simple-edits' ), 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', '2.1.0' ) );
54
- }
55
-
56
- }
57
-
58
- function load_textdomain() {
59
- load_plugin_textdomain( 'genesis-simple-edits', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
60
- }
61
-
62
- function javascript() {
63
-
64
- wp_enqueue_script( 'genesis-simple-edits-js', plugin_dir_url(__FILE__) . 'js/admin.js', array( 'jquery' ), '2.1.0', true );
65
-
66
- }
67
-
68
- function register_settings() {
69
- register_setting( GSE_SETTINGS_FIELD, GSE_SETTINGS_FIELD );
70
- add_option( GSE_SETTINGS_FIELD, $this->settings_defaults() );
71
- }
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;
82
- }
83
-
84
- }
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', 'genesis-simple-edits' ) . '</strong></p></div>';
93
- }
94
- elseif ( isset( $_REQUEST['updated'] ) && 'true' == $_REQUEST['updated'] ) {
95
- echo '<div id="message" class="updated"><p><strong>' . __( 'Simple Edits Saved', 'genesis-simple-edits' ) . '</strong></p></div>';
96
- }
97
-
98
- }
99
-
100
- function settings_defaults() {
101
-
102
- $footer_html5 = sprintf( '<p>[footer_copyright before="%s "] &middot; [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] &middot; [footer_wordpress_link] &middot; [footer_loginout]</p>', __( 'Copyright', 'genesis-simple-edits' ), __( 'On', 'genesis-simple-edits' ) );
103
- $footer_xhtml = '<div class="gototop"><p>[footer_backtotop]</p></div><div class="creds"><p>' . __( 'Copyright', 'genesis-simple-edits' ) . ' [footer_copyright] [footer_childtheme_link] &middot; [footer_genesis_link] [footer_studiopress_link] &middot; [footer_wordpress_link] &middot; [footer_loginout]</p></div>';
104
-
105
- return array(
106
- 'post_info' => '[post_date] ' . __( 'By', 'genesis-simple-edits' ) . ' [post_author_posts_link] [post_comments] [post_edit]',
107
- 'post_meta' => '[post_categories] [post_tags]',
108
- 'footer_backtotop_text' => '[footer_backtotop]',
109
- 'footer_creds_text' => sprintf( '[footer_copyright before="%s "] &middot; [footer_childtheme_link before="" after=" %s"] [footer_genesis_link url="http://www.studiopress.com/" before=""] &middot; [footer_wordpress_link] &middot; [footer_loginout]', __( 'Copyright', 'genesis-simple-edits' ), __( 'On', 'genesis-simple-edits' ) ),
110
- 'footer_output_on' => 0,
111
- 'footer_output' => current_theme_supports( 'html5' ) ? $footer_html5 : $footer_xhtml,
112
- );
113
-
114
- }
115
-
116
- function add_menu() {
117
-
118
- add_submenu_page( 'genesis', __( 'Genesis - Simple Edits', 'genesis-simple-edits' ), __( 'Simple Edits','genesis-simple-edits' ), 'manage_options', 'genesis-simple-edits', array( &$this, 'admin_page' ) );
119
-
120
- }
121
-
122
- function admin_page() { ?>
123
-
124
- <div class="wrap">
125
- <form method="post" action="options.php">
126
- <?php settings_fields( GSE_SETTINGS_FIELD ); // important! ?>
127
 
128
- <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>
 
129
 
130
- <table class="form-table"><tbody>
131
-
132
- <tr>
133
- <th scope="row"><p><label for="<?php echo GSE_SETTINGS_FIELD; ?>[post_info]"><b><?php _e( 'Entry Meta (above content)', 'genesis-simple-edits' ); ?></b></label></p></th>
134
- <td>
135
- <p><input type="text" name="<?php echo GSE_SETTINGS_FIELD; ?>[post_info]" id="<?php echo GSE_SETTINGS_FIELD; ?>[post_info]" value="<?php echo esc_attr( genesis_get_option( 'post_info', GSE_SETTINGS_FIELD ) ); ?>" size="125" /></p>
136
- </td>
137
- </tr>
138
-
139
- <tr>
140
- <th scope="row"><p><label for="<?php echo GSE_SETTINGS_FIELD; ?>[post_meta]"><b><?php _e( 'Entry Meta (below content)', 'genesis-simple-edits' ); ?></b></label></p></th>
141
- <td>
142
- <p><input type="text" name="<?php echo GSE_SETTINGS_FIELD; ?>[post_meta]" id="<?php echo GSE_SETTINGS_FIELD; ?>[post_meta]" value="<?php echo esc_attr( genesis_get_option( 'post_meta', GSE_SETTINGS_FIELD ) ); ?>" size="125" /></p>
143
-
144
- <p><small><a class="post-shortcodes-toggle" href="#"><?php _e( 'Show available entry meta shortcodes', 'genesis-simple-edits' ) ?></a></small></p>
145
-
146
- </td>
147
- </tr>
148
-
149
- <tr class="post-shortcodes" style="display: none;">
150
- <th scope="row"><p><span class="description"><?php _e( 'Shortcode Reference', 'genesis-simple-edits' ); ?></span></p></th>
151
- <td>
152
- <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>.', 'genesis-simple-edits' ); ?>
153
- <p>
154
- <ul>
155
- <li>[post_date] - <span class="description"><?php _e( 'Date the entry was published', 'genesis-simple-edits' ); ?></span></li>
156
- <li>[post_modified_date] - <span class="description"><?php _e( 'Date the entry was last modified', 'genesis-simple-edits' ); ?></span></li>
157
- <li>[post_time] - <span class="description"><?php _e( 'Time the entry was published', 'genesis-simple-edits' ); ?></span></li>
158
- <li>[post_modified_time] - <span class="description"><?php _e( 'Time the entry was last modified', 'genesis-simple-edits' ); ?></span></li>
159
- <li>[post_author] - <span class="description"><?php _e( 'Entry author display name', 'genesis-simple-edits' ); ?></span></li>
160
- <li>[post_author_link] - <span class="description"><?php _e( 'Entry author display name, linked to their website', 'genesis-simple-edits' ); ?></span></li>
161
- <li>[post_author_posts_link] - <span class="description"><?php _e( 'Entry author display name, linked to their archive', 'genesis-simple-edits' ); ?></span></li>
162
- <li>[post_comments] - <span class="description"><?php _e( 'Entry comments link', 'genesis-simple-edits' ); ?></span></li>
163
- <li>[post_tags] - <span class="description"><?php _e( 'List of entry tags', 'genesis-simple-edits' ); ?></span></li>
164
- <li>[post_categories] - <span class="description"><?php _e( 'List of entry categories', 'genesis-simple-edits' ); ?></span></li>
165
- <li>[post_edit] - <span class="description"><?php _e( 'Entry edit link (visible to admins)', 'genesis-simple-edits' ); ?></span></li>
166
- </ul>
167
- </p>
168
- </td>
169
- </tr>
170
-
171
- <?php if ( ! genesis_html5() ) : ?>
172
- <tr>
173
- <th scope="row"><p><label for="<?php echo GSE_SETTINGS_FIELD; ?>[footer_backtotop_text]"><b><?php _e( 'Footer "Back to Top" Link', 'genesis-simple-edits' ); ?></b></label></p></th>
174
- <td>
175
- <p><input type="text" name="<?php echo GSE_SETTINGS_FIELD; ?>[footer_backtotop_text]" id="<?php echo GSE_SETTINGS_FIELD; ?>[footer_backtotop_text]" value="<?php echo esc_attr( genesis_get_option( 'footer_backtotop_text', GSE_SETTINGS_FIELD ) ); ?>" size="125" /></p>
176
- </td>
177
- </tr>
178
- <?php endif; ?>
179
-
180
- <tr>
181
- <th scope="row"><p><label for="<?php echo GSE_SETTINGS_FIELD; ?>[footer_creds_text]"><b><?php _e( 'Footer Credits Text', 'genesis-simple-edits' ); ?></b></label></p></th>
182
- <td>
183
- <p><input type="text" name="<?php echo GSE_SETTINGS_FIELD; ?>[footer_creds_text]" id="<?php echo GSE_SETTINGS_FIELD; ?>[footer_creds_text]" value="<?php echo esc_attr( genesis_get_option( 'footer_creds_text', GSE_SETTINGS_FIELD ) ); ?>" size="125" /></p>
184
- </td>
185
- </tr>
186
-
187
- <tr>
188
- <th scope="row"><p><b><?php _e( 'Footer Output', 'genesis-simple-edits' ); ?></b></p></th>
189
- <td>
190
- <p><input type="checkbox" name="<?php echo GSE_SETTINGS_FIELD; ?>[footer_output_on]" id="<?php echo GSE_SETTINGS_FIELD; ?>[footer_output_on]" value="1" <?php checked( 1, genesis_get_option( 'footer_output_on', GSE_SETTINGS_FIELD ) ); ?> /> <label for="<?php echo GSE_SETTINGS_FIELD; ?>[footer_output_on]"><?php _e( 'Modify Entire Footer Text (including markup)?', 'genesis-simple-edits' ); ?></label></p>
191
-
192
- <p><span class="description"><?php _e( 'NOTE: Checking this option will use the content of the box below, and override the options above.', 'genesis-simple-edits' ); ?></span></p>
193
-
194
- <p><textarea name="<?php echo GSE_SETTINGS_FIELD; ?>[footer_output]" cols="80" rows="5"><?php echo esc_textarea( genesis_get_option( 'footer_output', GSE_SETTINGS_FIELD ) ); ?></textarea></p>
195
-
196
- <p><small><a class="footer-shortcodes-toggle" href="#"><?php _e( 'Show available footer shortcodes', 'genesis-simple-edits' ); ?></a></small></p>
197
- </td>
198
- </tr>
199
-
200
- <tr class="footer-shortcodes" style="display: none;">
201
- <th scope="row"><p><span class="description"><?php _e( 'Shortcode Reference', 'genesis-simple-edits' ); ?></span></p></th>
202
- <td>
203
- <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>.', 'genesis-simple-edits' ); ?>
204
- <p>
205
- <ul>
206
- <?php if ( ! genesis_html5() ) : ?>
207
- <li>[footer_backtotop] - <span class="description"><?php _e( 'The "Back to Top" Link', 'genesis-simple-edits'); ?></span></li>
208
- <?php endif; ?>
209
- <li>[footer_copyright] - <span class="description"><?php _e( 'The Copyright notice', 'genesis-simple-edits' ); ?></span></li>
210
- <li>[footer_childtheme_link] - <span class="description"><?php _e( 'The Child Theme Link', 'genesis-simple-edits' ); ?></span></li>
211
- <li>[footer_genesis_link] - <span class="description"><?php _e( 'The Genesis Link', 'genesis-simple-edits' ); ?></span></li>
212
- <li>[footer_studiopress_link] - <span class="description"><?php _e( 'The StudioPress Link', 'genesis-simple-edits' ); ?></span></li>
213
- <li>[footer_wordpress_link] - <span class="description"><?php _e( 'The WordPress Link', 'genesis-simple-edits' ); ?></span></li>
214
- <li>[footer_loginout] - <span class="description"><?php _e( 'Log In/Out Link', 'genesis-simple-edits' ); ?></span></li>
215
- </ul>
216
- </p>
217
- </td>
218
- </tr>
219
-
220
- </tbody></table>
221
-
222
- <div class="bottom-buttons">
223
- <input type="submit" class="button-primary" value="<?php _e( 'Save Settings', 'genesis-simple-edits' ); ?>" />
224
- <input type="submit" class="button-secondary" name="<?php echo GSE_SETTINGS_FIELD; ?>[reset]" value="<?php _e( 'Reset Settings', 'genesis-simple-edits' ); ?>" />
225
- </div>
226
-
227
- </form>
228
- </div>
229
-
230
- <?php }
231
-
232
- function post_info_filter( $output ) {
233
-
234
- return genesis_get_option( 'post_info', GSE_SETTINGS_FIELD );
235
-
236
- }
237
-
238
- function post_meta_filter( $output ) {
239
-
240
- return genesis_get_option( 'post_meta', GSE_SETTINGS_FIELD );
241
-
242
- }
243
-
244
- function footer_backtotop_filter( $output ) {
245
-
246
- return genesis_get_option( 'footer_backtotop_text', GSE_SETTINGS_FIELD );
247
-
248
- }
249
-
250
- function footer_creds_filter( $output ) {
251
-
252
- return genesis_get_option( 'footer_creds_text', GSE_SETTINGS_FIELD );
253
-
254
- }
255
-
256
- function footer_output_filter( $output ) {
257
-
258
- if ( genesis_get_option( 'footer_output_on', GSE_SETTINGS_FIELD ) )
259
- return genesis_get_option( 'footer_output', GSE_SETTINGS_FIELD );
260
-
261
- return $output;
262
-
263
- }
264
-
265
- }
266
 
267
- $Genesis_Simple_Edits = new Genesis_Simple_Edits;
1
  <?php
2
  /*
3
+ Plugin Name: Genesis Simple Edits
4
+ Plugin URI: http://www.studiopress.com/plugins/genesis-simple-edits
 
 
 
5
 
6
+ 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.
7
 
8
+ Author: StudioPress
9
+ Author URI: http://www.studiopress.com/
10
 
11
+ Version: 2.2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
+ Text Domain: genesis-simple-edits
14
+ Domain Path: /languages
15
 
16
+ License: GNU General Public License v2.0 (or later)
17
+ License URI: http://www.opensource.org/licenses/gpl-license.php
18
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
+ require_once( plugin_dir_path( __FILE__ ) . 'genesis-simple-edits.php' );
readme.txt CHANGED
@@ -2,9 +2,9 @@
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: 4.3.1
7
- Stable tag: 2.1.4
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
 
@@ -27,18 +27,15 @@ This plugin creates a new Genesis settings page that allows you to modify the po
27
 
28
  Check out the [Shortcodes API](http://codex.wordpress.org/Shortcode_API) for an explanation, and our [Shortcode Reference](http://dev.studiopress.com/shortcode-reference) for a list of available Genesis-specific shortcodes.
29
 
30
- = My PHP isn't working =
31
-
32
- This plugin is not designed to work with PHP code.
33
-
34
  = The plugin won't activate =
35
 
36
- You must have Genesis (1.3+) or a Genesis child theme installed and activated on your site.
37
 
38
  == Changelog ==
39
 
40
- = 2.1.4 =
41
- * Fix typo warning in textdomain loader
 
42
 
43
  = 2.1.3 =
44
  * add textdomain loader
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: 4.7.2
6
+ Tested up to: 4.7.3
7
+ Stable tag: 2.2.0
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
 
27
 
28
  Check out the [Shortcodes API](http://codex.wordpress.org/Shortcode_API) for an explanation, and our [Shortcode Reference](http://dev.studiopress.com/shortcode-reference) for a list of available Genesis-specific shortcodes.
29
 
 
 
 
 
30
  = The plugin won't activate =
31
 
32
+ You must have Genesis (2.4.2+) or a Genesis child theme installed and activated on your site.
33
 
34
  == Changelog ==
35
 
36
+ = 2.2.0 =
37
+ * Rewrite based in plugin boilerplate.
38
+ * Update Author and Author URI.
39
 
40
  = 2.1.3 =
41
  * add textdomain loader