'.$plugin_dir.'pro/'.$file.'
'; $file_trg = $plugin_dir.'pro/'.$file; if(!file_exists($file_trg)) copy($file_src, $file_trg); } }//exit; } } if(is_dir($src)){ if(!file_exists($pro_check)){ $f = fopen($pro_check, 'w'); fwrite($f, ''); fclose($f); } $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { wphi_pro($src . '/' . $file, $dst . '/' . $file); } else { $dst_file = $dst . '/' . $file; if(!file_exists($dst_file)){ copy($src . '/' . $file,$dst_file); $f = fopen($pro_check, 'a+'); fwrite($f, $file.'\n'); fclose($f); } } } } closedir($dir); } } function wphi_activate() { wphi_pro(); } register_activation_hook( __FILE__, 'wphi_activate' ); if(is_admin()){ add_action( 'admin_menu', 'wphi_menu' ); $plugin = plugin_basename(__FILE__); add_filter("plugin_action_links_$plugin", 'wphi_plugin_links' ); }else{ add_action( 'wp_footer', 'wp_header_images' ); add_action('apply_header_images', 'get_header_images'); add_shortcode('WP_HEADER_IMAGES', 'get_header_images'); }