本文整理汇总了PHP中wm_option函数的典型用法代码示例。如果您正苦于以下问题:PHP wm_option函数的具体用法?PHP wm_option怎么用?PHP wm_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wm_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wm_price_cp_init
function wm_price_cp_init() {
global $cpMenuPosition;
$role = ( wm_option( 'cp-role-pricing' ) ) ? ( wm_option( 'cp-role-pricing' ) ) : ( 'page' );
$slug = ( wm_option( 'cp-permalink-price' ) ) ? ( wm_option( 'cp-permalink-price' ) ) : ( 'price' );
$args = array(
'query_var' => 'price',
'capability_type' => $role,
'public' => true,
'show_in_nav_menus' => false,
'show_ui' => true,
'exclude_from_search' => true,
'hierarchical' => false,
'rewrite' => array( 'slug' => $slug ),
'menu_position' => $cpMenuPosition['prices'],
'menu_icon' => WM_ASSETS_ADMIN . 'img/icons/custom-posts/ico-price.png',
'supports' => array( 'title', 'editor', 'author' ),
'labels' => array(
'name' => __( 'Prices', 'lespaul_domain_adm' ),
'singular_name' => __( 'Price', 'lespaul_domain_adm' ),
'add_new' => __( 'Add new price', 'lespaul_domain_adm' ),
'add_new_item' => __( 'Add new price', 'lespaul_domain_adm' ),
'new_item' => __( 'Add new price', 'lespaul_domain_adm' ),
'edit_item' => __( 'Edit price', 'lespaul_domain_adm' ),
'view_item' => __( 'View price', 'lespaul_domain_adm' ),
'search_items' => __( 'Search price', 'lespaul_domain_adm' ),
'not_found' => __( 'No price found', 'lespaul_domain_adm' ),
'not_found_in_trash' => __( 'No price found in trash', 'lespaul_domain_adm' ),
'parent_item_colon' => ''
)
);
register_post_type( 'wm_price' , $args );
}
示例2: __construct
function __construct() {
$id = 'wm-posts-list';
$prefix = ( wm_option( 'branding-panel-no-logo' ) || ! strpos( wm_option( 'branding-panel-logo' ), 'logo-' . WM_THEME_SHORTNAME . '-admin.png' ) ) ? ( '' ) : ( WM_THEME_NAME . ' ' );
$name = '<span>' . $prefix . __( 'Posts', 'lespaul_domain_adm' ) . '</span>';
$widget_ops = array(
'classname' => 'wm-posts-list',
'description' => __( 'List of recent, popular, random or upcoming posts with thumbnail images', 'lespaul_domain_adm' )
);
$control_ops = array();
//$this->WP_Widget( $id, $name, $widget_ops, $control_ops );
parent::__construct( $id, $name, $widget_ops, $control_ops );
} // /__construct
示例3: wm_staff_cp_init
function wm_staff_cp_init() {
global $cpMenuPosition;
$role = ( wm_option( 'cp-role-staff' ) ) ? ( wm_option( 'cp-role-staff' ) ) : ( 'page' );
$slug = ( wm_option( 'cp-permalink-staff' ) ) ? ( wm_option( 'cp-permalink-staff' ) ) : ( 'staff' );
$supports = array( 'title', 'editor', 'thumbnail', 'author' );
if ( wm_option( 'cp-staff-rich' ) )
$supports[] = 'excerpt';
if ( wm_option( 'cp-staff-revisions' ) )
$supports[] = 'revisions';
$args = array(
'query_var' => 'staff',
'capability_type' => $role,
'public' => true,
'show_in_nav_menus' => false,
'show_ui' => true,
'exclude_from_search' => true,
'hierarchical' => false,
'rewrite' => array( 'slug' => $slug ),
'menu_position' => $cpMenuPosition['staff'],
'menu_icon' => WM_ASSETS_ADMIN . 'img/icons/custom-posts/ico-team.png',
'supports' => $supports,
'labels' => array(
'name' => __( 'Staff', 'lespaul_domain_adm' ),
'singular_name' => __( 'Staff member', 'lespaul_domain_adm' ),
'add_new' => __( 'Add new member', 'lespaul_domain_adm' ),
'add_new_item' => __( 'Add new member', 'lespaul_domain_adm' ),
'new_item' => __( 'Add new member', 'lespaul_domain_adm' ),
'edit_item' => __( 'Edit member', 'lespaul_domain_adm' ),
'view_item' => __( 'View member', 'lespaul_domain_adm' ),
'search_items' => __( 'Search members', 'lespaul_domain_adm' ),
'not_found' => __( 'No member found', 'lespaul_domain_adm' ),
'not_found_in_trash' => __( 'No members found in trash', 'lespaul_domain_adm' ),
'parent_item_colon' => ''
)
);
register_post_type( 'wm_staff' , $args );
}
示例4: wm_faq_cp_init
function wm_faq_cp_init() {
global $cpMenuPosition;
$role = ( wm_option( 'cp-role-faq' ) ) ? ( wm_option( 'cp-role-faq' ) ) : ( 'post' );
$slug = ( wm_option( 'cp-permalink-faq' ) ) ? ( wm_option( 'cp-permalink-faq' ) ) : ( 'faq' );
$supports = array( 'title', 'editor', 'author' );
if ( wm_option( 'cp-faq-revisions' ) )
$supports[] = 'revisions';
$args = array(
'query_var' => 'faq',
'capability_type' => $role,
'public' => true,
'show_in_nav_menus' => false,
'show_ui' => true,
'exclude_from_search' => true,
'hierarchical' => false,
'rewrite' => array( 'slug' => $slug ),
'menu_position' => $cpMenuPosition['faq'],
'menu_icon' => WM_ASSETS_ADMIN . 'img/icons/custom-posts/ico-faq.png',
'supports' => $supports,
'labels' => array(
'name' => __( 'FAQ', 'lespaul_domain_adm' ),
'singular_name' => __( 'Answer', 'lespaul_domain_adm' ),
'add_new' => __( 'Add new answer', 'lespaul_domain_adm' ),
'add_new_item' => __( 'Add new answer', 'lespaul_domain_adm' ),
'new_item' => __( 'Add new answer', 'lespaul_domain_adm' ),
'edit_item' => __( 'Edit answer', 'lespaul_domain_adm' ),
'view_item' => __( 'View answer', 'lespaul_domain_adm' ),
'search_items' => __( 'Search question', 'lespaul_domain_adm' ),
'not_found' => __( 'No question found', 'lespaul_domain_adm' ),
'not_found_in_trash' => __( 'No question found in trash', 'lespaul_domain_adm' ),
'parent_item_colon' => ''
)
);
register_post_type( 'wm_faq' , $args );
}
示例5: wm_head_styles
function wm_head_styles( $classes ) {
global $post;
//variables needed
//post ID
$postId = ( is_home() ) ? ( get_option( 'page_for_posts' ) ) : ( null );
//custom in-header styles
$inHeaderStyles = '';
//page background image
if (
( isset( $post ) || is_home() ) &&
! is_search() && ! is_archive() &&
wm_css_background_meta( 'background-' )
) {
$inHeaderStyles .= ( wm_meta_option( 'background-bg-img-fit-window', $postId ) ) ? ( "\t" . 'body {background: none}' . "\r\n" ) : ( "\t" . 'body {background: ' . wm_css_background_meta( 'background-' ) . '}' . "\r\n" );
$inHeaderStyles .= ( ! wm_meta_option( 'background-bg-color', $postId ) ) ? ( '' ) : ( "\t" . 'html {background: none}' . "\r\n" );
}
//main heading area background
if (
( isset( $post ) || is_home() ) &&
( wm_css_background_meta( 'heading-background-' ) || wm_meta_option( 'heading-background-padding' ) )
) {
$inHeaderStyles .= ( wm_meta_option( 'heading-background-padding' ) ) ? ( "\t" . '.main-heading .twelve.pane {padding-top: ' . absint( wm_meta_option( 'heading-background-padding' ) ) . 'px; padding-bottom: ' . absint( wm_meta_option( 'heading-background-padding' ) ) . 'px;}' . "\r\n" ) : ( '' );
$inHeaderStyles .= ( wm_css_background_meta( 'heading-background-' ) ) ? ( "\t" . '.main-heading {background: ' . wm_css_background_meta( 'heading-background-' ) . '}' . "\r\n" ) : ( '' );
$inHeaderStyles .= ( ! wm_meta_option( 'heading-background-color', $postId ) ) ? ( '' ) : ( "\t" . '.main-heading h1, .main-heading h2, .main-heading i[class^="icon-"] {color: ' . wm_meta_option( 'heading-background-color', $postId, 'color' ) . ';}' . "\r\n" );
}
//wrapper padding when fixed header used
if ( in_array( 'header-fixed', get_body_class() ) && 0 < wm_option( 'header-height' ) )
$inHeaderStyles .= "\t" . '@media only screen and (min-width: 1020px) { body.header-fixed { padding-top: ' . absint( wm_option( 'header-height' ) ) . 'px; } body.top-bar-enabled.header-fixed { padding-top: ' . absint( wm_option( 'header-height' ) + 50 ) . 'px; } }' . "\r\n";
//output
if ( $inHeaderStyles )
$inHeaderStyles = "\r\n<!-- Custom header styles -->\r\n" . '<style type="text/css">' . "\r\n" . $inHeaderStyles . '</style>' . "\r\n";
echo $inHeaderStyles;
}
示例6: get_the_ID
$menuLocationName = 'main-navigation';
if ( is_page() && is_page_template( 'page-template/landing.php' ) )
$menuLocationName = 'menu-landing-page-' . get_the_ID();
//If no menu assigned, falls back to page list menu
wp_nav_menu( array(
'theme_location' => $menuLocationName,
'menu' => null,
'container' => null,
'container_class' => null,
'container_id' => null,
'menu_class' => 'menu',
'menu_id' => null,
'echo' => true,
'fallback_cb' => 'wm_menu_callback',
'before' => null,
'after' => null,
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ( has_nav_menu( $menuLocationName ) ) ? ( new wm_main_walker() ) : ( null )
) );
?>
</nav>
<?php
if ( ! in_array( wm_option( 'header-navigation-position' ), array( ' nav-left', ' nav-right' ) ) )
echo '</div></div>';
?>
</div> <!-- /wrap-inner -->
示例7: wm_option
//Add manually written styles from admin panel
$out .= ( wm_option( 'design-custom-css-enable' ) && wm_option( 'design-custom-css' ) ) ? ( "\r\n\r\n\r\n/* Custom CSS textarea styles */\r\n" . wm_option( 'design-custom-css' ) ) : ( '' );
$out .= "\r\n\r\n" . '/* End of file */';
/*
*****************************************************
* CSS FINAL OUTPUT (AND FILE HEADER)
*****************************************************
*/
$expireTime = ( wm_option( 'general-no-css-cache' ) ) ? ( 0 ) : ( WM_CSS_EXPIRATION );
header( 'content-type: text/css; charset: UTF-8' );
header( 'expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expireTime ) . ' GMT' );
header( 'cache-control: public, max-age=' . $expireTime );
if ( ! isset( $_GET['noc'] ) && ( wm_option( 'design-minimize-css' ) ) )
$out = wm_minimize_css( $out );
if ( wm_option( 'general-gzip' ) || wm_option( 'design-gzip-cssonly' ) )
ob_start( 'ob_gzhandler' ); //Enable GZIP
echo $out;
?>
示例8: wm_shortcode_image_size
/**
* Posts shortcode default image size
*
* @version 1.1
*/
function wm_shortcode_image_size()
{
//Requirements check
if (!function_exists('wm_option')) {
return $size;
}
//Output
return 'mobile-' . wm_option('skin-image-posts');
}
示例9: wm_default_content
function wm_default_content( $content ) {
global $current_screen;
$iconShortcodes = ( ! file_exists( WM_FONT . 'custom/config.json' ) ) ? ( '<li>[icon type="icon-check" /]</li><li>[icon type="icon-cancel" /]</li>' ) : ( '' );
if ( ! ( 'add' === $current_screen->action && 'post' === $current_screen->base ) )
return $content;
if ( 'wm_price' === $current_screen->id )
$content = '
<ul>
<li>' . __( '<strong>Your feature</strong> goes here', 'lespaul_domain_adm' ) . '</li>
<li>' . __( '<strong>Another feature</strong> on separate list item', 'lespaul_domain_adm' ) . '</li>
<li>' . __( 'Will be automatically centered', 'lespaul_domain_adm' ) . '</li>'
. $iconShortcodes . '
</ul>
';
if ( 'wm_faq' === $current_screen->id )
$content = '<p>' . __( 'Your answer goes here...', 'lespaul_domain_adm' ) . '</p>';
if ( 'wm_staff' === $current_screen->id )
$content = ( wm_option( 'cp-staff-rich' ) ) ? ( '<p>' . __( 'Rich staff member info goes here, place the short description into excerpt field below...', 'lespaul_domain_adm' ) . '</p>' ) : ( '<p>' . __( 'Staff member info goes here...', 'lespaul_domain_adm' ) . '</p>' );
return $content;
}
示例10: wm_meta_post_options
function wm_meta_post_options() {
global $sidebarPosition;
$prefix = '';
$prefixBg = 'background-';
$prefixBgHeading = 'heading-background-';
$fontFile = ( ! file_exists( WM_FONT . 'custom/config.json' ) ) ? ( WM_FONT . 'fontello/config.json' ) : ( WM_FONT . 'custom/config.json' );
$fontIcons = wm_fontello_classes( $fontFile );
//Get icons
$menuIcons = array();
$menuIcons[''] = __( '- select icon -', 'lespaul_domain_adm' );
foreach ( $fontIcons as $icon ) {
$menuIcons[$icon] = ucwords( str_replace( '-', ' ', substr( $icon, 4 ) ) );
}
$widgetsButtons = ( current_user_can( 'switch_themes' ) ) ? ( '<a class="button confirm" href="' . get_admin_url() . 'widgets.php">' . __( 'Manage widget areas', 'lespaul_domain_adm' ) . '</a> <a class="button confirm" href="' . get_admin_url() . 'admin.php?page=' . WM_THEME_SHORTNAME . '-options">' . __( 'Create new widget areas', 'lespaul_domain_adm' ) . '</a>' ) : ( '' );
$metaPostOptions = array(
//General settings
array(
"type" => "section-open",
"section-id" => "general-section",
"title" => __( 'General', 'lespaul_domain_adm' )
),
array(
"type" => "checkbox",
"id" => $prefix."no-heading",
"label" => __( 'Disable main heading', 'lespaul_domain_adm' ),
"desc" => __( 'Hides post/page main heading - the title', 'lespaul_domain_adm' ),
"value" => "true"
),
array(
"type" => "space"
),
array(
"type" => "textarea",
"id" => $prefix."subheading",
"label" => __( 'Subtitle', 'lespaul_domain_adm' ),
"desc" => __( 'If defined, the specially styled subtitle will be displayed', 'lespaul_domain_adm' ),
"default" => "",
"validate" => "lineBreakHTML",
"rows" => 2,
"cols" => 57
),
array(
"type" => "select",
"id" => $prefix."main-heading-alignment",
"label" => __( 'Main heading alignment', 'lespaul_domain_adm' ),
"desc" => __( 'Set the text alignment in main heading area', 'lespaul_domain_adm' ),
"options" => array(
"" => __( 'Default', 'lespaul_domain_adm' ),
"left" => __( 'Left', 'lespaul_domain_adm' ),
"center" => __( 'Center', 'lespaul_domain_adm' ),
"right" => __( 'Right', 'lespaul_domain_adm' ),
),
"default" => ""
),
array(
"type" => "select",
"id" => $prefix."main-heading-icon",
"label" => __( 'Main heading icon', 'lespaul_domain_adm' ),
"desc" => __( 'Select an icon to display in main heading area', 'lespaul_domain_adm' ),
"options" => $menuIcons,
"icons" => true
)
);
if ( ! wm_option( 'blog-disable-featured-image' ) || is_active_sidebar( 'top-bar-widgets' ) || ! wm_option( 'blog-disable-bio' ) )
array_push( $metaPostOptions,
array(
"type" => "hr"
)
);
if ( ! wm_option( 'blog-disable-featured-image' ) )
array_push( $metaPostOptions,
array(
"type" => "checkbox",
"id" => $prefix."disable-featured-image",
"label" => __( 'Disable featured image for this post', 'lespaul_domain_adm' ),
"desc" => __( 'Disables featured image on single post view', 'lespaul_domain_adm' ),
"value" => "true"
)
);
if ( is_active_sidebar( 'top-bar-widgets' ) )
array_push( $metaPostOptions,
array(
"type" => "checkbox",
"id" => $prefix."no-top-bar",
"label" => __( 'Disable top bar', 'lespaul_domain_adm' ),
"desc" => __( 'Disables top bar widget area on this post', 'lespaul_domain_adm' ),
"value" => "true"
)
);
if ( ! wm_option( 'blog-disable-bio' ) )
array_push( $metaPostOptions,
//.........这里部分代码省略.........
示例11: wm_css_background
function wm_css_background($args = array())
{
//Helper variables
$args = wp_parse_args($args, apply_filters('wmhook_wm_css_background_defaults', array('option_base' => '', 'high_dpi' => false, 'post' => null, 'return' => 'output')));
$args = apply_filters('wmhook_wm_css_background_args', $args);
if ($args['post'] && is_object($args['post']) && isset($args['post']->ID)) {
$args['post'] = $args['post']->ID;
} else {
$args['post'] = absint($args['post']);
}
//Requirements check
if ($args['post'] && !function_exists('wma_meta_option')) {
return;
}
$output = $output_defaults = array('attachment' => '', 'color' => '', 'image' => '', 'output' => '', 'position' => '', 'repeat' => '', 'size' => '');
//Preparing output
//Background color
$output['color'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-color') : wma_meta_option($args['option_base'] . 'bg-color', $args['post']);
if ($output['color']) {
$output['color'] = '#' . str_replace('#', '', $output['color']);
}
//Background image
$output['image'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-url') : wma_meta_option($args['option_base'] . 'bg-url', $args['post']);
if (is_array($output['image']) && isset($output['image']['id'])) {
$attachment = (array) wp_get_attachment_image_src($output['image']['id'], 'full');
$output['image'] = isset($attachment[0]) ? $attachment[0] : '';
$output['size'] = isset($attachment[1]) ? $attachment[1] . 'px' : '';
$output['size'] .= isset($attachment[2]) ? ' ' . $attachment[2] . 'px' : '';
if ($args['high_dpi']) {
$attachment = !$args['post'] ? wm_option($args['option_base'] . 'bg-url-hidpi') : wma_meta_option($args['option_base'] . 'bg-url-hidpi', $args['post']);
$attachment = $attachment && isset($attachment['id']) ? (array) wp_get_attachment_image_src($attachment['id'], 'full') : false;
if ($attachment && isset($attachment[0])) {
$output['image'] = $attachment[0];
}
}
} elseif ($output['image']) {
$attachment_id = wm_get_image_id_from_url($output['image']);
if ($attachment_id) {
$attachment = (array) wp_get_attachment_image_src($attachment_id, 'full');
$output['size'] = isset($attachment[1]) ? $attachment[1] . 'px' : '';
$output['size'] .= isset($attachment[2]) ? ' ' . $attachment[2] . 'px' : '';
}
if ($args['high_dpi']) {
$output['image'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-url-hidpi') : wma_meta_option($args['option_base'] . 'bg-url-hidpi', $args['post']);
}
}
if ($output['image']) {
$output['image'] = ' url(' . trim($output['image']) . ')';
}
//Background repeat
if ($output['image']) {
$output['repeat'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-repeat') : wma_meta_option($args['option_base'] . 'bg-repeat', $args['post']);
if (trim($output['repeat'])) {
$output['repeat'] = ' ' . trim($output['repeat']);
}
}
//Background attachment
if ($output['image']) {
$output['attachment'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-attachment') : wma_meta_option($args['option_base'] . 'bg-attachment', $args['post']);
if (trim($output['attachment'])) {
$output['attachment'] = ' ' . trim($output['attachment']);
}
}
//Background position
if ($output['image']) {
$output['position'] = !$args['post'] ? wm_option($args['option_base'] . 'bg-position') : wma_meta_option($args['option_base'] . 'bg-position', $args['post']);
if (trim($output['position'])) {
$output['position'] = ' ' . trim($output['position']);
}
}
//Background size
if ($output['image']) {
$image_size = !$args['post'] ? wm_option($args['option_base'] . 'bg-size') : wma_meta_option($args['option_base'] . 'bg-size', $args['post']);
if ($image_size) {
$output['size'] = $image_size;
}
}
$output['size'] = trim($output['size']);
if ($output['size']) {
$output['size'] = '; background-size: ' . $output['size'];
}
//Output string setup
$output['output'] = $output['color'] . $output['image'] . $output['repeat'] . $output['attachment'] . $output['position'] . $output['size'];
//If outputing high DPI image, check if image set, if not output nothing (not even background-size)!
if ($args['high_dpi'] && !$output['image']) {
$output = $output_defaults;
}
//Filter $output array
$output = apply_filters('wmhook_wm_css_background_output_array', $output, $args);
//Output
return apply_filters('wmhook_wm_css_background_output', $output[$args['return']], $args);
}
示例12: wm_form_datepicker
function wm_form_datepicker( $value, $isMeta = null ) {
if ( 'meta' == $isMeta )
$val = wm_meta_option( $value['id'] );
else
$val = wm_option( $value['id'] );
$valId = WM_THEME_SETTINGS_PREFIX . $value['id'];
$default = ( isset( $value['default'] ) ) ? ( intval( $value['default'] ) ) : ( null );
$class = ( isset( $value['class'] ) && $value['class'] ) ? ( ' class="' . $value['class'] . '"' ) : ( null );
$setValue = ( $val ) ? ( $val ) : ( $default );
?>
<div class="option" data-option="<?php echo $valId; ?>">
<p>
<?php if ( $default ) echo '<a data-default="' . $valId . '" class="btn btn-default" title="' . __( 'Use default value', 'lespaul_domain_adm' ) . '">' . __( 'Default value', 'lespaul_domain_adm' ) . '<span>' . $default . '</span></a>'; ?>
<label for="<?php echo $valId; ?>"><?php echo strip_tags( $value['label'] ); ?></label>
</p>
<?php if ( isset( $value['desc'] ) && $value['desc'] ) echo '<p class="desc">' . $value['desc'] . '</p>'; ?>
<p>
<input type="text" data-type="date" name="<?php echo $valId; ?>" id="<?php echo $valId; ?>" value="<?php echo esc_attr( $setValue ); ?>"<?php echo $class; ?> />
</p>
</div> <!-- /option -->
<?php
wm_conditional_show( $value, $valId );
}
示例13: wm_shortcode_simple_slideshow
function wm_shortcode_simple_slideshow( $atts, $content = null ) {
extract( shortcode_atts( array(
'ids' => '',
'link' => '',
'size' => 'ratio-169',
'time' => 5000,
), $atts )
);
$ids = explode( ',', trim( preg_replace( '/\s+/', '', $ids ) ) );
if ( empty( $ids ) )
return;
$out = '';
foreach ( $ids as $imageId ) {
$fullImage = wp_get_attachment_image_src( $imageId, wm_option( 'general-lightbox-img' ) );
if ( '1' == $link )
$out .= '<a href="' . $fullImage[0] . '">';
elseif( $link )
$out .= '<a href="' . esc_url( $link ) . '">';
$out .= wp_get_attachment_image( $imageId, $size );
$out .= ( $link ) ? ( '</a>' ) : ( '' );
}
if ( $out )
wp_enqueue_script( 'bxslider' );
//output
return ( $out ) ? ( '<div class="simple-slider" data-time="' . absint( $time ) . '">' . $out . '</div>' ) : ( '' );
}
示例14: wm_search_form
function wm_search_form( $form ) {
$form = '
<form method="get" class="form-search" action="' . home_url( '/' ) . '">
<fieldset>
<label class="assistive-text invisible">' . __( 'Search for:', 'lespaul_domain' ) . '</label>
<input type="text" class="text" name="s" placeholder="' . wm_option( 'general-search-placeholder' ) . '" />
<input type="submit" class="submit" value="' . __( 'Submit', 'lespaul_domain' ) . '" />
<i class="wmicon-search"></i>
</fieldset>
</form>
';
return $form;
}
示例15: start_el
function start_el( &$output, $element, $depth, $args ) {
global $wp_query;
$class_names = '';
$indent = ( $depth ) ? ( str_repeat( "\t", $depth ) ) : ( '' );
$classes = ( empty( $element->classes ) ) ? ( array() ) : ( (array) $element->classes );
$classes = implode( ' ', $classes );
$classes = str_replace( array( 'alignleft', 'alignright' ), '', $classes );
$classes = explode( ' ', $classes );
if ( 1 === $element->menu_order )
$classes[] = 'first';
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $element ) );
$class_names = ' class="'. esc_attr( str_replace( 'icon-', 'iconnav-', $class_names ) ) . '"';
//Link attributes
$attributes = ( ! empty( $element->attr_title ) ) ? ( ' title="' . esc_attr( $element->attr_title ) . '"' ) : ( '' );
$attributes .= ( ! empty( $element->target ) ) ? ( ' target="' . esc_attr( $element->target ) . '"' ) : ( '' );
$attributes .= ( ! empty( $element->xfn ) ) ? ( ' rel="' . esc_attr( $element->xfn ) . '"' ) : ( '' );
$attributes .= ( ! empty( $element->url ) ) ? ( ' href="' . esc_attr( $element->url ) . '"' ) : ( '' );
//Display desciption
$mainItemStart = '';
$mainItemEnd = '';
$outItem = $args->before;
if ( ! empty( $element->url ) && 'http://' != $element->url && 'http://-' != $element->url && '-' != $element->url )
$outItem .= '<a'. $attributes .' class="inner">';
else
$outItem .= '<span class="inner ' . esc_attr( $class_names ) . '">';
$outItem .= $args->link_before . $mainItemStart . apply_filters( 'the_title', do_shortcode( $element->title ), $element->ID ) . $mainItemEnd . $args->link_after;
if ( ! empty( $element->url ) && 'http://' != $element->url && 'http://-' != $element->url && '-' != $element->url )
$outItem .= '</a>';
else
$outItem .= '</span>';
$outItem .= $args->after;
if ( wm_option( 'access-client-area' ) ) {
$pageId = ( isset( $element->object_id ) && $element->object_id ) ? ( $element->object_id ) : ( 0 );
$allowed = wm_restriction_page( $pageId );
} else {
$allowed = true;
}
if ( $allowed )
$output .= $indent . '<li' . $class_names .'>' . apply_filters( 'walker_nav_menu_start_el', $outItem, $element, $depth, $args );
else
$output .= '<li class="hide">';
} // /start_el