示例#1
0
/**
 * A unique identifier is defined to store the options in the database and reference them from the theme.
 * By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
 * If the identifier changes, it'll appear as if the options have been reset.
 * 
 */
function optionsframework_option_name()
{
    // This gets the theme name from the stylesheet (lowercase and without spaces)
    $themename = preg_replace("/\\W/", "", strtolower(theme_data_variable('Name')));
    $optionsframework_settings = get_option('optionsframework');
    $optionsframework_settings['id'] = $themename;
    update_option('optionsframework', $optionsframework_settings);
}
示例#2
0
		return '';
	}
}

/****************************************************************
 * System Constants
 ****************************************************************

// Define helper constants
$get_theme_name = explode('/themes/', get_template_directory());

if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }
define('WP_BASE', wp_base_dir());
define('THEME_NAME', next($get_theme_name));
define('RELATIVE_PLUGIN_PATH', str_replace(site_url() . '/', '', plugins_url()));
define('FULL_RELATIVE_PLUGIN_PATH', WP_BASE . '/' . RELATIVE_PLUGIN_PATH);
define('RELATIVE_CONTENT_PATH', str_replace(site_url() . '/', '', content_url()));
define('THEME_PATH', RELATIVE_CONTENT_PATH . '/themes/' . THEME_NAME);
define("THEME_URL", get_template_directory_uri());

/****************************************************************
 * Constantes del Theme
 ****************************************************************/
define('MDLTHEME_MODE', 'production');
define('MDLTHEME_CUSTOMIZED', true);
// set to TRUE if you changed something in the source code.
define('MDLTHEME_THEME_VERSION', theme_data_variable('Version'));
define('MDLTHEME_PREFIX', 'mdl_');
define('MDLTHEME_THEME_PREFIX', MDLTHEME_PREFIX . get_template() . '_');
define('MDLTHEME_META_PREFIX', '_' . MDLTHEME_PREFIX);
define('MDLTHEME_HELP_URL', '#');