Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




xfn_check [ WordPress Function ]

xfn_check ( $class, $value = '', $deprecated = '' )
Parameters:
  • (string) $class
  • (string) $value
  • (mixed) $deprecated Never used.
Defined at:



Display checked checkboxes attribute for xfn microformat options.

Source


<?php
function xfn_check$class$value ''$deprecated '' ) {
    global 
$link;

    if ( !empty( 
$deprecated ) )
        
_deprecated_argument__FUNCTION__'0.0' ); // Never implemented

    
$link_rel = isset( $link->link_rel ) ? $link->link_rel ''// In PHP 5.3: $link_rel = $link->link_rel ?: '';
    
$rels preg_split('/\s+/'$link_rel);

    if (
'' != $value && in_array($value$rels) ) {
        echo 
' checked="checked"';
    }

    if (
'' == $value) {
        if (
'family' == $class && strpos($link_rel'child') === false && strpos($link_rel'parent') === false && strpos($link_rel'sibling') === false && strpos($link_rel'spouse') === false && strpos($link_rel'kin') === false) echo ' checked="checked"';
        if (
'friendship' == $class && strpos($link_rel'friend') === false && strpos($link_rel'acquaintance') === false && strpos($link_rel'contact') === false) echo ' checked="checked"';
        if (
'geographical' == $class && strpos($link_rel'co-resident') === false && strpos($link_rel'neighbor') === false) echo ' checked="checked"';
        if (
'identity' == $class && in_array('me'$rels) ) echo ' checked="checked"';
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics