Version Description
- Genesis 3.0 compatibility. Added the theme settings to customizer.
Download this release
Release Info
Developer | billerickson |
Plugin | Genesis Title Toggle |
Version | 1.9.0 |
Comparing to | |
See all releases |
Code changes from version 1.8.0 to 1.9.0
- genesis-title-toggle.php +37 -2
- readme.txt +7 -4
genesis-title-toggle.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: When using the Genesis Theme framework, this plugin allows you to turn on/off page titles on a per page basis, and set sitewide defaults from Theme Settings.
|
6 |
* Author: Bill Erickson
|
7 |
* Author URI: https://www.billerickson.net
|
8 |
-
* Version: 1.
|
9 |
* Text Domain: genesis-title-toggle
|
10 |
* Domain Path: languages
|
11 |
*
|
@@ -63,11 +63,14 @@ class BE_Title_Toggle {
|
|
63 |
// Translations
|
64 |
load_plugin_textdomain( 'genesis-title-toggle', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
65 |
|
66 |
-
// Metabox on Theme Settings, for Sitewide Default
|
67 |
add_filter( 'genesis_theme_settings_defaults', array( $this, 'settings_defaults' ) );
|
68 |
add_action( 'genesis_settings_sanitizer_init', array( $this, 'settings_sanitization' ) );
|
69 |
add_action( 'genesis_theme_settings_metaboxes', array( $this, 'settings_register_metabox' ) );
|
70 |
|
|
|
|
|
|
|
71 |
// Pages metaboxes
|
72 |
add_action( 'add_meta_boxes', array( $this, 'metabox_register' ) );
|
73 |
add_action( 'save_post', array( $this, 'metabox_save' ), 1, 2 );
|
@@ -158,6 +161,34 @@ class BE_Title_Toggle {
|
|
158 |
}
|
159 |
}
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
/**
|
162 |
* Register the metabox
|
163 |
*
|
@@ -370,6 +401,10 @@ class BE_Title_Toggle {
|
|
370 |
remove_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_post_title' );
|
371 |
break;
|
372 |
|
|
|
|
|
|
|
|
|
373 |
case 'Business Pro Theme':
|
374 |
remove_action( 'business_page_header', 'business_page_title', 10 );
|
375 |
break;
|
5 |
* Description: When using the Genesis Theme framework, this plugin allows you to turn on/off page titles on a per page basis, and set sitewide defaults from Theme Settings.
|
6 |
* Author: Bill Erickson
|
7 |
* Author URI: https://www.billerickson.net
|
8 |
+
* Version: 1.9.0
|
9 |
* Text Domain: genesis-title-toggle
|
10 |
* Domain Path: languages
|
11 |
*
|
63 |
// Translations
|
64 |
load_plugin_textdomain( 'genesis-title-toggle', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
65 |
|
66 |
+
// Genesis 2.x: Metabox on Theme Settings, for Sitewide Default
|
67 |
add_filter( 'genesis_theme_settings_defaults', array( $this, 'settings_defaults' ) );
|
68 |
add_action( 'genesis_settings_sanitizer_init', array( $this, 'settings_sanitization' ) );
|
69 |
add_action( 'genesis_theme_settings_metaboxes', array( $this, 'settings_register_metabox' ) );
|
70 |
|
71 |
+
// Genesis 3.x: Theme settings in customizer
|
72 |
+
add_filter( 'genesis_customizer_theme_settings_config', array( $this, 'customizer_settings' ) );
|
73 |
+
|
74 |
// Pages metaboxes
|
75 |
add_action( 'add_meta_boxes', array( $this, 'metabox_register' ) );
|
76 |
add_action( 'save_post', array( $this, 'metabox_save' ), 1, 2 );
|
161 |
}
|
162 |
}
|
163 |
|
164 |
+
/**
|
165 |
+
* Customizer settings
|
166 |
+
*
|
167 |
+
* @since 1.9.0
|
168 |
+
*/
|
169 |
+
public function customizer_settings( array $config ) {
|
170 |
+
$controls = array();
|
171 |
+
$post_types = apply_filters( 'be_title_toggle_post_types', array( 'page' ) );
|
172 |
+
foreach( $post_types as $post_type ) {
|
173 |
+
$controls['be_title_toggle_' . $post_type ] = array(
|
174 |
+
'label' => ucfirst( $post_type ),
|
175 |
+
'description' => sprintf( __( 'By default, remove titles in the <strong>%s</strong> post type.', 'genesis-title-toggle' ), $post_type ),
|
176 |
+
'section' => 'title_toggle',
|
177 |
+
'type' => 'checkbox',
|
178 |
+
'settings' => array(
|
179 |
+
'default' => 0,
|
180 |
+
),
|
181 |
+
|
182 |
+
);
|
183 |
+
}
|
184 |
+
$config['genesis']['sections']['title_toggle'] = array(
|
185 |
+
'title' => __( 'Title Toggle', 'genesis-title-toggle' ),
|
186 |
+
'panel' => 'genesis',
|
187 |
+
'controls' => $controls,
|
188 |
+
);
|
189 |
+
return $config;
|
190 |
+
}
|
191 |
+
|
192 |
/**
|
193 |
* Register the metabox
|
194 |
*
|
401 |
remove_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_post_title' );
|
402 |
break;
|
403 |
|
404 |
+
case 'Business Pro':
|
405 |
+
remove_action( 'genesis_after_header', 'business_page_header_title', 24 );
|
406 |
+
break;
|
407 |
+
|
408 |
case 'Business Pro Theme':
|
409 |
remove_action( 'business_page_header', 'business_page_title', 10 );
|
410 |
break;
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: billerickson
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EDYM76U6BTE5L
|
4 |
Tags: genesis, genesiswp, title,
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
This plugin ONLY works with the Genesis theme. Do not install if you are not using Genesis.
|
10 |
|
@@ -16,7 +16,7 @@ This plugin ONLY works with the Genesis theme. Do not install if you are not usi
|
|
16 |
|
17 |
This plugin lets you easily remove the page title from specific pages. Don't want "Home" at the top of your homepage? Activate, then edit the homepage and check "Hide".
|
18 |
|
19 |
-
You can also set sitewide defaults. If you don't want page titles on any pages, go to
|
20 |
|
21 |
See [the wiki](https://github.com/billerickson/genesis-title-toggle/wiki) for information on extending the plugin:
|
22 |
- [Use on Posts or Custom Post Types](https://github.com/billerickson/genesis-title-toggle/wiki#use-on-posts-or-custom-post-types)
|
@@ -31,7 +31,7 @@ See [the wiki](https://github.com/billerickson/genesis-title-toggle/wiki) for in
|
|
31 |
|
32 |
3. When editing a page, go down to the Title Toggle metabox and check "hide" to hide that page's title.
|
33 |
|
34 |
-
4. (Optional) Go to
|
35 |
|
36 |
|
37 |
== Screenshots ==
|
@@ -44,6 +44,9 @@ See [the wiki](https://github.com/billerickson/genesis-title-toggle/wiki) for in
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
47 |
= 1.8.0 =
|
48 |
* Added support for all StudioPress child themes
|
49 |
* Added `be_title_toggle_remove` action for custom theme integration
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EDYM76U6BTE5L
|
4 |
Tags: genesis, genesiswp, title,
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 5.2
|
7 |
+
Stable tag: 1.9.0
|
8 |
|
9 |
This plugin ONLY works with the Genesis theme. Do not install if you are not using Genesis.
|
10 |
|
16 |
|
17 |
This plugin lets you easily remove the page title from specific pages. Don't want "Home" at the top of your homepage? Activate, then edit the homepage and check "Hide".
|
18 |
|
19 |
+
You can also set sitewide defaults. If you don't want page titles on any pages, go to Appearance > Customize > Theme Settings > Title Toggle and check the appropriate box. Once a post type has the default set to remove, when editing a page you can selectively turn on that page's title.
|
20 |
|
21 |
See [the wiki](https://github.com/billerickson/genesis-title-toggle/wiki) for information on extending the plugin:
|
22 |
- [Use on Posts or Custom Post Types](https://github.com/billerickson/genesis-title-toggle/wiki#use-on-posts-or-custom-post-types)
|
31 |
|
32 |
3. When editing a page, go down to the Title Toggle metabox and check "hide" to hide that page's title.
|
33 |
|
34 |
+
4. (Optional) Go to Appearanc > Customize > Theme Settings > Title Toggle to remove titles on all pages by default.
|
35 |
|
36 |
|
37 |
== Screenshots ==
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
+
= 1.9.0 =
|
48 |
+
* Genesis 3.0 compatibility. Added the theme settings to customizer.
|
49 |
+
|
50 |
= 1.8.0 =
|
51 |
* Added support for all StudioPress child themes
|
52 |
* Added `be_title_toggle_remove` action for custom theme integration
|