예제 #1
0
function get_widget_name_value()
{
    $development_myval = get_option('sidebars_widgets');
    foreach (get_widget_area() as $val) {
        foreach ($development_myval[$val] as $keys => $values) {
            $string_val = str_before($values, "-");
            $wid_val[$string_val] = 'widget_' . $string_val;
        }
    }
    return $wid_val;
}
function self($cut_query = false)
{
    $uri = $_SERVER['REQUEST_URI'];
    if ($cut_query) {
        $before = str_before($uri, '?');
        if ($before) {
            return $before;
        }
    }
    return $uri;
}
 public function test_str_before()
 {
     $string = str_before('*****@*****.**', '@');
     $this->assertEquals('user', $string);
 }
예제 #4
0
function google_cache($url)
{
    return 'http://webcache.googleusercontent.com/search?q=cache:' . urlencode(str_before($url, '?'));
}