@@ -60,7 +60,7 @@ function multiloquent_register() {
60
60
$ this ->multiloquent_menu ();
61
61
set_post_thumbnail_size (605 , 100 );
62
62
add_image_size ('featured-post-thumbnail ' , 605 , 100 );
63
- if (! isset ($ content_width )) {
63
+ if ( ! isset ($ content_width )) {
64
64
$ content_width = 900 ;
65
65
}
66
66
// sidebars
@@ -73,7 +73,7 @@ function multiloquent_register() {
73
73
* @param string $content
74
74
* @return string
75
75
*/
76
- function multiloquent_featured_image_in_feed ($ content ) {
76
+ function multiloquent_featured_image_in_feed ( $ content ) {
77
77
global $ post ;
78
78
if (is_feed ()) {
79
79
if (has_post_thumbnail ($ post ->ID )) {
@@ -94,7 +94,7 @@ function multiloquent_featured_image_in_feed($content) {
94
94
* name of file to include, excluding .php extension
95
95
* @global object $post the wordpress post object
96
96
*/
97
- function multiloquent_get_template_part ($ file ) {
97
+ function multiloquent_get_template_part ( $ file ) {
98
98
// needed for the included files...
99
99
global $ post ;
100
100
require_once (trailingslashit (get_template_directory ()) . $ file . '.php ' );
@@ -105,7 +105,7 @@ function multiloquent_get_template_part($file) {
105
105
* @api
106
106
* @param object $wp_customize
107
107
*/
108
- function multiloquent_customize_register ($ wp_customize ) {
108
+ function multiloquent_customize_register ( $ wp_customize ) {
109
109
$ wp_customize ->add_section ('multiloquent_settings ' , array ('title ' => __ ('Multiloquent Settings ' , 'multiloquent ' ), 'priority ' => 30 ));
110
110
$ this ->multiloquent_register_and_generate_custom_control ('paralax_featured ' , 'paralax_featured ' , 'default ' , __ ('Excerpt or tags in featured posts ' , 'multiloquent ' ), $ wp_customize , 'multiloquent_settings ' );
111
111
$ 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) {
129
129
* @param object $wp_customize
130
130
* @param string $section
131
131
*/
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 ) {
133
133
$ wp_customize ->add_setting ($ setting_name , array ('default ' => $ default , 'transport ' => 'refresh ' , 'sanitize_callback ' => 'esc_attr ' ));
134
134
if ($ setting_type == 'colour ' ) {
135
135
$ 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
154
154
* @param array $mods
155
155
* @return boolean
156
156
*/
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 )) {
159
159
return true ;
160
160
} else {
161
161
return false ;
@@ -216,7 +216,7 @@ function multiloquent_customize_css() {
216
216
$ output .= '} ' . "\r\n" ;
217
217
}
218
218
// if there is any output, render it
219
- if (! empty ($ output )) {
219
+ if ( ! empty ($ output )) {
220
220
echo '<style type="text/css"> ' . $ output . '</style> ' ;
221
221
}
222
222
}
@@ -243,7 +243,7 @@ function multiloquent_scripts_method() {
243
243
function multiloquent_stylesheet_method () {
244
244
// todo - make is use the default one if none are set
245
245
$ mods = get_theme_mods ();
246
- if (! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
246
+ if ( ! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
247
247
wp_enqueue_style ('bootstrap ' , get_template_directory_uri () . '/bootstrap/css/ ' . esc_attr (get_theme_mod ('bootswatch ' )) . '/bootstrap.min.css ' );
248
248
wp_enqueue_style ('style ' , get_stylesheet_uri ());
249
249
} else {
@@ -281,7 +281,7 @@ function multiloquent_generate_sidebars() {
281
281
* @param array $classes
282
282
* @return array
283
283
*/
284
- function multiloquent_remove_hentry_function ($ classes ) {
284
+ function multiloquent_remove_hentry_function ( $ classes ) {
285
285
// if (($key = array_search('hentry', $classes)) !== false) {
286
286
// unset($classes[$key]);
287
287
// }
@@ -294,7 +294,7 @@ function multiloquent_remove_hentry_function($classes) {
294
294
* @param string $html
295
295
* @return string
296
296
*/
297
- function multiloquent_add_class_the_tags ($ html ) {
297
+ function multiloquent_add_class_the_tags ( $ html ) {
298
298
$ html = str_replace ('<a ' , '<a class="label" ' , $ html );
299
299
return $ html ;
300
300
}
@@ -305,7 +305,7 @@ function multiloquent_add_class_the_tags($html) {
305
305
* @return array
306
306
* @internal internal
307
307
*/
308
- function multiloquent_widget_tag_cloud_args ($ args ) {
308
+ function multiloquent_widget_tag_cloud_args ( $ args ) {
309
309
$ args ['number ' ] = 20 ;
310
310
// show less tags
311
311
$ args ['largest ' ] = 20 ;
@@ -321,8 +321,8 @@ function multiloquent_widget_tag_cloud_args($args) {
321
321
* @return string
322
322
* @example multiloquent_post_title(12);
323
323
*/
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 )) {
326
326
$ the_title = get_the_title ($ post_id );
327
327
} else {
328
328
$ the_title = get_the_title ();
@@ -339,7 +339,7 @@ function multiloquent_post_title($post_id = 0) {
339
339
* @param string $tag_cloud
340
340
* @return string
341
341
*/
342
- function multiloquent_tag_cloud_filter ($ tag_cloud ) {
342
+ function multiloquent_tag_cloud_filter ( $ tag_cloud ) {
343
343
return '<div id="tag-cloud"> ' . $ tag_cloud . '</div> ' ;
344
344
}
345
345
@@ -352,7 +352,7 @@ function multiloquent_breadcrumbs() {
352
352
global $ post ;
353
353
$ return = '' ;
354
354
// $image_url = get_template_directory_uri() ;
355
- if (! is_home ()) {
355
+ if ( ! is_home ()) {
356
356
$ return .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> ' ;
357
357
$ return .= '<a itemprop="item" href=" ' ;
358
358
$ return .= home_url ();
@@ -364,7 +364,7 @@ function multiloquent_breadcrumbs() {
364
364
$ return .= '</li> ' ;
365
365
}
366
366
367
- if (is_category () || (is_single () && !is_attachment ())) {
367
+ if (is_category () || (is_single () && ! is_attachment ())) {
368
368
$ category = get_the_category ();
369
369
$ catID = $ category [0 ]->cat_ID ;
370
370
$ category_parents = get_category_parents ($ catID , false , '::: ' , false );
@@ -373,7 +373,7 @@ function multiloquent_breadcrumbs() {
373
373
foreach ($ category_slug as $ category => $ slug ) {
374
374
$ current_category = '' ;
375
375
$ current_category = get_category_by_slug ($ slug );
376
- if (! empty ($ slug )) {
376
+ if ( ! empty ($ slug )) {
377
377
$ return .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> ' ;
378
378
$ return .= '<a itemprop="item" href="/ ' . $ current_category ->slug .'"> ' ;
379
379
$ return .= '<span itemprop="name"> ' .$ current_category ->name .'</span> ' ;
@@ -409,16 +409,16 @@ function multiloquent_breadcrumbs() {
409
409
* @param string $class
410
410
* @return string <string>
411
411
*/
412
- function multiloquent_get_random_solid_class ($ class = '' ) {
412
+ function multiloquent_get_random_solid_class ( $ class = '' ) {
413
413
$ mods = get_theme_mods ();
414
- if (! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
414
+ if ( ! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
415
415
// if it uses one of the bootswatch themes, use the bootstrap colours
416
416
$ input = array ('label-primary ' , 'label-success ' , 'label-warning ' , 'label-info ' , 'label-danger ' , 'label-default ' );
417
417
} else {
418
418
$ input = array ('swatch-red ' , 'swatch-orange ' , 'swatch-yellow ' , 'swatch-green ' , 'swatch-teal ' , 'swatch-blue ' , 'swatch-violet ' , 'swatch-pink ' , 'swatch-mid-gray ' , 'swatch-gray ' );
419
419
}
420
420
$ 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 )) {
422
422
return $ tile_colour = $ class ;
423
423
} else {
424
424
$ rand_keys = array_rand ($ input );
@@ -433,14 +433,14 @@ function multiloquent_get_random_solid_class($class = '') {
433
433
*/
434
434
function multiloquent_get_random_blue_class () {
435
435
$ mods = get_theme_mods ();
436
- if (! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
436
+ if ( ! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
437
437
// if it uses one of the bootswatch themes, use the bootstrap colours
438
438
$ input = array ('label-primary ' , 'label-success ' , 'label-warning ' , 'label-info ' , 'label-danger ' , 'label-default ' );
439
439
} else {
440
440
$ input = array ('swatch-blue1 ' , 'swatch-blue2 ' , 'swatch-blue3 ' , 'swatch-blue4 ' , 'swatch-blue5 ' , 'swatch-blue ' , 'swatch-gray ' , 'swatch-violet ' );
441
441
}
442
442
$ 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 )) {
444
444
return $ tile_colour = $ class ;
445
445
} else {
446
446
$ rand_keys = array_rand ($ input );
@@ -454,16 +454,16 @@ function multiloquent_get_random_blue_class() {
454
454
* @param string $class
455
455
* @return string Ambigous
456
456
*/
457
- function multiloquent_get_random_colour_class ($ class = '' ) {
457
+ function multiloquent_get_random_colour_class ( $ class = '' ) {
458
458
$ mods = get_theme_mods ();
459
- if (! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
459
+ if ( ! empty ($ mods ['bootswatch ' ]) && $ mods ['bootswatch ' ] != 'default ' ) {
460
460
// if it uses one of the bootswatch themes, use the bootstrap colours
461
461
$ input = array ('label-primary ' , 'label-success ' , 'label-warning ' , 'label-info ' , 'label-danger ' , 'label-default ' );
462
462
} else {
463
463
$ input = array ('gradient-red ' , 'gradient-orange ' , 'gradient-yellow ' , 'gradient-green ' , 'gradient-teal ' , 'gradient-blue ' , 'gradient-violet ' , 'gradient-magenta ' , 'gradient-black ' , 'gradient-silver ' );
464
464
}
465
465
$ 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 )) {
467
467
return $ tile_colour = $ class ;
468
468
} else {
469
469
$ rand_keys = array_rand ($ input );
@@ -477,15 +477,15 @@ function multiloquent_get_random_colour_class($class = '') {
477
477
* @param string $cat
478
478
* @return string
479
479
*/
480
- function multiloquent_category_list_as_hierarchy ($ cat = '0 ' ) {
480
+ function multiloquent_category_list_as_hierarchy ( $ cat = '0 ' ) {
481
481
$ tags = get_categories ('hide_empty=true&orderby=name&order=ASC&parent= ' . $ cat );
482
482
// Output a wrapper so that our arrays will be contained in 4 columns.
483
483
$ html = '' ;
484
484
if ($ tags ) {
485
485
// Output the markup for each tag found for each character.
486
486
// in here I need to recurse down
487
487
$ old_tile_colour = $ this ->multiloquent_get_random_blue_class ();
488
- foreach ((array )$ tags as $ tag ) {
488
+ foreach ((array ) $ tags as $ tag ) {
489
489
// set the old colour so I can re-set it at the bottom
490
490
$ new_tile_colour = $ this ->multiloquent_get_random_solid_class ($ tag ->slug );
491
491
// 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() {
661
661
* @param string $avatar
662
662
* @return mixed
663
663
*/
664
- function multiloquent_get_avatar ($ avatar ) {
664
+ function multiloquent_get_avatar ( $ avatar ) {
665
665
$ avatar = str_replace ("class='avatar " , "class='avatar img-responsive center-block " , $ avatar );
666
666
return $ avatar ;
667
667
}
@@ -676,12 +676,12 @@ function multiloquent_get_avatar($avatar) {
676
676
* @see multiloquent_get_random_solid_class()
677
677
* @see multiloquent_get_random_blue_class()
678
678
*/
679
- function multiloquent_render_the_archive ($ colour ) {
679
+ function multiloquent_render_the_archive ( $ colour ) {
680
680
// set it to blank so that it doesnt get the previous one..
681
681
global $ post ;
682
682
$ thumbnail_id = get_the_ID ();
683
683
$ 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 )) {
685
685
$ the_image = $ slider_image [0 ];
686
686
// $width = $slider_image[1];
687
687
// $height = $slider_image[2];
@@ -701,7 +701,7 @@ function multiloquent_render_the_archive($colour) {
701
701
echo $ this ->multiloquent_post_title ();
702
702
?>
703
703
</a>
704
- </span>
704
+ </span>¬
705
705
706
706
<p>
707
707
<?php echo $ this ->multiloquent_render_tags ($ post ); ?>
@@ -719,19 +719,19 @@ function multiloquent_render_the_archive($colour) {
719
719
* (set to true to force tag output)
720
720
* @return string
721
721
*/
722
- function multiloquent_render_tags ($ val , $ force_tags = false ) {
722
+ function multiloquent_render_tags ( $ val , $ force_tags = false ) {
723
723
$ output = '' ;
724
724
// check if they have selected tags or excerpt
725
725
$ 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 )) {
727
727
// they have selected 'excerpt'
728
728
// $excerpt = apply_filters( 'get_the_excerpt', $val->post_excerpt );
729
729
$ excerpt = wp_trim_words (apply_filters ('the_excerpt ' , $ val ->post_excerpt ));
730
730
if (empty ($ excerpt )) {
731
731
$ excerpt = wp_trim_words ($ val ->post_content );
732
732
}
733
733
$ 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 )) {
735
735
// dont output anything, leave the tags thing empty, append nothing to the output to fool the wordpress
736
736
// coding standards
737
737
$ output .= '' ;
0 commit comments