Skip to content
This repository
Browse code

Use get_admin_page_title() for page titles.

  • Loading branch information...
commit 28b2ca901d663f60dc643dce1e3d5c1b8ea5be9a 1 parent 63ec6ab
Michael Sisk authored

Showing 3 changed files with 35 additions and 35 deletions. Show diff stats Hide diff stats

  1. +1 1  -/php/commerce.php
  2. +33 33 -/php/config.php
  3. +1 1  -/php/legacy.php
2  -/php/commerce.php
@@ -58,7 +58,7 @@ public function page() {
58 58 ?>
59 59 <div class="wrap">
60 60 <div id="icon-tools" class="icon32"></div>
61   - <h2><?php _e( 'Webcomic Commerce', 'webcomic' ); ?></h2>
  61 + <h2><?php echo get_admin_page_title(); ?></h2>
62 62 <br>
63 63 <table class="wp-list-table widefat fixed">
64 64 <thead>
66 -/php/config.php
@@ -145,7 +145,7 @@ public function admin_init() {
145 145 * @hook admin_menu
146 146 */
147 147 public function admin_menu() {
148   - add_submenu_page( 'options-general.php', __( 'Webcomic', 'webcomic' ), __( 'Webcomic', 'webcomic' ), 'manage_options', 'webcomic-options', array( $this, 'page' ) );
  148 + add_submenu_page( 'options-general.php', __( 'Webcomic Settings', 'webcomic' ), __( 'Webcomic', 'webcomic' ), 'manage_options', 'webcomic-options', array( $this, 'page' ) );
149 149
150 150 foreach ( self::$config[ 'collections' ] as $k => $v ) {
151 151 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() {
169 169 }
170 170 }
171 171
172   - /** Render a settings page.
173   - *
174   - * @uses Webcomic::$config
175   - * @uses Webcomic::$version
176   - */
177   - public function page() {
178   - $page = empty( $_GET[ 'post_type' ] ) ? 'webcomic-options' : "{$_GET[ 'post_type' ]}-options";
179   - ?>
180   - <div class="wrap" >
181   - <div id="icon-options-general" class="icon32" data-webcomic-admin-url="<?php echo admin_url(); ?>"></div>
182   - <h2><?php echo 'webcomic-options' === $page ? __( 'Webcomic Settings', 'webcomic' ) : sprintf( __( '%s Settings', 'webcomic' ), esc_html( self::$config[ 'collections' ][ $_GET[ 'post_type' ] ][ 'name' ] ) ); ?></h2>
183   - <form action="options.php" method="post"<?php echo 'webcomic' !== $page ? ' enctype="multipart/form-data"' : ''; ?>>
184   - <?php
185   - settings_fields( 'webcomic-options' );
186   - do_settings_sections( $page );
187   -
188   - echo 'webcomic-options' === $page ? '<input type="hidden" name="webcomic_general" value="1">' : sprintf( '<input type="hidden" name="webcomic_collection" value="%s">', $_GET[ 'post_type' ] );
189   - ?>
190   - <p class="submit">
191   - <?php
192   - submit_button( '', 'primary', '', false );
193   -
194   - if ( 'webcomic-options' === $page ) {
195   - 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 ) );
196   - }
197   - ?>
198   - </p>
199   - </form>
200   - </div>
201   - <?php
202   - }
203   -
204 172 /** Render the Integrate setting.
205 173 *
206 174 * @uses Webcomic::$config
@@ -1140,6 +1108,38 @@ private function save_sizes() {
1140 1108 }
1141 1109 }
1142 1110
  1111 + /** Render a settings page.
  1112 + *
  1113 + * @uses Webcomic::$config
  1114 + * @uses Webcomic::$version
  1115 + */
  1116 + public function page() {
  1117 + $page = empty( $_GET[ 'post_type' ] ) ? 'webcomic-options' : "{$_GET[ 'post_type' ]}-options";
  1118 + ?>
  1119 + <div class="wrap" >
  1120 + <div id="icon-options-general" class="icon32" data-webcomic-admin-url="<?php echo admin_url(); ?>"></div>
  1121 + <h2><?php echo get_admin_page_title(); ?></h2>
  1122 + <form action="options.php" method="post"<?php echo 'webcomic' !== $page ? ' enctype="multipart/form-data"' : ''; ?>>
  1123 + <?php
  1124 + settings_fields( 'webcomic-options' );
  1125 + do_settings_sections( $page );
  1126 +
  1127 + echo 'webcomic-options' === $page ? '<input type="hidden" name="webcomic_general" value="1">' : sprintf( '<input type="hidden" name="webcomic_collection" value="%s">', $_GET[ 'post_type' ] );
  1128 + ?>
  1129 + <p class="submit">
  1130 + <?php
  1131 + submit_button( '', 'primary', '', false );
  1132 +
  1133 + if ( 'webcomic-options' === $page ) {
  1134 + 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 ) );
  1135 + }
  1136 + ?>
  1137 + </p>
  1138 + </form>
  1139 + </div>
  1140 + <?php
  1141 + }
  1142 +
1143 1143 /** Generic settings section callback.
1144 1144 *
1145 1145 * Most sections don't include a description, but if permalinks are
2  -/php/legacy.php
@@ -190,7 +190,7 @@ public function page() {
190 190 ?>
191 191 <div class="wrap">
192 192 <div id="icon-tools" class="icon32"></div>
193   - <h2><?php _e( 'Upgrade Webcomic', 'webcomic' ); ?></h2>
  193 + <h2><?php echo get_admin_page_title(); ?></h2>
194 194 <div id="col-left">
195 195 <div class="col-wrap">
196 196 <?php if ( isset( $_POST[ 'webcomic_upgrade_status' ] ) and 0 === $_POST[ 'webcomic_upgrade_status' ] ) { ?>

0 comments on commit 28b2ca9

Please sign in to comment.
Something went wrong with that request. Please try again.