Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] Check if custom field contains a string and return a specific value

$
0
0

so it would look something like this?

add_shortcode( 'check-string', 'check_string_func' );
function check_string_func( $atts ) {
    extract(shortcode_atts(array(
            'string' => '',
            'looking' => 'facebook',
        ), $atts)
    );
    if(strpos($string, $looking) != 0){
        return 1;   
    }else{
        return 0;
    }   
}

Viewing all articles
Browse latest Browse all 20145

Trending Articles