Advertisement
Chouby

database fix

Nov 21st, 2015
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin name: database fix
  4. */
  5.  
  6. add_action( 'admin_init', 'pll_admin_init' );
  7.  
  8. function pll_admin_init() {
  9.     global $polylang;
  10.  
  11.     $terms = get_terms( 'term_language', array( 'slug' => 'pll_tr' ) );
  12.     if ( empty( $terms ) ) {
  13.         wp_insert_term( 'Türkçe', 'term_language', array( 'slug' => 'pll_tr' ) );
  14.         if ( isset( $polylang ) ) {
  15.             $polylang->model->clean_languages_cache();
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement