Skip to content

Commit

Permalink
Theme label keys
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHansenMe authored Sep 22, 2023
1 parent d9702d9 commit fc9b995
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Listeners/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function register_hooks() {
public function theme_changed( $new_option, $old_option ) {
if ( $new_option !== $old_option ) {
$data = array(
'label_key' => 'new_theme',
'old_theme' => $old_option,
'new_theme' => $new_option,
);
Expand All @@ -53,7 +54,7 @@ public function theme_changed( $new_option, $old_option ) {
public function mojo_preview() {
global $theme;
if ( isset( $_GET['page'] ) && 'mojo-theme-preview' === $_GET['page'] && ! is_wp_error( $theme ) ) {
$this->push( 'mojo_theme_preview', array( 'theme' => $theme ) );
$this->push( 'mojo_theme_preview', array( 'label_key' => 'theme', 'theme' => $theme ) );
}
}

Expand All @@ -64,6 +65,6 @@ public function mojo_preview() {
*/
public function browse_wporg_themes() {
$category = ( isset( $_GET['browse'] ) ) ? esc_attr( $_GET['browse'] ) : 'featured';
$this->push( 'browse_wporg_themes', array( 'category' => $category ) );
$this->push( 'browse_wporg_themes', array( 'label_key' => 'category', 'category' => $category ) );
}
}

0 comments on commit fc9b995

Please sign in to comment.