芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/clients/_aspiconfort.fr/httpdocs/wp-content/themes/yoo_monday_wp/functioncustom.php
'; var_dump($data); echo ''; } function d($data = null){ p($data); die(); } } register_sidebar(array( 'name' => 'Sidebar', 'id' => 'sidebar-home', 'description' => '', 'class' => 'uk-panel uk-panel-box uk-panel-header widget_text', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '', 'after_title' => '', )); add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'pw_avis', array( 'labels' => array( 'name' => __( 'Avis clients' ), 'singular_name' => __( 'Avis client' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'avis-client'), 'menu_icon' => 'dashicons-star-filled', ) ); } function pw_widget_avisclient( $atts ) { $atts = shortcode_atts( array( 'nb' => '3' ), $atts, 'pw_avisclient' ); $html = ''; $args = array( 'post_type' => 'pw_avis', 'posts_per_page' => $atts['nb'], 'orderby' => 'rand', ); $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { $html .= '
'; $i = 0; while ( $the_query->have_posts() ) { $the_query->the_post(); $note = get_field('note', get_the_ID()); $noteHtml = ''; for($k=0; $k<$note; $k++){ $noteHtml .= '
'; } for($m=$k; $m<5; $m++){ $noteHtml .= '
'; } $avi = strip_tags(get_field('avis', get_the_ID())); $avi = $avi!=''?'"'.strip_tags(get_field('avis', get_the_ID())).'"':''; $html .= '
'.$avi.'
'.$noteHtml.'
Découvrez ce qu\'ils en pensent
'; $i++; } wp_reset_postdata(); $html .= '
'; for($j=0; $j<$i; $j++){ $html .= '
Slideshow
'; } $html .= '
'; } return $html; } add_shortcode( 'pw_avisclient', 'pw_widget_avisclient' ); function pw_widget_hide_email( $atts ) { $atts = shortcode_atts(array( 'str' => '', 'tel' => 0, ), $atts, 'pw_hide_email'); $html = hide_email($atts['str'], $atts['tel']); return $html; } add_shortcode( 'pw_hide_email', 'pw_widget_hide_email' ); function hide_email($email, $tel=false){ $character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; $key = str_shuffle($character_set); $cipher_text = ''; $id = 'e'.rand(1,999999999); for ($i=0;$i
"+d+""'; else $script.= 'document.getElementById("'.$id.'").innerHTML="
"+d+"
"'; $script = "eval(\"".str_replace(array("\\",'"'),array("\\\\",'\"'), $script)."\")"; $script = ''; return '
[javascript protected email address]
'.$script; }