Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- global $google_webfonts;
- $google_webfonts = array('Abel','Aclonica','Actor','Aldrich','Alice','Allan:bold','Allerta','Allerta+Stencil','Amaranth','Andika','Annie+Use+Your+Telescope','Anonymous+Pro','Anton','Architects+Daughter','Arimo','Artifika','Arvo','Asset','Astloch','Aubrey','Bangers','Bentham','Bevan','Bigshot+One','Black+Ops+One','Bowlby+One','Bowlby+One+SC','Brawler','Buda:light','Cabin','Cabin+Sketch:bold','Cabin:bold','Calligraffitti','Candal','Cantarell','Cardo','Carme','Carter+One','Caudex','Cedarville+Cursive','Cherry+Cream+Soda','Chewy','Coda:800','Comfortaa','Coming+Soon','Copse','Corben:bold','Cousine','Coustard','Covered+By+Your+Grace','Crafty+Girls','Crimson','Crushed','Cuprum','Damion','Dancing+Script','Dawning+of+a+New+Day','Days+One','Delius','Delius+Swash+Caps','Didact+Gothic','Droid Sans','Droid Sans Mono','Droid Serif','EB+Garamond','Expletus+Sans','Federo','Fontdiner+Swanky','Forum','Francois+One','Gentium+Basic','Gentium+Book+Basic','Geo','Geostar','Geostar+Fill','Give+You+Glory','Gloria+Hallelujah','Goblin+One','Goudy+Bookletter+1911','Gravitas+One','Gruppo','Hammersmith+One','Holtwood+One+SC','Homemade+Apple','IM Fell','Inconsolata','Indie+Flower','Irish+Growler','Istok+Web','Josefin Sans Std Light','Josefin+Sans','Josefin+Slab','Judson','Jura','Just+Another+Hand','Just+Me+Again+Down+Here','Kameron','Kelly+Slab','Kenia','Kranky','Kreon','Kristi','La+Belle+Aurore','Lato','League+Script','Leckerli+One','Lekton','Limelight','Lobster','Lobster+Two','Lora','Love+Ya+Like+A+Sister','Loved+by+the+King','Luckiest+Guy','Maiden+Orange','Mako','Marvel','Maven+Pro','Meddon','MedievalSharp','Megrim','Merriweather','Metrophobic','Michroma','Miltonian','Miltonian+Tattoo','Modern+Antiqua','Molengo','Monofett','Montez','Mountains+of+Christmas','Muli','Neucha','Neuton','News+Cycle','Nixie+One','Nobile','Nova+Round','Numans','Nunito','OFL Sorts Mill Goudy TT','OFL Standard TT','Orbitron','Oswald','Over+the+Rainbow','Ovo','PT Sans','PT Sans Narrow','PT+Serif','PT+Serif+Caption','Pacifico','Patrick+Hand','Paytone+One','Permanent+Marker','Philosopher','Play','Playfair+Display','Podkova','Pompiere','Puritan','Quattrocento','Quattrocento+Sans','Questrial','Radley','Raleway:100','Rationale','Redressed','Reenie Beanie','Rochester','Rock+Salt','Rokkitt','Rosario','Ruslan+Display','Schoolbell','Shadows+Into+Light','Shanti','Short+Stack','Sigmar+One','Six+Caps','Slackey','Smokum','Smythe','Sniglet:800','Snippet','Special+Elite','Stardos+Stencil','Sue+Ellen+Francisco','Sunshiney','Swanky+and+Moo+Moo','Syncopate','Tangerine','Tenor+Sans','Terminal+Dosis+Light','The+Girl+Next+Door','Tienne','Tinos','Tulpen+One','Ubuntu','Ultra','UnifrakturCook:bold','UnifrakturMaguntia','Unkempt','Unna','VT323','Varela','Varela+Round','Vibur','Vidaloka','Volkhov','Vollkorn','Voltaire','Waiting+for+the+Sunrise','Wallpoet','Walter+Turncoat','Wire+One','Yanone Kaffeesatz','Yellowtail','Yeseva+One','Zeyada');
- $google_webfonts = str_replace('+', ' ', $google_webfonts);
- add_action( 'admin_menu', 'producthelp_admin_setup' );
- function producthelp_admin_setup() {
- /* Get the theme prefix. */
- $prefix = hybrid_get_prefix();
- /* Create a settings meta box only on the theme settings page. */
- add_action( 'load-appearance_page_theme-settings', 'producthelp_settings_meta_boxes' );
- /* Add a filter to validate/sanitize your settings. */
- add_filter( "sanitize_option_{$prefix}_theme_settings", 'producthelp_validate_settings' );
- }
- /* Adds custom meta boxes to the theme settings page. */
- function producthelp_settings_meta_boxes() {
- /* Add a custom meta box. */
- add_meta_box(
- 'example-theme-meta-box', // Name/ID
- __( 'Example Settings', hybrid_get_textdomain() ), // Label
- 'producthelp_meta_box', // Callback function
- 'appearance_page_theme-settings', // Page to load on, leave as is
- 'normal', // Which meta box holder?
- 'high' // High/low within the meta box holder
- );
- /* Add additional add_meta_box() calls here. */
- }
- /* Function for displaying the meta box. */
- function producthelp_meta_box() { ?>
- <th><label for="font_family"><?php _e( 'Style:', hybrid_get_textdomain() ); ?></label></th>
- <td>
- <select name="<?php echo hybrid_settings_field_name( 'font_family' ) ; ?>" id="<?php echo hybrid_settings_field_id( 'font_family' ) ; ?>">
- <?php
- global $google_webfonts;
- foreach ($google_webfonts as $web_font_name) {
- echo '<option value="'.$web_font_name.'" "<?php selected( .$web_font_name., hybrid_get_setting( "font_family" )); ?>" > '.$web_font_name.'</option>';
- }
- ?>
- <option value="1" <?php selected( 1, hybrid_get_setting( 'theme_color' )); ?>>1</option>
- </select><br/>
- <label for="<?php echo hybrid_settings_field_id( 'font_family' ) ; ?>"><?php _e( 'Choose the color theme you want.', hybrid_get_textdomain() ); ?></label><br />
- </td>
- </tr>
- </table><!-- .form-table -->
- <?php
- }
- /* Validates theme settings. */
- function producthelp_validate_settings( $input ) {
- $input['theme_color'] = wp_filter_nohtml_kses( $input['theme_color'] );
- $input['font_family'] = wp_filter_nohtml_kses( $input['font_family'] );
- /* Return the array of theme settings. */
- return $input;
- }
- ?>
Add Comment
Please, Sign In to add comment