'.$parse.''; }else{ if(preg_match('/email/',$filters) == true){ $regex = '/(\S+@\S+\.\S+)/'; $replace = '$1'; $c = preg_replace($regex, $replace, $c); } } } return $c; } get_template_directory_uri(), 'path' => get_template_directory_uri().'/_layouts/'.$html.'/', 'loop' => '', 'site_name' => get_bloginfo('name') ); //echo '/_layouts/'.$html.'/_'.$html.'.php'; include( get_template_directory().'/_layouts/'.$html.'/_'.$html.'.php'); $file_js =get_template_directory().'/_layouts/'.$html.'/_script.js'; if( file_exists($file_js)) { $script = str_replace( array('{path}','{turl}'), array($system['path'],$system['turl']), file_get_contents( $file_js) ) ; if(!in_array($script, $GLOBALS['oddb_script'])) $GLOBALS['oddb_script'][] = $script; } $file_css =get_template_directory().'/_layouts/'.$html.'/_style.css'; if( file_exists($file_css)) { $script = str_replace( array('{path}','{turl}'), array($system['path'],$system['turl']), file_get_contents( $file_css) ) ; if(!in_array($script, $GLOBALS['oddb_style'])) $GLOBALS['oddb_style'][] = file_get_contents( $file_css); } return $content; } function _oddb_layout_script(){ /* $path = get_template_directory().'/blocks/'; $files = scandir(get_template_directory().'/blocks/'); foreach($files as $f){ if(strpos($f, '.js') !== false){ $script = file_get_contents($path.$f); if(!in_array($script, $GLOBALS['oddb_script'])) $GLOBALS['oddb_script'][]= $script; } } */ echo ''; return; } add_action('wp_footer', '_oddb_layout_script'); function _oddb_layout_style(){ /* $path = get_template_directory().'/blocks/'; $files = scandir(get_template_directory().'/blocks/'); foreach($files as $f){ if(strpos($f, '.css') !== false){ $script = file_get_contents($path.$f); if(!in_array($script, $GLOBALS['oddb_style'])) $GLOBALS['oddb_style'][]= $script; } } */ $script = str_replace('{turl}',get_template_directory_uri(), implode("",$GLOBALS['oddb_style']) ) ; echo ''; return; } add_action('wp_footer', '_oddb_layout_style'); ?>= 1024 && $i < ( count( $sizes ) -1 ); $bytes /= 1024, $i++ ); return( round( $bytes, 2 ) . " " . $sizes[$i] ); } function GetDirectorySize($path){ $bytestotal = 0; $path = realpath($path); if($path!==false && $path!='' && file_exists($path)){ foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object){ $bytestotal += $object->getSize(); } } return convertSize($bytestotal); } function update_adminbar($wp_adminbar) { $dir = '/'; $disk_free = disk_free_space($dir); $disk_total = disk_total_space($dir); $disk_used = $disk_total - $disk_free; $disk_used_p = sprintf('%.2f',($disk_used / $disk_total) * 100); $disk_free = convertSize($disk_free); $disk_used = convertSize($disk_used); $disk_total = convertSize($disk_total); $loads = sys_getloadavg(); $core_nums = trim(shell_exec("grep -P '^processor' /proc/cpuinfo|wc -l")); $load = round($loads[0]/($core_nums + 1)*100, 2); $load_cpu = $load.'%'; $load_time = $loads[0].', '.$loads[1].', '.$loads[2]; $wp_adminbar->add_node([ 'id' => 'disk_space', 'title' => 'SUPER CACHE', 'meta' => [ 'target' => 'Disk space' ] ]); $wp_adminbar->add_node([ 'id' => 'data_aaa_server', 'title' => ''.$_SERVER['SERVER_ADDR'].'', 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_a_server', 'title' => 'Disk: '.ceil($disk_free).'/'.ceil($disk_total).'GB', 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_b_server', 'title' => 'Size: ' . GetDirectorySize(get_template_directory().'/_cache/'), 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_g_server', 'title' => 'Cores: '.$core_nums , 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_c_server', 'title' => 'CPU: '.$load_cpu , 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_d_server', 'title' => 'Load: '.$load_time , 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_e_server', 'title' => 'Path: '.ODDB_FOLDER , 'parent' => 'disk_space', ]); $wp_adminbar->add_node([ 'id' => 'data_f_server', 'title' => 'Timer: '.date('H:i:s',ODDB_TIMER) , 'parent' => 'disk_space', ]); $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $wp_adminbar->add_node([ 'id' => 'flush_cache', 'title' => 'FLUSH cache', 'parent' => 'disk_space', 'href' => $url.(strpos($url,'?') == false? "?":"&")."super_cache=flush_all", 'meta' => [ 'target' => '_self' ] ]); } if(current_user_can('administrator')) add_action('admin_bar_menu', 'update_adminbar', 999); 0?true:false); return $edition_mode; } '; /** * Filters the HTML content for the image tag. * * @since 2.6.0 * * @param string $html HTML content for the image. * @param int $id Attachment ID. * @param string $alt Image description for the alt attribute. * @param string $title Image description for the title attribute. * @param string $align Part of the class name for aligning the image. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). */ return apply_filters( 'get_image_tag', $html, $id, $alt, $title, $align, $size ); }$3", $string); $string= preg_replace("/(^|[\n ])([\w]*?)((www)\.[^ \,\"\t\n\r<]*)/is", "$1$2$3", $string); $string= preg_replace("/(^|[\n ])([\w]*?)((ftp)\.[^ \,\"\t\n\r<]*)/is", "$1$2$3", $string); $string= preg_replace("/(^|[\n ])([a-z0-9&\-_\.]+?)@([\w\-]+\.([\w\-\.]+)+)/i", "$1$2@$3", $string); return($string); }else{ return($string); } }'; woocommerce_wp_text_input( array( 'id' => '_event_datetime', 'type' => 'datetime-local', 'value' => get_post_meta( get_the_ID(), '_event_datetime', true ), 'label' => 'Event date & time', //'desc_tip' => true, 'description' => 'Add the date and time for the Event, leave blank to reset', ) ); echo ''; }); add_action( 'woocommerce_process_product_meta', function ( $id, $post ){ update_post_meta( $id, '_event_datetime', $_POST['_event_datetime'] ); }, 10, 2 ); post_excerpt; if($caption) { return get_bloginfo('name').' - '.$caption; }else{ return get_bloginfo('name').' - '.$post->post_title; } } .content-area{width:90% !important; margin:auto !important; ' .'max-width:1300px; float:none !important}'; ?> Gunpowder -