1 Commits

Author SHA1 Message Date
MickeyKay 21817ea81d Bump version number. 2015-06-08 17:31:29 -07:00
5 changed files with 194 additions and 223 deletions
+3
View File
@@ -30,6 +30,9 @@ require_once dirname( __FILE__ ) . '/includes/widget-areas/widget-areas.php';
// Plugin activation class.
require_once dirname( __FILE__ ) . '/lib/class-tgm-plugin-activation.php';
// Better Font Awesome Library.
require_once dirname( __FILE__ ) . '/lib/better-font-awesome-library/better-font-awesome-library.php';
// Dev utility functions.
require_once dirname( __FILE__ ) . '/includes/utilities/utilities.php';
+2 -35
View File
@@ -19,8 +19,8 @@ function trestle_settings_defaults() {
// Trestle default key/value pairs.
$trestle_defaults = array(
'layout' => 'solid',
'logo_id' => '',
'logo_id_mobile' => '',
'logo_url' => '',
'logo_url_mobile' => '',
'favicon_url' => '',
'nav_primary_location' => 'full',
'mobile_nav_toggle' => 'small-icon',
@@ -95,33 +95,6 @@ function trestle_admin_actions() {
}
add_filter( 'tiny_mce_before_init', 'trestle_tiny_mce_before_init' );
/**
* Add custom classes to the body of TinyMCE previews.
*
* @since 2.2.0
*/
function trestle_tiny_mce_before_init( $init_array ) {
global $post;
$screen = get_current_screen();
// If we're on an edit screen, add an appropriate 'post-id-XX' or 'page-id-XX'.
if ( 'edit' == $screen->parent_base ) {
// Custom post types always use 'post', so we only need to handle pages.
$post_type = ( 'page' == $post->post_type ) ? 'page' : 'post';
$init_array['body_class'] .= sprintf( ' %s-id-%s',
$post_type,
$post->ID
);
}
return $init_array;
}
add_action( 'tgmpa_register', 'trestle_register_required_plugins' );
/**
* Loads required & recommended plugins.
@@ -210,12 +183,6 @@ function trestle_register_required_plugins() {
'required' => false,
),
array(
'name' => 'RICG Responsive Images',
'slug' => 'ricg-responsive-images',
'required' => false,
),
array(
'name' => 'Widget Context',
'slug' => 'widget-context',
+132 -135
View File
@@ -25,8 +25,8 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_section(
'trestle_settings_section',
array(
'title' => __( 'Trestle Settings', 'trestle' ),
'priority' => 160,
'title' => __( 'Trestle Settings', 'trestle' ),
'priority' => 160,
)
);
@@ -34,67 +34,65 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[layout]',
array(
'default' => trestle_get_option( 'layout' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'layout' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_layout_control',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[layout]',
'label' => __( 'Layout', 'trestle' ),
'type' => 'radio',
'choices' => array(
'bubble' => __( 'Bubble', 'trestle' ),
'solid' => __( 'Solid', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[layout]',
'label' => __( 'Layout', 'trestle' ),
'type' => 'radio',
'choices' => array(
'bubble' => __( 'Bubble', 'trestle' ),
'solid' => __( 'Solid', 'trestle' ),
)
)
);
// Upload a logo.
$wp_customize->add_setting(
'trestle-settings[logo_id]',
'trestle-settings[logo_url]',
array(
'default' => trestle_get_option( 'logo_id' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'absint',
'default' => trestle_get_option( 'logo_url' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Media_Control(
new WP_Customize_Image_Control(
$wp_customize,
'trestle_logo_control',
array(
'label' => __( 'Upload a logo', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[logo_id]',
'mime_type' => 'image',
'label' => __( 'Upload a logo', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[logo_url]',
)
)
);
// Upload a mobile logo.
$wp_customize->add_setting(
'trestle-settings[logo_id_mobile]',
'trestle-settings[logo_url_mobile]',
array(
'default' => trestle_get_option( 'logo_id_mobile' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'absint',
'default' => trestle_get_option( 'logo_url_mobile' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
new WP_Customize_Media_Control(
new WP_Customize_Image_Control(
$wp_customize,
'trestle_mobile_logo_control',
array(
'label' => __( 'Upload a mobile logo', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[logo_id_mobile]',
'mime_type' => 'image',
'label' => __( 'Upload a mobile logo', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[logo_url_mobile]',
)
)
);
@@ -103,10 +101,10 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[favicon_url]',
array(
'default' => trestle_get_option( 'favicon_url' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw',
'default' => trestle_get_option( 'favicon_url' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'esc_url_raw',
)
);
$wp_customize->add_control(
@@ -114,9 +112,9 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize,
'trestle_favicon_control',
array(
'label' => __( 'Upload a favicon', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[favicon_url]',
'label' => __( 'Upload a favicon', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[favicon_url]',
)
)
);
@@ -125,21 +123,21 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[nav_primary_location]',
array(
'default' => trestle_get_option( 'nav_primary_location' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'nav_primary_location' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_nav_primary_location_control',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[nav_primary_location]',
'label' => __( 'Menu style', 'trestle' ),
'type' => 'select',
'choices' => array(
'full' => __( 'Full Width', 'trestle' ),
'header' => __( 'Header Right', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[nav_primary_location]',
'label' => __( 'Menu style', 'trestle' ),
'type' => 'select',
'choices' => array(
'full' => __( 'Full Width', 'trestle' ),
'header' => __( 'Header Right', 'trestle' ),
)
)
);
@@ -148,9 +146,9 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[mobile_nav_toggle]',
array(
'default' => trestle_get_option( 'mobile_nav_toggle' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'mobile_nav_toggle' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
@@ -161,8 +159,8 @@ function trestle_customizer_controls( $wp_customize ) {
'label' => __( 'Mobile Menu Toggle', 'trestle' ),
'type' => 'select',
'choices' => array(
'small-icon' => __( 'Small Icon', 'trestle' ),
'big-button' => __( 'Big Button', 'trestle' ),
'small-icon' => __( 'Small Icon', 'trestle' ),
'big-button' => __( 'Big Button', 'trestle' ),
)
)
);
@@ -171,9 +169,9 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[search_in_nav]',
array(
'default' => trestle_get_option( 'search_in_nav' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'search_in_nav' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
@@ -182,7 +180,7 @@ function trestle_customizer_controls( $wp_customize ) {
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[search_in_nav]',
'label' => __( 'Add search to mobile navigation', 'trestle' ),
'type' => 'checkbox',
'type' => 'checkbox',
)
);
@@ -190,18 +188,18 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[read_more_text]',
array(
'default' => trestle_get_option( 'read_more_text' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'wp_kses_post',
'default' => trestle_get_option( 'read_more_text' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'wp_kses_post',
)
);
$wp_customize->add_control(
'trestle_read_more_text_control',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[read_more_text]',
'label' => __( 'Custom read more link text', 'trestle' ),
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[read_more_text]',
'label' => __( 'Custom read more link text', 'trestle' ),
)
);
@@ -209,32 +207,31 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[revisions_number]',
array(
'default' => trestle_get_option( 'revisions_number' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'absint',
'default' => trestle_get_option( 'revisions_number' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_revisions_number_control',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[revisions_number]',
'label' => __( 'Number of post revisions', 'trestle' ),
'type' => 'select',
'choices' => array(
'-1' => __( 'Unlimited', 'trestle' ),
'0' => '0',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
'6' => '6',
'7' => '7',
'8' => '8',
'9' => '9',
'10' => '10',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[revisions_number]',
'label' => __( 'Number of post revisions', 'trestle' ),
'type' => 'select',
'choices' => array(
'-1' => __( 'Unlimited', 'trestle' ),
'0' => '0',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
'6' => '6',
'7' => '7',
'8' => '8',
'9' => '9',
'10' => '10',
)
)
);
@@ -243,26 +240,26 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[footer_widgets_number]',
array(
'default' => trestle_get_option( 'footer_widgets_number' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'footer_widgets_number' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_footer_widgets_number_control',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[footer_widgets_number]',
'label' => __( 'Number of footer widgets', 'trestle' ),
'type' => 'select',
'choices' => array(
'0' => '0',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
'6' => '6',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[footer_widgets_number]',
'label' => __( 'Number of footer widgets', 'trestle' ),
'type' => 'select',
'choices' => array(
'0' => '0',
'1' => '1',
'2' => '2',
'3' => '3',
'4' => '4',
'5' => '5',
'6' => '6',
)
)
);
@@ -271,17 +268,17 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[link_icons_title]',
array(
'default' => '',
'type' => 'option',
'default' => '',
'type' => 'option',
)
);
$wp_customize->add_control(
'trestle_link_icons_title',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[link_icons_title]',
'label' => __( 'Icon links', 'trestle' ),
'type' => 'hidden',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[link_icons_title]',
'label' => __( 'Icon links', 'trestle' ),
'type' => 'hidden',
)
);
@@ -289,18 +286,18 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[external_link_icons]',
array(
'default' => trestle_get_option( 'external_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'external_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_external_link_icons',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[external_link_icons]',
'label' => __( 'Add icons to external links', 'trestle' ),
'type' => 'checkbox',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[external_link_icons]',
'label' => __( 'Add icons to external links', 'trestle' ),
'type' => 'checkbox',
)
);
@@ -308,18 +305,18 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[email_link_icons]',
array(
'default' => trestle_get_option( 'email_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'email_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_email_link_icons',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[email_link_icons]',
'label' => __( 'Add icons to email links', 'trestle' ),
'type' => 'checkbox',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[email_link_icons]',
'label' => __( 'Add icons to email links', 'trestle' ),
'type' => 'checkbox',
)
);
@@ -327,18 +324,18 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[pdf_link_icons]',
array(
'default' => trestle_get_option( 'pdf_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'pdf_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_pdf_link_icons',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[pdf_link_icons]',
'label' => __( 'Add icons to .pdf links', 'trestle' ),
'type' => 'checkbox',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[pdf_link_icons]',
'label' => __( 'Add icons to .pdf links', 'trestle' ),
'type' => 'checkbox',
)
);
@@ -346,18 +343,18 @@ function trestle_customizer_controls( $wp_customize ) {
$wp_customize->add_setting(
'trestle-settings[doc_link_icons]',
array(
'default' => trestle_get_option( 'doc_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
'default' => trestle_get_option( 'doc_link_icons' ),
'type' => 'option',
'capability' => 'edit_theme_options',
)
);
$wp_customize->add_control(
'trestle_doc_link_icons',
array(
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[doc_link_icons]',
'label' => __( 'Add icons to .doc links', 'trestle' ),
'type' => 'checkbox',
'section' => 'trestle_settings_section',
'settings' => 'trestle-settings[doc_link_icons]',
'label' => __( 'Add icons to .doc links', 'trestle' ),
'type' => 'checkbox',
)
);
+17 -53
View File
@@ -55,9 +55,6 @@ add_action( 'init', 'trestle_load_bfa' );
*/
function trestle_load_bfa() {
// Better Font Awesome Library
require_once trailingslashit( get_stylesheet_directory() ) . 'lib/better-font-awesome-library/better-font-awesome-library.php';
// Set the library initialization args.
$args = array(
'version' => 'latest',
@@ -216,55 +213,42 @@ add_filter( 'genesis_seo_title', 'trestle_do_logos', 10, 3 );
*/
function trestle_do_logos( $title, $inside, $wrap ) {
$logo_id = trestle_get_option( 'logo_id' );
$logo_id_mobile = trestle_get_option( 'logo_id_mobile' );
$logo_url = trestle_get_option( 'logo_url' );
$logo_url_mobile = trestle_get_option( 'logo_url_mobile' );
$logo_html = '';
// Regular logo.
if ( $logo_id ) {
if ( $logo_url ) {
// Default logo classes.
$classes = array(
'logo',
'logo-full'
);
// Default logo class.
$classes = array('logo-full');
// If no mobile logo is specified, make regular logo act as mobile logo too.
if( ! $logo_id_mobile ) {
if( ! $logo_url_mobile )
$classes[] = 'show';
}
// Prepare the classes.
$logo_attr = array(
'class' => implode( $classes, ' ' ),
$logo_html .= sprintf( '<img class="logo %s" alt="%s" src="%s" />',
implode(' ', $classes),
esc_attr( get_bloginfo( 'name' ) ),
$logo_url
);
// Build the <img> tag.
$logo_html .= wp_get_attachment_image( $logo_id, 'full', false, $logo_attr );
}
// Mobile logo.
if ( $logo_id_mobile ) {
if ( $logo_url_mobile ) {
// Default mobile logo class.
$classes = array(
'logo',
'logo-mobile'
);
$classes = array('logo-mobile');
// If no regular logo is specified, make mobile logo act as regular logo too.
if( ! $logo_id )
if( ! $logo_url )
$classes[] = 'show';
// Prepare the classes.
$logo_attr = array(
'class' => implode( $classes, ' ' ),
$logo_html .= sprintf( '<img class="logo %s" alt="%s" src="%s" />',
implode(' ', $classes),
esc_attr( get_bloginfo( 'name' ) ),
$logo_url_mobile
);
// Build the <img> tag.
$logo_html .= wp_get_attachment_image( $logo_id_mobile, 'full', false, $logo_attr );
}
if ( $logo_html ) {
@@ -331,26 +315,6 @@ function trestle_custom_nav_extras( $nav_items, stdClass $menu_args ) {
* Posts & Pages
===========================================*/
add_filter( 'post_class', 'trestle_post_classes' );
/**
* Add extra classes to posts in certain situations.
*
* @since 2.2.0
*
* @param array $classes Post classes.
* @return array Updated post classes.
*/
function trestle_post_classes( $classes ) {
// If post doesn't have a featured image.
if ( ! has_post_thumbnail() ) {
$classes[] = 'no-featured-image';
}
return $classes;
}
add_filter( 'wp_revisions_to_keep', 'trestle_update_revisions_number', 10, 2 );
/**
* Sets the number of post revisions.
+40
View File
@@ -609,6 +609,46 @@ body .red:hover {
border-color: #555;
}
body .blue {
background-color: #0971b2;
border-color: #0971b2;
}
body .blue:hover {
background-color: #333;
border-color: #333;
}
body .green {
background-color: #00a476;
border-color: #00a476;
}
body .green:hover {
background-color: #333;
border-color: #333;
}
.arrow-right:after,
.arrow-left:before {
display: inline-block;
font-family: FontAwesome;
font-weight: normal;
font-stretch: normal;
font-style: normal;
font-variant: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.arrow-right:after {
content: "\00a0\00a0\f0a9";
}
.arrow-left:before {
content: "\f0a8\00a0\00a0";
}
/* Tables
--------------------------------------------- */