Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier to change name of theme #583

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions framework/bootstrap/includes/class-Shoestrap_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -1852,16 +1852,22 @@ public function setArguments() {

$theme = wp_get_theme(); // For use with some settings. Not necessary.

// Get the parent theme name if needed
if( !empty( $theme->parent_theme ) ){
$themeName = $theme->parent_theme;
}else{
$themeName = $theme->name;
}
//
$this->args = array(
// TYPICAL -> Change these values as you need/desire
'opt_name' => SHOESTRAP_OPT_NAME,
'display_name' => $theme->get( 'Name' ),
'display_version' => $theme->get( 'Version' ),
'menu_type' => 'menu',
'allow_sub_menu' => true,
'menu_title' => __( 'Shoestrap', 'shoestrap'),
'page_title' => __('Shoestrap Options', 'shoestrap'),
'global_variable' => 'redux',
'menu_title' => $themeName,
'page_title' => $themeName . __(' Options', 'shoestrap'),

'google_api_key' => 'AIzaSyCDiOc36EIOmwdwspLG3LYwCg9avqC5YLs',

Expand Down
14 changes: 7 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
define( 'SHOESTRAP_ASSETS_URL', $shoestrap_assets_url );
}

/*
* The option that is used by Shoestrap in the database for all settings.
*
* This can be overriden by adding this in your wp-config.php:
* define( 'SHOESTRAP_OPT_NAME', 'custom_option' )
*/
// The option that is used by Shoestrap in the database for all settings.
if ( ! defined( 'SHOESTRAP_OPT_NAME' ) ) {
define( 'SHOESTRAP_OPT_NAME', 'shoestrap' );
// Get the parent theme name if needed
if( isset( $theme->parent_theme ) ){
define( 'SHOESTRAP_OPT_NAME', $theme->parent_theme . '-shoestrap' );
}else{
define( 'SHOESTRAP_OPT_NAME', $theme->name . '-shoestrap' );
}
}

global $ss_settings;
Expand Down