Last active
February 13, 2019 15:04
-
-
Save Dorf/80679d19a610f9b8dbdf8e4202f5bea0 to your computer and use it in GitHub Desktop.
[Controller App functions for Roots / Sage] example static functions #controller #sage #roots #functions #app #laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App\Controllers; | |
use Sober\Controller\Controller; | |
class App extends Controller | |
{ | |
public static function siteLogo() | |
{ | |
return get_theme_mod('upload_logo'); | |
} | |
public static function siteLogoWhite() | |
{ | |
return get_theme_mod('upload_logo_white'); | |
} | |
public static function footer_logo() | |
{ | |
$logo_footer = get_field('copyright_line_logo_footer', 'option'); | |
return wp_get_attachment_image($logo_footer, 'medium', true, array('class' => 'logo')); | |
} | |
public static function footer_left() | |
{ | |
return get_field('copyright_line_left_footer', 'option'); | |
} | |
public static function footer_right() | |
{ | |
return get_field('copyright_line_right_footer', 'option'); | |
} | |
public static function createSlug($str, $delimiter = '-') | |
{ | |
$slug = strtolower(trim(preg_replace('/[\s-]+/', $delimiter, preg_replace('/[^A-Za-z0-9-]+/', $delimiter, preg_replace('/[&]/', 'and', preg_replace('/[\']/', '', iconv('UTF-8', 'ASCII//TRANSLIT', $str))))), $delimiter)); | |
return $slug; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment