Skip to content

Commit bc3fd74

Browse files
committed
2 parents fd38fd0 + f90ac05 commit bc3fd74

File tree

10 files changed

+48
-47
lines changed

10 files changed

+48
-47
lines changed

.travis.yml

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ php:
55
- '5.5'
66
- '5.4'
77

8+
sudo: false
9+
810

911
before_script:
1012
- composer self-update
13+
- composer --version
1114
- THEME_SLUG=$(pwd)
1215
- cd /tmp/
1316
- git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs

archive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
printf(
5757
__('All entries by this author', 'multiloquent')
5858
);
59-
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
59+
} elseif (isset($_GET['paged']) && ! empty($_GET['paged'])) {
6060
printf(
6161
__('Blog Archives', 'multiloquent')
6262
);

author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<div class="col-xs-12">
5353
<?php
5454
$description = get_the_author_meta('description');
55-
if (!empty($description)) {
55+
if ( ! empty($description)) {
5656
echo '<p>' . $description . '</p>';
5757
}
5858
?>

comments.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</nav>
4040
<?php
4141
}
42-
if (!comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) {
42+
if ( ! comments_open() && ! is_page() && post_type_supports(get_post_type(), 'comments')) {
4343
?>
4444
<div class="alert alert-block fade in">
4545
<a class="close" data-dismiss="alert">&times;</a>
@@ -59,7 +59,7 @@
5959
</section>
6060
<?php
6161
}
62-
if (!have_comments() && !comments_open() && !is_page() && post_type_supports(get_post_type(), 'comments')) {
62+
if ( ! have_comments() && ! comments_open() && ! is_page() && post_type_supports(get_post_type(), 'comments')) {
6363
?>
6464
<section id="comments">
6565
<div class="alert alert-block fade in">
@@ -81,7 +81,7 @@
8181
<section>
8282
<div>
8383
<p class="cancel-comment-reply"><?php cancel_comment_reply_link(); ?></p>
84-
<?php if (get_option('comment_registration') && !is_user_logged_in()) { ?>
84+
<?php if (get_option('comment_registration') && ! is_user_logged_in()) { ?>
8585
<p>
8686
<?php
8787
printf(

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
printf(
4747
__('All entries by this author', 'multiloquent')
4848
);
49-
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
49+
} elseif (isset($_GET['paged']) && ! empty($_GET['paged'])) {
5050
printf(
5151
__('Blog Archives', 'multiloquent')
5252
);

metadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
echo '<span itemprop="author" class="author">';
1515
// check to see if the user has a url set in their meta data; if they have then use it as the rel=author link
1616
$user_url = get_the_author_meta('user_url');
17-
if (!empty($user_url)) {
17+
if ( ! empty($user_url)) {
1818
echo '<a href="' . $user_url . '" rel="author">';
1919
printf(
2020
__('by %s', 'multiloquent'),

multiloquent-base.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function multiloquent_register() {
6060
$this->multiloquent_menu();
6161
set_post_thumbnail_size(605, 100);
6262
add_image_size('featured-post-thumbnail', 605, 100);
63-
if (!isset($content_width)) {
63+
if ( ! isset($content_width)) {
6464
$content_width = 900;
6565
}
6666
// sidebars
@@ -73,7 +73,7 @@ function multiloquent_register() {
7373
* @param string $content
7474
* @return string
7575
*/
76-
function multiloquent_featured_image_in_feed($content) {
76+
function multiloquent_featured_image_in_feed( $content ) {
7777
global $post;
7878
if (is_feed()) {
7979
if (has_post_thumbnail($post->ID)) {
@@ -94,7 +94,7 @@ function multiloquent_featured_image_in_feed($content) {
9494
* name of file to include, excluding .php extension
9595
* @global object $post the wordpress post object
9696
*/
97-
function multiloquent_get_template_part($file) {
97+
function multiloquent_get_template_part( $file ) {
9898
// needed for the included files...
9999
global $post;
100100
require_once(trailingslashit(get_template_directory()) . $file . '.php');
@@ -105,7 +105,7 @@ function multiloquent_get_template_part($file) {
105105
* @api
106106
* @param object $wp_customize
107107
*/
108-
function multiloquent_customize_register($wp_customize) {
108+
function multiloquent_customize_register( $wp_customize ) {
109109
$wp_customize->add_section('multiloquent_settings', array('title' => __('Multiloquent Settings', 'multiloquent'), 'priority' => 30));
110110
$this->multiloquent_register_and_generate_custom_control('paralax_featured', 'paralax_featured', 'default', __('Excerpt or tags in featured posts', 'multiloquent'), $wp_customize, 'multiloquent_settings');
111111
$this->multiloquent_register_and_generate_custom_control('bootswatch', 'bootswatch', 'default', __('bootswatch', 'multiloquent'), $wp_customize, 'colors');
@@ -129,7 +129,7 @@ function multiloquent_customize_register($wp_customize) {
129129
* @param object $wp_customize
130130
* @param string $section
131131
*/
132-
function multiloquent_register_and_generate_custom_control($setting_type, $setting_name, $default, $label, $wp_customize, $section) {
132+
function multiloquent_register_and_generate_custom_control( $setting_type, $setting_name, $default, $label, $wp_customize, $section ) {
133133
$wp_customize->add_setting($setting_name, array('default' => $default, 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr'));
134134
if ($setting_type == 'colour') {
135135
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, $setting_name, array('label' => $label, 'section' => $section, 'settings' => $setting_name)));
@@ -154,8 +154,8 @@ function multiloquent_register_and_generate_custom_control($setting_type, $setti
154154
* @param array $mods
155155
* @return boolean
156156
*/
157-
function multiloquent_check_theme_mod_colour($item, $default_value, $mods) {
158-
if ((!empty($mods['bootswatch']) && $mods['bootswatch'] != 'default' && !empty($mods[$item])) || (!empty($mods[$item]) && $mods[$item] != $default_value)) {
157+
function multiloquent_check_theme_mod_colour( $item, $default_value, $mods ) {
158+
if (( ! empty($mods['bootswatch']) && $mods['bootswatch'] != 'default' && ! empty($mods[$item])) || ( ! empty($mods[$item]) && $mods[$item] != $default_value)) {
159159
return true;
160160
} else {
161161
return false;
@@ -216,7 +216,7 @@ function multiloquent_customize_css() {
216216
$output .= '}' . "\r\n";
217217
}
218218
// if there is any output, render it
219-
if (!empty($output)) {
219+
if ( ! empty($output)) {
220220
echo '<style type="text/css">' . $output . '</style>';
221221
}
222222
}
@@ -243,7 +243,7 @@ function multiloquent_scripts_method() {
243243
function multiloquent_stylesheet_method() {
244244
// todo - make is use the default one if none are set
245245
$mods = get_theme_mods();
246-
if (!empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
246+
if ( ! empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
247247
wp_enqueue_style('bootstrap', get_template_directory_uri() . '/bootstrap/css/' . esc_attr(get_theme_mod('bootswatch')) . '/bootstrap.min.css');
248248
wp_enqueue_style('style', get_stylesheet_uri());
249249
} else {
@@ -281,7 +281,7 @@ function multiloquent_generate_sidebars() {
281281
* @param array $classes
282282
* @return array
283283
*/
284-
function multiloquent_remove_hentry_function($classes) {
284+
function multiloquent_remove_hentry_function( $classes ) {
285285
// if (($key = array_search('hentry', $classes)) !== false) {
286286
// unset($classes[$key]);
287287
// }
@@ -294,7 +294,7 @@ function multiloquent_remove_hentry_function($classes) {
294294
* @param string $html
295295
* @return string
296296
*/
297-
function multiloquent_add_class_the_tags($html) {
297+
function multiloquent_add_class_the_tags( $html ) {
298298
$html = str_replace('<a', '<a class="label"', $html);
299299
return $html;
300300
}
@@ -305,7 +305,7 @@ function multiloquent_add_class_the_tags($html) {
305305
* @return array
306306
* @internal internal
307307
*/
308-
function multiloquent_widget_tag_cloud_args($args) {
308+
function multiloquent_widget_tag_cloud_args( $args ) {
309309
$args['number'] = 20;
310310
// show less tags
311311
$args['largest'] = 20;
@@ -321,8 +321,8 @@ function multiloquent_widget_tag_cloud_args($args) {
321321
* @return string
322322
* @example multiloquent_post_title(12);
323323
*/
324-
function multiloquent_post_title($post_id = 0) {
325-
if (!empty($post_id)) {
324+
function multiloquent_post_title( $post_id = 0 ) {
325+
if ( ! empty($post_id)) {
326326
$the_title = get_the_title($post_id);
327327
} else {
328328
$the_title = get_the_title();
@@ -339,7 +339,7 @@ function multiloquent_post_title($post_id = 0) {
339339
* @param string $tag_cloud
340340
* @return string
341341
*/
342-
function multiloquent_tag_cloud_filter($tag_cloud) {
342+
function multiloquent_tag_cloud_filter( $tag_cloud ) {
343343
return '<div id="tag-cloud">' . $tag_cloud . '</div>';
344344
}
345345

@@ -352,7 +352,7 @@ function multiloquent_breadcrumbs() {
352352
global $post;
353353
$return = '';
354354
// $image_url = get_template_directory_uri() ;
355-
if (!is_home()) {
355+
if ( ! is_home()) {
356356
$return .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">';
357357
$return .= '<a itemprop="item" href="';
358358
$return .= home_url();
@@ -364,7 +364,7 @@ function multiloquent_breadcrumbs() {
364364
$return .= '</li>';
365365
}
366366

367-
if (is_category() || (is_single() && !is_attachment())) {
367+
if (is_category() || (is_single() && ! is_attachment())) {
368368
$category = get_the_category();
369369
$catID = $category[0]->cat_ID;
370370
$category_parents = get_category_parents($catID, false, ':::', false);
@@ -373,7 +373,7 @@ function multiloquent_breadcrumbs() {
373373
foreach ($category_slug as $category => $slug) {
374374
$current_category = '';
375375
$current_category = get_category_by_slug($slug);
376-
if (!empty($slug)) {
376+
if ( ! empty($slug)) {
377377
$return .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">';
378378
$return .= '<a itemprop="item" href="/'. $current_category->slug.'">';
379379
$return .= '<span itemprop="name">'.$current_category->name.'</span>';
@@ -409,16 +409,16 @@ function multiloquent_breadcrumbs() {
409409
* @param string $class
410410
* @return string <string>
411411
*/
412-
function multiloquent_get_random_solid_class($class = '') {
412+
function multiloquent_get_random_solid_class( $class = '' ) {
413413
$mods = get_theme_mods();
414-
if (!empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
414+
if ( ! empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
415415
// if it uses one of the bootswatch themes, use the bootstrap colours
416416
$input = array('label-primary', 'label-success', 'label-warning', 'label-info', 'label-danger', 'label-default');
417417
} else {
418418
$input = array('swatch-red', 'swatch-orange', 'swatch-yellow', 'swatch-green', 'swatch-teal', 'swatch-blue', 'swatch-violet', 'swatch-pink', 'swatch-mid-gray', 'swatch-gray');
419419
}
420420
$apps = array('phone', 'appstore', 'calculator', 'compass', 'itunes', 'mail', 'music', 'weather', 'maps', 'videos', 'notes', 'reminders', 'calendar', 'facebook', 'google', 'twitter', 'linkedin', 'finder', 'safari', 'firefox');
421-
if (!empty($class) && in_array($class, $apps)) {
421+
if ( ! empty($class) && in_array($class, $apps)) {
422422
return $tile_colour = $class;
423423
} else {
424424
$rand_keys = array_rand($input);
@@ -433,14 +433,14 @@ function multiloquent_get_random_solid_class($class = '') {
433433
*/
434434
function multiloquent_get_random_blue_class() {
435435
$mods = get_theme_mods();
436-
if (!empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
436+
if ( ! empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
437437
// if it uses one of the bootswatch themes, use the bootstrap colours
438438
$input = array('label-primary', 'label-success', 'label-warning', 'label-info', 'label-danger', 'label-default');
439439
} else {
440440
$input = array('swatch-blue1', 'swatch-blue2', 'swatch-blue3', 'swatch-blue4', 'swatch-blue5', 'swatch-blue', 'swatch-gray', 'swatch-violet');
441441
}
442442
$apps = array('phone', 'appstore', 'calculator', 'compass', 'itunes', 'mail', 'music', 'weather', 'maps', 'videos', 'notes', 'reminders', 'calendar', 'facebook', 'google', 'twitter', 'linkedin', 'finder', 'safari', 'firefox');
443-
if (!empty($class) && in_array($class, $apps)) {
443+
if ( ! empty($class) && in_array($class, $apps)) {
444444
return $tile_colour = $class;
445445
} else {
446446
$rand_keys = array_rand($input);
@@ -454,16 +454,16 @@ function multiloquent_get_random_blue_class() {
454454
* @param string $class
455455
* @return string Ambigous
456456
*/
457-
function multiloquent_get_random_colour_class($class = '') {
457+
function multiloquent_get_random_colour_class( $class = '' ) {
458458
$mods = get_theme_mods();
459-
if (!empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
459+
if ( ! empty($mods['bootswatch']) && $mods['bootswatch'] != 'default') {
460460
// if it uses one of the bootswatch themes, use the bootstrap colours
461461
$input = array('label-primary', 'label-success', 'label-warning', 'label-info', 'label-danger', 'label-default');
462462
} else {
463463
$input = array('gradient-red', 'gradient-orange', 'gradient-yellow', 'gradient-green', 'gradient-teal', 'gradient-blue', 'gradient-violet', 'gradient-magenta', 'gradient-black', 'gradient-silver');
464464
}
465465
$apps = array('phone', 'appstore', 'calculator', 'compass', 'itunes', 'mail', 'music', 'weather', 'maps', 'videos', 'notes', 'reminders', 'calendar', 'facebook', 'google', 'twitter', 'linkedin', 'finder', 'safari', 'firefox');
466-
if (!empty($class) && in_array($class, $apps)) {
466+
if ( ! empty($class) && in_array($class, $apps)) {
467467
return $tile_colour = $class;
468468
} else {
469469
$rand_keys = array_rand($input);
@@ -477,15 +477,15 @@ function multiloquent_get_random_colour_class($class = '') {
477477
* @param string $cat
478478
* @return string
479479
*/
480-
function multiloquent_category_list_as_hierarchy($cat = '0') {
480+
function multiloquent_category_list_as_hierarchy( $cat = '0' ) {
481481
$tags = get_categories('hide_empty=true&orderby=name&order=ASC&parent=' . $cat);
482482
// Output a wrapper so that our arrays will be contained in 4 columns.
483483
$html = '';
484484
if ($tags) {
485485
// Output the markup for each tag found for each character.
486486
// in here I need to recurse down
487487
$old_tile_colour = $this->multiloquent_get_random_blue_class();
488-
foreach ((array)$tags as $tag) {
488+
foreach ((array) $tags as $tag) {
489489
// set the old colour so I can re-set it at the bottom
490490
$new_tile_colour = $this->multiloquent_get_random_solid_class($tag->slug);
491491
// fetch the new colour, if the returned string matches the slug, then set the tile_colour to it,
@@ -661,7 +661,7 @@ function multiloquent_paralax_featured_sliders() {
661661
* @param string $avatar
662662
* @return mixed
663663
*/
664-
function multiloquent_get_avatar($avatar) {
664+
function multiloquent_get_avatar( $avatar ) {
665665
$avatar = str_replace("class='avatar", "class='avatar img-responsive center-block", $avatar);
666666
return $avatar;
667667
}
@@ -676,12 +676,12 @@ function multiloquent_get_avatar($avatar) {
676676
* @see multiloquent_get_random_solid_class()
677677
* @see multiloquent_get_random_blue_class()
678678
*/
679-
function multiloquent_render_the_archive($colour) {
679+
function multiloquent_render_the_archive( $colour ) {
680680
// set it to blank so that it doesnt get the previous one..
681681
global $post;
682682
$thumbnail_id = get_the_ID();
683683
$slider_image = wp_get_attachment_image_src(get_post_thumbnail_id($thumbnail_id), 'single-post-thumbnail');
684-
if (!empty($slider_image)) {
684+
if ( ! empty($slider_image)) {
685685
$the_image = $slider_image[0];
686686
// $width = $slider_image[1];
687687
// $height = $slider_image[2];
@@ -701,7 +701,7 @@ function multiloquent_render_the_archive($colour) {
701701
echo $this->multiloquent_post_title();
702702
?>
703703
</a>
704-
</span>
704+
</span>¬
705705

706706
<p>
707707
<?php echo $this->multiloquent_render_tags($post); ?>
@@ -719,19 +719,19 @@ function multiloquent_render_the_archive($colour) {
719719
* (set to true to force tag output)
720720
* @return string
721721
*/
722-
function multiloquent_render_tags($val, $force_tags = false) {
722+
function multiloquent_render_tags( $val, $force_tags = false ) {
723723
$output = '';
724724
// check if they have selected tags or excerpt
725725
$mods = get_theme_mods();
726-
if (!empty($mods['paralax_featured']) && $mods['paralax_featured'] == 'excerpt' && empty($force_tags)) {
726+
if ( ! empty($mods['paralax_featured']) && $mods['paralax_featured'] == 'excerpt' && empty($force_tags)) {
727727
// they have selected 'excerpt'
728728
// $excerpt = apply_filters( 'get_the_excerpt', $val->post_excerpt );
729729
$excerpt = wp_trim_words(apply_filters('the_excerpt', $val->post_excerpt));
730730
if (empty($excerpt)) {
731731
$excerpt = wp_trim_words($val->post_content);
732732
}
733733
$output .= $excerpt;
734-
} elseif (!empty($mods['paralax_featured']) && $mods['paralax_featured'] == 'empty' && empty($force_tags)) {
734+
} elseif ( ! empty($mods['paralax_featured']) && $mods['paralax_featured'] == 'empty' && empty($force_tags)) {
735735
// dont output anything, leave the tags thing empty, append nothing to the output to fool the wordpress
736736
// coding standards
737737
$output .= '';

ruleset.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
<exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>
2828
<exclude name="Squiz.WhiteSpace.SuperfluousWhitespace.EndLine"/>
2929
<exclude name="Generic.Commenting.DocComment.SpacingBeforeTags"/>
30-
31-
32-
30+
<exclude name="WordPress.VIP.RestrictedFunctions.get_category_by_slug"/>
3331
</rule>
3432
</ruleset>

search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* search results page
1111
*/
1212

13-
if (empty($_REQUEST['search']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['search'])), 'search')) {
13+
if (empty($_REQUEST['search']) || ! wp_verify_nonce(sanitize_text_field(wp_unslash($_REQUEST['search'])), 'search')) {
1414
// 404 ?
1515
get_header();
1616
echo '<div class="container post"> ';

template-tag-index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
if ($tags) {
4141
$html .= '<ul class="thumbnails row">';
4242
$first_colour = $multiloquent->multiloquent_get_random_solid_class($tag->slug);
43-
foreach ((array)$tags as $tag) {
43+
foreach ((array) $tags as $tag) {
4444
$tag_link = get_tag_link($tag->term_id);
4545
$second_colour = $multiloquent->multiloquent_get_random_blue_class($tag->slug);
4646
if ($tag->slug == $second_colour) {

0 commit comments

Comments
 (0)