Permalink
Browse files

Use get_admin_page_title() for page titles.

  • Loading branch information...
1 parent 63ec6ab commit 28b2ca901d663f60dc643dce1e3d5c1b8ea5be9a Michael Sisk committed Feb 3, 2013
Showing with 35 additions and 35 deletions.
  1. +1 −1 -/php/commerce.php
  2. +33 −33 -/php/config.php
  3. +1 −1 -/php/legacy.php
View
2 -/php/commerce.php
@@ -58,7 +58,7 @@ public function page() {
?>
<div class="wrap">
<div id="icon-tools" class="icon32"></div>
- <h2><?php _e( 'Webcomic Commerce', 'webcomic' ); ?></h2>
+ <h2><?php echo get_admin_page_title(); ?></h2>
<br>
<table class="wp-list-table widefat fixed">
<thead>
View
66 -/php/config.php
@@ -145,7 +145,7 @@ public function admin_init() {
* @hook admin_menu
*/
public function admin_menu() {
- add_submenu_page( 'options-general.php', __( 'Webcomic', 'webcomic' ), __( 'Webcomic', 'webcomic' ), 'manage_options', 'webcomic-options', array( $this, 'page' ) );
+ add_submenu_page( 'options-general.php', __( 'Webcomic Settings', 'webcomic' ), __( 'Webcomic', 'webcomic' ), 'manage_options', 'webcomic-options', array( $this, 'page' ) );
foreach ( self::$config[ 'collections' ] as $k => $v ) {
add_submenu_page( "edit.php?post_type={$k}", sprintf( __( '%s Settings', 'webcomic' ), esc_html( $v[ 'name' ] ) ), __( 'Settings', 'webcomic' ), 'manage_options', "{$k}-options", array( $this, 'page' ) );
@@ -169,38 +169,6 @@ public function admin_enqueue_scripts() {
}
}
- /** Render a settings page.
- *
- * @uses Webcomic::$config
- * @uses Webcomic::$version
- */
- public function page() {
- $page = empty( $_GET[ 'post_type' ] ) ? 'webcomic-options' : "{$_GET[ 'post_type' ]}-options";
- ?>
- <div class="wrap" >
- <div id="icon-options-general" class="icon32" data-webcomic-admin-url="<?php echo admin_url(); ?>"></div>
- <h2><?php echo 'webcomic-options' === $page ? __( 'Webcomic Settings', 'webcomic' ) : sprintf( __( '%s Settings', 'webcomic' ), esc_html( self::$config[ 'collections' ][ $_GET[ 'post_type' ] ][ 'name' ] ) ); ?></h2>
- <form action="options.php" method="post"<?php echo 'webcomic' !== $page ? ' enctype="multipart/form-data"' : ''; ?>>
- <?php
- settings_fields( 'webcomic-options' );
- do_settings_sections( $page );
-
- echo 'webcomic-options' === $page ? '<input type="hidden" name="webcomic_general" value="1">' : sprintf( '<input type="hidden" name="webcomic_collection" value="%s">', $_GET[ 'post_type' ] );
- ?>
- <p class="submit">
- <?php
- submit_button( '', 'primary', '', false );
-
- if ( 'webcomic-options' === $page ) {
- printf( '<span class="alignright">%s</span>', sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Webcomic %2$s</a>', 'webcomic' ), 'http://webcomic.nu', self::$version ) );
- }
- ?>
- </p>
- </form>
- </div>
- <?php
- }
-
/** Render the Integrate setting.
*
* @uses Webcomic::$config
@@ -1140,6 +1108,38 @@ private function save_sizes() {
}
}
+ /** Render a settings page.
+ *
+ * @uses Webcomic::$config
+ * @uses Webcomic::$version
+ */
+ public function page() {
+ $page = empty( $_GET[ 'post_type' ] ) ? 'webcomic-options' : "{$_GET[ 'post_type' ]}-options";
+ ?>
+ <div class="wrap" >
+ <div id="icon-options-general" class="icon32" data-webcomic-admin-url="<?php echo admin_url(); ?>"></div>
+ <h2><?php echo get_admin_page_title(); ?></h2>
+ <form action="options.php" method="post"<?php echo 'webcomic' !== $page ? ' enctype="multipart/form-data"' : ''; ?>>
+ <?php
+ settings_fields( 'webcomic-options' );
+ do_settings_sections( $page );
+
+ echo 'webcomic-options' === $page ? '<input type="hidden" name="webcomic_general" value="1">' : sprintf( '<input type="hidden" name="webcomic_collection" value="%s">', $_GET[ 'post_type' ] );
+ ?>
+ <p class="submit">
+ <?php
+ submit_button( '', 'primary', '', false );
+
+ if ( 'webcomic-options' === $page ) {
+ printf( '<span class="alignright">%s</span>', sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Webcomic %2$s</a>', 'webcomic' ), 'http://webcomic.nu', self::$version ) );
+ }
+ ?>
+ </p>
+ </form>
+ </div>
+ <?php
+ }
+
/** Generic settings section callback.
*
* Most sections don't include a description, but if permalinks are
View
2 -/php/legacy.php
@@ -190,7 +190,7 @@ public function page() {
?>
<div class="wrap">
<div id="icon-tools" class="icon32"></div>
- <h2><?php _e( 'Upgrade Webcomic', 'webcomic' ); ?></h2>
+ <h2><?php echo get_admin_page_title(); ?></h2>
<div id="col-left">
<div class="col-wrap">
<?php if ( isset( $_POST[ 'webcomic_upgrade_status' ] ) and 0 === $_POST[ 'webcomic_upgrade_status' ] ) { ?>

0 comments on commit 28b2ca9

Please sign in to comment.