Пример #1
0
function mysiteapp_homepage_carousel_rotate_interval()
{
    $num = 5;
    $homepageSettings = uppsite_homepage_get_settings();
    if (isset($homepageSettings['rotate_interval']) && is_numeric($homepageSettings['rotate_interval'])) {
        $num = $homepageSettings['rotate_interval'];
    }
    return min(abs($num), 30);
}
Пример #2
0
 function uppsite_homepage_get_categories()
 {
     $cats = null;
     if (array_key_exists('cats_ar', $_REQUEST) && is_array($_REQUEST['cats_ar'])) {
         $cats = $_REQUEST['cats_ar'];
     } else {
         $settings = uppsite_homepage_get_settings();
         $cats = array_key_exists('cats_ar', $settings) ? $settings['cats_ar'] : mysiteapp_homepage_get_popular_categories();
     }
     $cats = array_splice($cats, 0, UPPSITE_UPPER_LIMIT);
     $cats = array_map('sanitize_text_field', $cats);
     return $cats;
 }