Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
puikinsh committed Jan 14, 2015
1 parent 92b2ffb commit a77aff3
Show file tree
Hide file tree
Showing 31 changed files with 669 additions and 238 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ Unless otherwise specified, all the theme files, scripts and images are licensed

## Change Log

**= 2.2.1 =**

- Code cleanup
- Updated Genericons to versions 3.3

**= 2.2.0 =**
- Added full WPML plugin support. We have also made it certified by WPML.
- Added Github friendly readme file (README.md)
Expand Down
2 changes: 1 addition & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
else {
printf( __( '%1$s thoughts on &ldquo;%2$s&rdquo;', 'travelify' ), number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
}
}
?>
</h2>

Expand Down
2 changes: 1 addition & 1 deletion content-nosidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
* travelify_next_previous 5
* travelify_loop_after 10
*/
do_action( 'travelify_after_loop_content' );
do_action( 'travelify_after_loop_content' );
?>
2 changes: 1 addition & 1 deletion content-rightsidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* travelify_next_previous 5
* travelify_loop_after 10
*/
do_action( 'travelify_after_loop_content' );
do_action( 'travelify_after_loop_content' );
?>
</div><!-- #primary -->

Expand Down
4 changes: 2 additions & 2 deletions editor-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
@import url( 'style.css' );

/* Add overwrites as needed so that the content of the editor field is attractive and not broken */
body {
body {
padding: 0px 15px;
border-top: none;
width: 603px;
}
}

li {
list-style: disc;
Expand Down
22 changes: 11 additions & 11 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
</div><!-- #main -->

<?php
/**
/**
* travelify_after_main hook
*/
do_action( 'travelify_after_main' );
?>

<?php
<?php
/**
* travelify_before_footer hook
*/
do_action( 'travelify_before_footer' );
?>
?>

<footer id="footerarea" class="clearfix">
<?php
/**
* travelify_footer hook
/**
* travelify_footer hook
*
* HOOKED_FUNCTION_NAME PRIORITY
*
Expand All @@ -37,22 +37,22 @@
do_action( 'travelify_footer' );
?>
</footer>
<?php

<?php
/**
* travelify_after_footer hook
*/
do_action( 'travelify_after_footer' );
?>
?>

</div><!-- .wrapper -->

<?php
/**
/**
* travelify_after hook
*/
do_action( 'travelify_after' );
?>
?>

<?php wp_footer(); ?>

Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function travelify_setup() {
add_image_size( 'slider', 1018, 460, true ); // used on Featured Slider on Homepage Header
add_image_size( 'gallery', 474, 342, true ); // used to show gallery all images

// This feature enables woocommerce support for a theme.
// This feature enables WooCommerce support for a theme.
add_theme_support( 'woocommerce' );

/**
Expand Down
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<?php get_header(); ?>

<?php
/**
/**
* travelify_before_main_container hook
*/
do_action( 'travelify_before_main_container' );
?>

<div id="container">
<?php
/**
/**
* travelify_main_container hook
*
* HOOKED_FUNCTION_NAME PRIORITY
Expand All @@ -28,7 +28,7 @@
</div><!-- #container -->

<?php
/**
/**
* travelify_after_main_container hook
*/
do_action( 'travelify_after_main_container' );
Expand Down
Binary file added library/font/Genericons.eot
Binary file not shown.
543 changes: 543 additions & 0 deletions library/font/Genericons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added library/font/Genericons.ttf
Binary file not shown.
Binary file added library/font/Genericons.woff
Binary file not shown.
Binary file removed library/font/genericons-regular-webfont.eot
Binary file not shown.
135 changes: 0 additions & 135 deletions library/font/genericons-regular-webfont.svg

This file was deleted.

Binary file removed library/font/genericons-regular-webfont.ttf
Binary file not shown.
Binary file removed library/font/genericons-regular-webfont.woff
Binary file not shown.
4 changes: 2 additions & 2 deletions library/functions/i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/**
* Controls translation of Travelify Theme.
*
* @since Travelify 1.3.0
* @since Travelify 1.3.0
*/

/**
/**
* Travelify is available for translation.
* Add your files into library/languages/ directory.
* @see http://codex.wordpress.org/Function_Reference/load_theme_textdomain
Expand Down
76 changes: 38 additions & 38 deletions library/panel/metaboxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
* Travelify Meta Boxes
*
*/

add_action( 'add_meta_boxes', 'travelify_add_custom_box' );
/**
* Add Meta Boxes.
*
*
* Add Meta box in page and post post types.
*/
*/
function travelify_add_custom_box() {
add_meta_box(
'siderbar-layout', //Unique ID
__( 'Select layout for this specific Page only ( Note: This setting only reflects if page Template is set as Default Template and Blog Type Templates.)', 'travelify' ), //Title
'travelify_sidebar_layout', //Callback function
'page' //show metabox in pages
);
);
add_meta_box(
'siderbar-layout', //Unique ID
__( 'Select layout for this specific Post only', 'travelify' ), //Title
'travelify_sidebar_layout', //Callback function
'post' //show metabox in posts
);
);
}

/****************************************************************************************/
Expand Down Expand Up @@ -52,7 +52,7 @@ function travelify_add_custom_box() {
'value' => 'no-sidebar-one-column',
'label' => __( 'No Sidebar, One Column', 'travelify' ),
'thumbnail' => get_template_directory_uri() . '/library/panel/images/one-column.png'
),
),
'left-sidebar' => array(
'id' => 'travelify_sidebarlayout',
'value' => 'left-sidebar',
Expand All @@ -66,23 +66,23 @@ function travelify_add_custom_box() {
'thumbnail' => get_template_directory_uri() . '/library/panel/images/right-sidebar.png'
)
);

/****************************************************************************************/

/**
* Displays metabox to for sidebar layout
*/
function travelify_sidebar_layout() {
global $sidebar_layout, $post;
// Use nonce for verification
function travelify_sidebar_layout() {
global $sidebar_layout, $post;
// Use nonce for verification
wp_nonce_field( basename( __FILE__ ), 'custom_meta_box_nonce' );

// Begin the field table and loop ?>
<table id="sidebar-metabox" class="form-table" width="100%">
<tbody>
<tbody>
<tr>
<?php
foreach ($sidebar_layout as $field) {
<?php
foreach ($sidebar_layout as $field) {
$meta = get_post_meta( $post->ID, $field['id'], true );
if(empty( $meta ) ){
$meta='default';
Expand All @@ -99,49 +99,49 @@ function travelify_sidebar_layout() {
</label>
</td>
<?php endif;
} // end foreach
} // end foreach
?>
</tr>
</tbody>
</table>
<?php
<?php
}

/****************************************************************************************/


add_action('save_post', 'travelify_save_custom_meta');
add_action('save_post', 'travelify_save_custom_meta');
/**
* save the custom metabox data
* @hooked to save_post hook
*/
function travelify_save_custom_meta( $post_id ) {
global $sidebar_layout, $post;
function travelify_save_custom_meta( $post_id ) {
global $sidebar_layout, $post;

// Verify the nonce before proceeding.
if ( !isset( $_POST[ 'custom_meta_box_nonce' ] ) || !wp_verify_nonce( $_POST[ 'custom_meta_box_nonce' ], basename( __FILE__ ) ) )
return;

// Stop WP from clearing custom fields on autosave
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE)
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE)
return;
if ('page' == $_POST['post_type']) {
if (!current_user_can( 'edit_page', $post_id ) )
return $post_id;
}
elseif (!current_user_can( 'edit_post', $post_id ) ) {
return $post_id;
}
foreach ($sidebar_layout as $field) {

if ('page' == $_POST['post_type']) {
if (!current_user_can( 'edit_page', $post_id ) )
return $post_id;
}
elseif (!current_user_can( 'edit_post', $post_id ) ) {
return $post_id;
}

foreach ($sidebar_layout as $field) {
//Execute this saving function
$old = get_post_meta( $post_id, $field['id'], true);
$old = get_post_meta( $post_id, $field['id'], true);
$new = $_POST[$field['id']];
if ($new && $new != $old) {
update_post_meta($post_id, $field['id'], $new);
} elseif ('' == $new && $old) {
delete_post_meta($post_id, $field['id'], $old);
}
} // end foreach
if ($new && $new != $old) {
update_post_meta($post_id, $field['id'], $new);
} elseif ('' == $new && $old) {
delete_post_meta($post_id, $field['id'], $old);
}
} // end foreach
}
6 changes: 3 additions & 3 deletions library/panel/show-post-id.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ function travelify_value( $column_name, $id ) {
function travelify_post_table_column_css() {
?>
<style type="text/css">
#travelify-column-id {
width: 40px;
#travelify-column-id {
width: 40px;
}
</style>
<?php
<?php
}
?>
2 changes: 1 addition & 1 deletion library/panel/themeoptions-defaults.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Contains all the theme option default values
*
*
* Set the default values for all the settings. If no user-defined values
* is available for any setting, these defaults will be used.
*
Expand Down
6 changes: 3 additions & 3 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<?php get_header(); ?>

<?php
/**
/**
* travelify_before_main_container hook
*/
do_action( 'travelify_before_main_container' );
?>

<div id="container">
<?php
/**
/**
* travelify_main_container hook
*
* HOOKED_FUNCTION_NAME PRIORITY
Expand All @@ -28,7 +28,7 @@
</div><!-- #container -->

<?php
/**
/**
* travelify_after_main_container hook
*/
do_action( 'travelify_after_main_container' );
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: http://colorlib.com/wp/travelify/
Author: Colorlib
Author URI: http://colorlib.com/wp/
Description: Travelify is a clan, simple and fully responsive WordPress WooCommerce theme that looks awesome on any device. It adjusts automatically to any screen size including tablets and smartphones as well as Retina displays. Theme is built using HTML5 / CSS3 and is SEO friendly. This WordPress theme was built with travel, adventures, languages and nature in mind but it can be used for anything so be creative and unleash its full potential in blogging, eCommerce, business and other websites. Along the awesome design this theme is customizable via a simple but yet powerful theme options. Some of the nicest features are featured post slider, social icons, custom logo, translation ready (compatible with WPML plugin) and many more. This theme out-of-the-box plays nicely with WooCommerce, Breadcrumb NavXT, WP-PageNavi, Contact Form 7 and other popular plugins. Theme available in English, French, German, Hungarian, Italian, Spanish, Dutch, Hebrew, Slovak, Turkish, Swedish, Brazilian Portuguese, Polish, Finnish and Chinese.
Version: 2.2.0
Version: 2.2.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: white, light, green, custom-background, custom-header, custom-menu, fluid-layout, featured-images, full-width-template, left sidebar, right sidebar, one-column, two columns, three-columns, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready
Expand Down Expand Up @@ -84,6 +84,11 @@ If you have still any other questions about the theme you can email at info@colo

== Change Log ==

= 2.2.1 =

* Code cleanup
* Updated Genericons to versions 3.3

= 2.2.0 =
* Added full WPML plugin support. We have also made it certified by WPML.
* Added Github friendly readme file (README.md)
Expand Down
2 changes: 1 addition & 1 deletion rtl.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Theme Name: Travelify
Theme URI: http://colorlib.com/wp/travelify/
Theme URI: http://colorlib.com/wp/travelify/
Description: Adding support for language written in a Right To Left (RTL) direction.
*/

Expand Down
Loading

0 comments on commit a77aff3

Please sign in to comment.