Switch language

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




avoid_blog_page_permalink_collision [ WordPress Function ]

avoid_blog_page_permalink_collision ( $data, $postarr )
Defined at:



No description yet.

Source


<?php
function avoid_blog_page_permalink_collision$data$postarr ) {
    if ( 
is_subdomain_install() )
        return 
$data;
    if ( 
$data['post_type'] != 'page' )
        return 
$data;
    if ( !isset( 
$data['post_name'] ) || $data['post_name'] == '' )
        return 
$data;
    if ( !
is_main_site() )
        return 
$data;

    
$post_name $data['post_name'];
    
$c 0;
    while( 
$c 10 && get_id_from_blogname$post_name ) ) {
        
$post_name .= mt_rand110 );
        
$c ++;
    }
    if ( 
$post_name != $data['post_name'] ) {
        
$data['post_name'] = $post_name;
    }
    return 
$data;
}
?>

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