public function form($instance) { printf('<p><label for="%s">%s</label> <input class="widefat" id="%s" name="%s" type="text" value="%s" /></p>', $this->get_field_id('title'), _x('Title:', 'widgets', 'WPBDM'), $this->get_field_id('title'), $this->get_field_name('title'), esc_attr($this->get_field_value($instance, 'title'))); printf('<p><label for="%s">%s</label> <input id="%s" name="%s" type="text" value="%s" size="5" /></p>', $this->get_field_id('number_of_listings'), _x('Number of listings to display:', 'widgets', 'WPBDM'), $this->get_field_id('number_of_listings'), $this->get_field_name('number_of_listings'), intval($this->get_field_value($instance, 'number_of_listings'))); $this->_form($instance); if (in_array('images', $this->supports)) { echo '<h4>'; _ex('Thumbnails', 'widgets', 'WPBDM'); echo '</h4>'; printf('<p><input id="%s" class="wpbdp-toggle-images" name="%s" type="checkbox" value="1" %s /> <label for="%s">%s</label></p>', $this->get_field_id('show_images'), $this->get_field_name('show_images'), $this->get_field_value($instance, 'show_images') ? 'checked="checked"' : '', $this->get_field_id('show_images'), _x('Show thumbnails', 'widgets', 'WPBDM')); echo '<p class="thumbnail-width-config" style="' . ($this->get_field_value($instance, 'show_images') ? '' : 'display: none;') . '">'; echo '<label for="' . $this->get_field_id('thumbnail_width') . '">'; _ex('Image width (in px):', 'widgets', 'WPBDM'); echo '</label> '; printf('<input type="text" name="%s" id="%s" value="%s" size="5" />', $this->get_field_name('thumbnail_width'), $this->get_field_id('thumbnail_width'), $this->get_field_value($instance, 'thumbnail_width')); echo '<br /><span class="help">' . _x('Leave blank for automatic width.', 'widgets', 'WPBDM') . '</span>'; echo '</p>'; echo '<p class="thumbnail-height-config" style="' . ($this->get_field_value($instance, 'show_images') ? '' : 'display: none;') . '">'; echo '<label for="' . $this->get_field_id('thumbnail_height') . '">'; _ex('Image height (in px):', 'widgets', 'WPBDM'); echo '</label> '; printf('<input type="text" name="%s" id="%s" value="%s" size="5" />', $this->get_field_name('thumbnail_height'), $this->get_field_id('thumbnail_height'), $this->get_field_value($instance, 'thumbnail_height')); echo '<br /><span class="help">' . _x('Leave blank for automatic height.', 'widgets', 'WPBDM') . '</span>'; echo '</p>'; } }
function themecheck_do_page() { if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.', 'theme-check')); } add_filter('extra_theme_headers', array($this, 'tc_add_headers')); include 'checkbase.php'; include 'main.php'; ?> <div id="theme-check" class="wrap"> <h1><?php _ex('Theme Check', 'title of the main page', 'theme-check'); ?> </h1> <div class="theme-check"> <?php tc_form(); if (!isset($_POST['themename'])) { tc_intro(); } if (isset($_POST['themename'])) { if (isset($_POST['trac'])) { define('TC_TRAC', true); } if (defined('WP_MAX_MEMORY_LIMIT')) { @ini_set('memory_limit', WP_MAX_MEMORY_LIMIT); } check_main($_POST['themename']); } ?> </div> <!-- .theme-check--> </div> <?php }
/** * Renders the control's content. * * @since 3.9.0 * @access public */ public function render_content() { $id = 'reorder-widgets-desc-' . str_replace(array('[', ']'), array('-', ''), $this->id); ?> <button type="button" class="button-secondary add-new-widget" aria-expanded="false" aria-controls="available-widgets"> <?php _e('Add a Widget'); ?> </button> <button type="button" class="button-link reorder-toggle" aria-label="<?php esc_attr_e('Reorder widgets'); ?> " aria-describedby="<?php echo esc_attr($id); ?> "> <span class="reorder"><?php _ex('Reorder', 'Reorder widgets in Customizer'); ?> </span> <span class="reorder-done"><?php _ex('Done', 'Cancel reordering widgets in Customizer'); ?> </span> </button> <p class="screen-reader-text" id="<?php echo esc_attr($id); ?> "><?php _e('When in reorder mode, additional controls to reorder widgets will be available in the widgets list above.'); ?> </p> <?php }
/** * Outputs the new taxonomy description field as a TinyMCE * editor instead of a plain textarea. * * @param $tag * @return none */ function cat_description($tag) { ?> <table class="form-table"> <tr class="form-field"> <th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?> </label></th> <td> <?php $settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '15', 'textarea_name' => 'description'); // We need to use html_entity_decode on the content before wp_editor, // otherwise TinyMCEwill convert all of our HTML tags into HTML entities // and you'll actually see the HTML tags in the WYSIWYG editor as text. $content = html_entity_decode($tag->description); wp_editor(wp_kses_post($content, ENT_QUOTES, 'UTF-8'), 'cat_description', $settings); ?> <br /> <span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?> </span> </td> </tr> </table> <?php }
function _before_table_edit($form, $results = true) { ?> <p><?php _e('This module isn\'t limited to just static HTML content. You can also use shortcodes and PHP code to add generated content. PHP support must first be activated with the Enable PHP option below.', 'it-l10n-Builder-Cohen'); ?> </p> <p><?php _e('Using shortcodes is preferred over PHP code as allowing PHP code has security risks.', 'it-l10n-Builder-Cohen'); ?> </p> <p> <label for="html"><?php _ex('HTML', 'module', 'it-l10n-Builder-Cohen'); ?> </label> <br /> <?php $form->add_text_area('html', array('style' => 'width:100%; max-width:100%; min-height:100px;', 'rows' => '10')); ?> </p> <br /> <?php }
function upload_file($settings, $value) { ob_start(); ?> <div class="select_fa_icon_bb_param_block"> <input name="<?php echo esc_attr($settings['param_name']); ?> " class="wpb_vc_param_value wpb-textinput <?php echo esc_attr($settings['param_name']) . ' ' . esc_attr($settings['type']); ?> _field" id="<?php echo esc_attr($settings['param_name']); ?> " type="text" value="<?php echo esc_attr($value); ?> " /> <input type="button" onclick="ProteusWidgetsUploader.fileUploader.openFileFrame( '<?php echo esc_attr($settings['param_name']); ?> ' );" class="upload-brochure-file button button-secondary" value="<?php _ex('Upload file', 'backend', 'vc-elements-pt'); ?> " /> </div> <?php return ob_get_clean(); }
/** * Render the control's content. * * @since Menu Customizer 0.0 */ public function render_content() { $id = absint($this->menu_id); ?> <span class="button-secondary add-new-menu-item" tabindex="0"> <?php _e('Add Links'); ?> </span> <span class="add-menu-item-loading spinner"></span> <span class="reorder-toggle" tabindex="0"> <span class="reorder"><?php _ex('Reorder', 'Reorder menu items in Customizer'); ?> </span> <span class="reorder-done"><?php _ex('Done', 'Cancel reordering menu items in Customizer'); ?> </span> </span> <span class="menu-delete" id="delete-menu-<?php echo $id; ?> " tabindex="0"> <span class="screen-reader-text"><?php printf(__("Delete menu: %s"), wp_get_nav_menu_object($id)->name); ?> </span> </span> <?php }
function kws_add_form($taxonomy = '') { global $pagenow; $content = is_object($taxonomy) && isset($taxonomy->description) ? $taxonomy->description : ''; $content = html_entity_decode($content); if ($pagenow == 'edit-tags.php') { $editor_id = 'tag_description'; $editor_selector = 'description'; } else { $editor_id = $editor_selector = 'category_description'; } $css = ' <style type="text/css"> .wp-editor-container .quicktags-toolbar input.ed_button { width:auto; } .html-active .wp-editor-area { border:0;} </style>'; ?> <tr class="form-field"> <th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?> </label></th> <td><?php wp_editor($content, $editor_id, array('textarea_name' => $editor_selector, 'editor_css' => $css)); ?> <br /> <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?> </span></td> </tr> <?php }
/** * Print an admin notice if woocommerce is deactivated * * @author Andrea Grillo <*****@*****.**> * @since 1.0 * @return void * @use admin_notices hooks */ function install_premium_woocommerce_admin_notice() { ?> <div class="error"> <p><?php _ex('YITH WooCommerce Multi-step Chekcout is enabled but not effective. It requires WooCommerce in order to work.', 'Alert Message: WooCommerce require', 'yith_wcms'); ?> </p> </div> <?php }
function form($instance) { $instance = wp_parse_args((array) $instance, array('title' => '')); $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; $user = isset($instance['user']) ? esc_attr($instance['user']) : 'TeslaThemes'; $number = isset($instance['number']) ? absint($instance['number']) : 3; ?> <p> <label><?php _ex('Title:', 'dashboard', 'sevenfold'); ?> <input class="widefat" name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo esc_attr($title); ?> " /></label> <label><?php _ex('Twitter user:'******'dashboard', 'sevenfold'); ?> <input class="widefat" name="<?php echo $this->get_field_name('user'); ?> " type="text" value="<?php echo esc_attr($user); ?> " /></label> <label for="<?php echo $this->get_field_id('number'); ?> "> <?php _ex('Number of tweets to show:', 'dashboard', 'sevenfold'); ?> <input id="<?php echo $this->get_field_id('number'); ?> " name="<?php echo $this->get_field_name('number'); ?> " type="text" value="<?php echo $number; ?> " size="3" /> </label> </p> <p>Don't forget to configure the twitter in the Framework.</p> <?php }
/** * Display search form for searching themes. * * @since 2.8.0 */ function install_theme_search_form($type_selector = true) { $type = isset($_REQUEST['type']) ? stripslashes($_REQUEST['type']) : 'term'; $term = isset($_REQUEST['s']) ? stripslashes($_REQUEST['s']) : ''; if (!$type_selector) { echo '<p class="install-help">' . __('Search for themes by keyword.') . '</p>'; } ?> <form id="search-themes" method="get" action=""> <input type="hidden" name="tab" value="search" /> <?php if ($type_selector) { ?> <select name="type" id="typeselector"> <option value="term" <?php selected('term', $type); ?> ><?php _e('Keyword'); ?> </option> <option value="author" <?php selected('author', $type); ?> ><?php _e('Author'); ?> </option> <option value="tag" <?php selected('tag', $type); ?> ><?php _ex('Tag', 'Theme Installer'); ?> </option> </select> <?php } ?> <input type="search" name="s" size="30" value="<?php echo esc_attr($term); ?> " /> <?php submit_button(__('Search'), 'button', 'search', false); ?> </form> <?php }
/** * @add the editor */ function add($term, $taxonomy) { ?> <tr class="form-field tp-term-description-editor"> <th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?> </label></th> <td><?php wp_editor(html_entity_decode($term->description, null, 'UTF-8'), 'tp-description', array('textarea_name' => 'description', 'quicktags' => false)); ?> </td> </tr> <?php }
public function widget( $args, $instance ) { if ( ! has_post_format( 'gallery', $instance['post_id'] ) ) return; $attachments = get_children( array( 'post_parent' => $instance['post_id'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', ) ); if ( empty( $attachments ) ) return; extract( $args ); echo str_replace( 'well ', '', $before_widget ); if ( $title = get_the_title( $instance['post_id'] ) ) echo $before_title . '<a href="' . get_permalink( $instance['post_id'] ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'the-bootstrap' ), strip_tags( $title ) ) . '" rel="bookmark">' . $title . '</a>' . $after_title; ?> <div id="sidebar-gallery-slider" class="carousel slide"> <!-- Carousel items --> <div class="carousel-inner"> <?php foreach ( $attachments as $attachment ) : ?> <figure class="item"> <?php echo wp_get_attachment_image( $attachment->ID, array( 370, 278 ) ); if ( has_excerpt( $attachment->ID ) ) : ?> <figcaption class="carousel-caption"> <h4><?php echo get_the_title( $attachment->ID ); ?></h4> <p><?php echo apply_filters( 'get_the_excerpt', $attachment->post_excerpt ); ?></p> </figcaption> <?php endif; ?> </figure> <?php endforeach; ?> </div><!-- .carousel-inner --> <!-- Carousel nav --> <a class="carousel-control left" href="#sidebar-gallery-slider" data-slide="prev"><?php _ex( '‹', 'carousel-control', 'the-bootstrap' ); ?></a> <a class="carousel-control right" href="#sidebar-gallery-slider" data-slide="next"><?php _ex( '›', 'carousel-control', 'the-bootstrap' ); ?></a> </div><!-- #sidebar-gallery-slider .carousel .slide --> <?php echo $after_widget; }
function call_some_i18n_methods() { __('Hello World', 'test-domain'); _e('Hello World', 'test-domain'); _n('Single', 'Plural', 1, 'test-domain'); _n_noop('Single Noop', 'Plural Noop', 1, 'test-domain'); _x('Hello World', 'Testing', 'test-domain'); _ex('Hello World', 'Testing', 'test-domain'); _nx('Hello World', 'Testing', 'test-domain'); _nx_noop('Hello World Noop', 'Testing', 'test-domain'); esc_attr__('Attribute', 'test-domain'); esc_html__('HTML', 'test-domain'); esc_attr_e('Attribute', 'test-domain'); esc_html_e('HTML', 'test-domain'); esc_attr_x('Attribute', 'Testing', 'test-domain'); esc_html_x('HTML', 'Testing', 'test-domain'); translate_nooped_plural('Plural Noop', 2, 'test-domain'); }
function pt_docs_page_output() { ?> <div class="wrap"> <h2><?php _ex('Documentation', 'backend', 'carpress_wp'); ?> </h2> <p> <strong><a href="http://www.proteusthemes.com/docs/carpress/" class="button button-primary " target="_blank"><?php _ex('Click here to see online documentation of the theme!', 'backend', 'carpress_wp'); ?> </a></strong> </p> </div> <?php }
function _wpsc_action_print_media_templates() { ?> <script type="text/html" id="tmpl-wpsc-featured-image"> <div class="wpsc-media-featured-image"> <span class="title"><?php _e('Featured image', 'wpsc'); ?> </span> <a class="edit-selection" href="#"><?php _ex('Edit', 'edit featured image', 'wpsc'); ?> </a> </div> <div class="wpsc-selection-view"></div> </script> <?php }
public function dashboard_signups() { global $gMemberNetwork; $query = new \WP_User_Query(array('blog_id' => 0, 'orderby' => 'registered', 'order' => 'DESC', 'number' => 12, 'fields' => array('ID', 'display_name', 'user_email', 'user_registered', 'user_login'))); if (empty($query->results)) { _ex('No User?!', 'Signup Admin Widget', GMEMBER_TEXTDOMAIN); } else { echo '<table class="widefat gmember-dashboard -table-signup"><thead><tr>'; echo '<th>' . _x('On', 'Signup Admin Widget', GMEMBER_TEXTDOMAIN) . '</th>'; echo '<th>' . _x('Name', 'Signup Admin Widget', GMEMBER_TEXTDOMAIN) . '</th>'; echo '<th>' . _x('E-mail', 'Signup Admin Widget', GMEMBER_TEXTDOMAIN) . '</th>'; echo '</tr></thead>'; $last = FALSE; $alt = TRUE; $template = '<tr%1$s>' . '<td class="-month-day" title="%5$s">%4$s</td>' . '<td class="-edit-link"><a title="%8$s" href="%6$s" target="_blank">%2$s</a></td>' . '<td class="-mail-link"><a title="%7$s" href="%7$s" target="_blank">%3$s</a></td>' . '</tr>'; foreach ($query->results as $user) { $registered = strtotime(get_date_from_gmt($user->user_registered)); vprintf($template, array($alt ? ' class="alternate"' : '', esc_html($user->display_name), esc_html(gPluginTextHelper::truncateString($user->user_email, 32)), esc_html($gMemberNetwork->getDate($registered, 'monthday')), esc_attr(human_time_diff($registered) . ' — ' . $gMemberNetwork->getDate($registered)), get_edit_user_link($user->ID), 'mailto:' . esc_attr($user->user_email), $user->user_login)); $alt = !$alt; if (!$last) { $last = $registered; } } echo '</table>'; echo '<table class="gmember-dashboard -table-summary"></tbody>'; echo '<tr><td>'; printf(_x('Last User Registered %s ago', 'Signup Admin Widget', GMEMBER_TEXTDOMAIN), human_time_diff($last)); echo '</td><td>'; if ($spam_users = $gMemberNetwork->get_spam_count()) { printf(_nx('With %s Spam User', 'With %s Spam Users', $spam_users, 'Signup Admin Widget', GMEMBER_TEXTDOMAIN), number_format_i18n($spam_users)); } else { _ex('With No Spam User', 'Signup Admin Widget', GMEMBER_TEXTDOMAIN); } echo '</td></tr><tr><td>'; $super_admins = count(get_super_admins()); printf(_nx('And %s Super Admin', 'And %s Super Admins', $super_admins, 'Signup Admin Widget', GMEMBER_TEXTDOMAIN), number_format_i18n($super_admins)); echo '</td><td>'; $user_count = get_user_count(); printf(_nx('Total of One User', 'Total of %s Users', $user_count, 'Signup Admin Widget', GMEMBER_TEXTDOMAIN), number_format_i18n($user_count)); echo '</td></tr>'; echo '</tbody></table>'; } }
function shopping_header_right() { ?> <aside class="header-right widget-area sidebar"> <?php if (is_active_sidebar('header-right')) { dynamic_sidebar('header-right'); } else { ?> <section class="widget widget_search widget-widget_search"> <div class="widget-wrap"> <form role="search" method="get" class="search-form" action="<?php echo esc_url(home_url('/')); ?> "> <input type="search" class="search-field" placeholder="<?php echo esc_attr_x('Search …', 'placeholder', 'shopping'); ?> " value="<?php echo esc_attr(get_search_query()); ?> " name="s" title="<?php _ex('Search for:', 'label', 'shopping'); ?> "> </form> </div> </section> <?php } ?> </aside><!-- .sidebar --> <?php }
/** * Output the 'Switch To' link on the user editing screen if we have permission to switch to this user. * * @param WP_User $user User object for this screen. */ public function action_personal_options(WP_User $user) { if (!($link = self::maybe_switch_url($user))) { return; } ?> <tr> <th scope="row"><?php _ex('User Switching', 'User Switching title on user profile screen', 'user-switching'); ?> </th> <td><a href="<?php echo $link; ?> "><?php _e('Switch To', 'user-switching'); ?> </a></td> </tr> <?php }
/** * Output the 'Switch To' link on the user editing screen if we have permission to switch to this user. * * @param object $user User object for this screen * @return null */ function personal_options($user) { if (!current_user_can('switch_to_user', $user->ID)) { return; } ?> <tr> <th scope="row"><?php _ex('User Switching', 'User Switching title on user profile screen', 'user_switching'); ?> </th> <td><a href="<?php echo $this->switch_to_url($user->ID); ?> "><?php _e('Switch To', 'user_switching'); ?> </a></td> </tr> <?php }
public function render_cat_visibility_fields($category_meta, $tag) { $posts_on_homepage = 'visible'; if (isset($category_meta[$tag->term_id])) { $posts_on_homepage = esc_attr($category_meta[$tag->term_id]['posts-on-homepage']); } ?> <tr class="form-field"> <th scope="row" valign="top"> <label for="category-posts-on-homepage"> <?php _ex('Posts on Homepage', 'category edit screen', Blog_Helper::TEXT_DOMAIN); ?> </label></th> <td> <select name="category-meta[<?php echo $tag->term_id; ?> ][posts-on-homepage]" id="category-posts-on-homepage" class="postform"> <option value="visible" <?php selected($posts_on_homepage, 'visible'); ?> >Visible</option> <option value="hidden" <?php selected($posts_on_homepage, 'hidden'); ?> >Hidden</option> </select> <p class="description"> <?php _e('Show posts from this category on the homepage?', Blog_Helper::TEXT_DOMAIN); ?> </p> </td> </tr> <?php }
/** * Options form */ function form($instance) { //Helper variables $instance = wp_parse_args($instance, array('sidebar' => 'tabbed-widgets')); //Output ?> <p class="wm-desc"><?php _ex('Displays widgets from selected widget area in tabbed interface.', 'Widget description.', 'webman-amplifier'); ?> </p> <p> <label for="<?php echo $this->get_field_id('sidebar'); ?> "><?php _e('Widgets area displayed', 'webman-amplifier'); ?> </label><br /> <select class="widefat" name="<?php echo $this->get_field_name('sidebar'); ?> " id="<?php echo $this->get_field_id('sidebar'); ?> "> <?php if (function_exists('wma_widget_areas_array')) { $options = wma_widget_areas_array(); foreach ($options as $value => $name) { echo '<option value="' . $value . '" ' . selected($instance['sidebar'], $value, false) . '>' . $name . '</option>'; } } ?> </select> </p> <?php do_action('wmhook_widgets_' . 'wm_tabbed_widgets' . '_form', $instance); }
public static function wp_fullscreen_html() { global $content_width; $post = get_post(); $width = isset($content_width) && 800 > $content_width ? $content_width : 800; $width = $width + 22; // compensate for the padding and border $dfw_width = get_user_setting('dfw_width', $width); $save = isset($post->post_status) && $post->post_status == 'publish' ? __('Update') : __('Save'); ?> <div id="wp-fullscreen-body"<?php if (is_rtl()) { echo ' class="rtl"'; } ?> > <div id="fullscreen-topbar"> <div id="wp-fullscreen-toolbar"> <div id="wp-fullscreen-close"><a href="#" onclick="fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?> </a></div> <div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?> px;"> <div id="wp-fullscreen-mode-bar"><div id="wp-fullscreen-modes"> <a href="#" onclick="fullscreen.switchmode('tinymce');return false;"><?php _e('Visual'); ?> </a> <a href="#" onclick="fullscreen.switchmode('html');return false;"><?php _ex('Text', 'Name for the Text editor tab (formerly HTML)'); ?> </a> </div></div> <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="wp_themeSkin"> <?php $buttons = array('bold' => array('title' => __('Bold (Ctrl + B)'), 'onclick' => 'fullscreen.b();', 'both' => false), 'italic' => array('title' => __('Italic (Ctrl + I)'), 'onclick' => 'fullscreen.i();', 'both' => false), '0' => 'separator', 'bullist' => array('title' => __('Unordered list (Alt + Shift + U)'), 'onclick' => 'fullscreen.ul();', 'both' => false), 'numlist' => array('title' => __('Ordered list (Alt + Shift + O)'), 'onclick' => 'fullscreen.ol();', 'both' => false), '1' => 'separator', 'blockquote' => array('title' => __('Blockquote (Alt + Shift + Q)'), 'onclick' => 'fullscreen.blockquote();', 'both' => false), 'image' => array('title' => __('Insert/edit image (Alt + Shift + M)'), 'onclick' => "fullscreen.medialib();", 'both' => true), '2' => 'separator', 'link' => array('title' => __('Insert/edit link (Alt + Shift + A)'), 'onclick' => 'fullscreen.link();', 'both' => true), 'unlink' => array('title' => __('Unlink (Alt + Shift + S)'), 'onclick' => 'fullscreen.unlink();', 'both' => false), '3' => 'separator', 'help' => array('title' => __('Help (Alt + Shift + H)'), 'onclick' => 'fullscreen.help();', 'both' => false)); $buttons = apply_filters('wp_fullscreen_buttons', $buttons); foreach ($buttons as $button => $args) { if ('separator' == $args) { ?> <div><span aria-orientation="vertical" role="separator" class="mceSeparator"></span></div> <?php continue; } ?> <div<?php if ($args['both']) { ?> class="wp-fullscreen-both"<?php } ?> > <a title="<?php echo $args['title']; ?> " onclick="<?php echo $args['onclick']; ?> return false;" class="mceButton mceButtonEnabled mce_<?php echo $button; ?> " href="#" id="wp_fs_<?php echo $button; ?> " role="button" aria-pressed="false"> <span class="mceIcon mce_<?php echo $button; ?> "></span> </a> </div> <?php } ?> </div></div> <div id="wp-fullscreen-save"> <input type="button" class="button-primary right" value="<?php echo $save; ?> " onclick="fullscreen.save();" /> <span class="spinner"></span> <span class="fs-saved"><?php if ($post->post_status == 'publish') { _e('Updated.'); } else { _e('Saved.'); } ?> </span> </div> </div> </div> </div> <div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?> px;"> <?php if (post_type_supports($post->post_type, 'title')) { ?> <label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters('enter_title_here', __('Enter title here'), $post); ?> </label> <input type="text" id="wp-fullscreen-title" value="" autocomplete="off" /> <?php } ?> <div id="wp-fullscreen-container"> <textarea id="wp_mce_fullscreen"></textarea> </div> <div id="wp-fullscreen-status"> <div id="wp-fullscreen-count"><?php printf(__('Word count: %s'), '<span class="word-count">0</span>'); ?> </div> <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?> </div> </div> </div> </div> <div class="fullscreen-overlay" id="fullscreen-overlay"></div> <div class="fullscreen-overlay fullscreen-fader fade-600" id="fullscreen-fader"></div> <?php }
function woocommerce_quantity_input($args = array(), $product = null, $echo = true) { if (is_null($product)) { $product = $GLOBALS['product']; } $options = get_option('wcpgsk_settings'); $product_id = $product->post->ID; $selectqty = get_post_meta($product_id, '_wcpgsk_selectqty', true); //var_dump( $args ); $ival = apply_filters('woocommerce_quantity_input_min', '', $product); if (!$ival) { $ival = apply_filters('woocommerce_quantity_input_step', '1', $product); } $stepval = apply_filters('woocommerce_quantity_input_step', '1', $product); $maxval = apply_filters('woocommerce_quantity_input_max', '', $product); $mval = apply_filters('woocommerce_quantity_input_min', '', $product); if (!empty($args) && isset($args['input_name']) && strpos($args['input_name'], 'quantity[') !== false) { if (!$ival || is_numeric($ival) && $ival < 1) { if ($stepval <= $maxval || !$maxval) { $ival = $stepval; } else { $ival = 1; } } //$mval = 0; } elseif (!$ival || is_numeric($ival) && $ival < 1) { if ($stepval <= $maxval || !$maxval) { $ival = $stepval; } else { $ival = 1; } //$mval = 0; } $defaults = array('input_name' => 'quantity', 'input_value' => $ival, 'max_value' => $maxval, 'min_value' => $mval, 'step' => $stepval, 'style' => apply_filters('woocommerce_quantity_style', 'float:left; margin-right:10px;', $product)); if (!empty($args) && isset($args['input_name']) && !empty($args['input_name'])) { $defaults['input_name'] = $args['input_name']; } if ($maxval) { unset($args['max_value']); } $args = apply_filters('woocommerce_quantity_input_args', wp_parse_args($args, $defaults), $product); if (isset($options['cart']['minmaxstepproduct']) && $options['cart']['minmaxstepproduct'] == 1 && isset($selectqty) && $selectqty == 'yes') { $minqty = get_post_meta($product_id, '_wcpgsk_minqty', true); $maxqty = get_post_meta($product_id, '_wcpgsk_maxqty', true); $stepqty = get_post_meta($product_id, '_wcpgsk_stepqty', true); if (!empty($args['min_value'])) { $min = $args['min_value']; } else { $min = $minqty > 0 ? $minqty : 0; } if (!empty($args['max_value'])) { $max = $args['max_value']; } else { $max = $maxqty > 0 ? $maxqty : ''; } if (!empty($args['step'])) { $step = $args['step']; } else { $step = $stepqty > 0 ? $stepqty : 1; } if (!empty($min) && is_numeric($min) && (!empty($max) && is_numeric($max))) { $options = ''; for ($count = $min; $count <= $max; $count = $count + $step) { $options .= '<option value="' . $count . '" ' . selected($count, $args['input_value'], false) . '>' . $count . '</option>'; } $retstr = '<div class="quantity_select" style="' . $args['style'] . '"><select name="' . esc_attr($args['input_name']) . '" title="' . _x('Qty', 'Product quantity input tooltip', 'woocommerce') . '" class="qty">' . $options . '</select></div>'; if ($echo) { echo $retstr; } else { return $retstr; } } else { extract($args, EXTR_OVERWRITE); if (function_exists('wc_get_template')) { ob_start(); wc_get_template('global/quantity-input.php', $args); if ($echo) { echo ob_get_clean(); } else { return ob_get_clean(); } } else { ?> <div class="quantity"><input type="number" step="<?php echo esc_attr($step); ?> " <?php if (is_numeric($min_value)) { ?> min="<?php echo esc_attr($min_value); ?> "<?php } ?> <?php if (is_numeric($max_value)) { ?> max="<?php echo esc_attr($max_value); ?> "<?php } ?> name="<?php echo esc_attr($input_name); ?> " value="<?php echo esc_attr($input_value); ?> " title="<?php _ex('Qty', 'Product quantity input tooltip', 'woocommerce'); ?> " class="input-text qty text" size="4" /></div> <?php } } } else { extract($args, EXTR_OVERWRITE); if (function_exists('wc_get_template')) { ob_start(); wc_get_template('global/quantity-input.php', $args); if ($echo) { echo ob_get_clean(); } else { return ob_get_clean(); } } else { ?> <div class="quantity"><input type="number" step="<?php echo esc_attr($step); ?> " <?php if (is_numeric($min_value)) { ?> min="<?php echo esc_attr($min_value); ?> "<?php } ?> <?php if (is_numeric($max_value)) { ?> max="<?php echo esc_attr($max_value); ?> "<?php } ?> name="<?php echo esc_attr($input_name); ?> " value="<?php echo esc_attr($input_value); ?> " title="<?php _ex('Qty', 'Product quantity input tooltip', 'woocommerce'); ?> " class="input-text qty text" size="4" /></div> <?php } } }
/** * Outputs the hidden row displayed when inline editing * * @since 3.1.0 * * @global string $mode */ public function inline_edit() { global $mode; $screen = $this->screen; $post = get_default_post_to_edit($screen->post_type); $post_type_object = get_post_type_object($screen->post_type); $taxonomy_names = get_object_taxonomies($screen->post_type); $hierarchical_taxonomies = array(); $flat_taxonomies = array(); foreach ($taxonomy_names as $taxonomy_name) { $taxonomy = get_taxonomy($taxonomy_name); $show_in_quick_edit = $taxonomy->show_in_quick_edit; /** * Filter whether the current taxonomy should be shown in the Quick Edit panel. * * @since 4.2.0 * * @param bool $show_in_quick_edit Whether to show the current taxonomy in Quick Edit. * @param string $taxonomy_name Taxonomy name. * @param string $post_type Post type of current Quick Edit post. */ if (!apply_filters('quick_edit_show_taxonomy', $show_in_quick_edit, $taxonomy_name, $screen->post_type)) { continue; } if ($taxonomy->hierarchical) { $hierarchical_taxonomies[] = $taxonomy; } else { $flat_taxonomies[] = $taxonomy; } } $m = isset($mode) && 'excerpt' == $mode ? 'excerpt' : 'list'; $can_publish = current_user_can($post_type_object->cap->publish_posts); $core_columns = array('cb' => true, 'date' => true, 'title' => true, 'categories' => true, 'tags' => true, 'comments' => true, 'author' => true); ?> <form method="get"><table style="display: none"><tbody id="inlineedit"> <?php $hclass = count($hierarchical_taxonomies) ? 'post' : 'page'; $bulk = 0; while ($bulk < 2) { ?> <tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?> " class="inline-edit-row inline-edit-row-<?php echo "{$hclass} inline-edit-" . $screen->post_type; echo $bulk ? " bulk-edit-row bulk-edit-row-{$hclass} bulk-edit-{$screen->post_type}" : " quick-edit-row quick-edit-row-{$hclass} inline-edit-{$screen->post_type}"; ?> " style="display: none"><td colspan="<?php echo $this->get_column_count(); ?> " class="colspanchange"> <fieldset class="inline-edit-col-left"><div class="inline-edit-col"> <h4><?php echo $bulk ? __('Bulk Edit') : __('Quick Edit'); ?> </h4> <?php if (post_type_supports($screen->post_type, 'title')) { if ($bulk) { ?> <div id="bulk-title-div"> <div id="bulk-titles"></div> </div> <?php } else { // $bulk ?> <label> <span class="title"><?php _e('Title'); ?> </span> <span class="input-text-wrap"><input type="text" name="post_title" class="ptitle" value="" /></span> </label> <label> <span class="title"><?php _e('Slug'); ?> </span> <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span> </label> <?php } // $bulk } // post_type_supports title ?> <?php if (!$bulk) { ?> <fieldset class="inline-edit-date"> <legend><span class="title"><?php _e('Date'); ?> </span></legend> <?php touch_time(1, 1, 0, 1); ?> </fieldset> <br class="clear" /> <?php } // $bulk if (post_type_supports($screen->post_type, 'author')) { $authors_dropdown = ''; if (is_super_admin() || current_user_can($post_type_object->cap->edit_others_posts)) { $users_opt = array('hide_if_only_one_author' => false, 'who' => 'authors', 'name' => 'post_author', 'class' => 'authors', 'multi' => 1, 'echo' => 0); if ($bulk) { $users_opt['show_option_none'] = __('— No Change —'); } if ($authors = wp_dropdown_users($users_opt)) { $authors_dropdown = '<label class="inline-edit-author">'; $authors_dropdown .= '<span class="title">' . __('Author') . '</span>'; $authors_dropdown .= $authors; $authors_dropdown .= '</label>'; } } // authors ?> <?php if (!$bulk) { echo $authors_dropdown; } } // post_type_supports author if (!$bulk && $can_publish) { ?> <div class="inline-edit-group"> <label class="alignleft"> <span class="title"><?php _e('Password'); ?> </span> <span class="input-text-wrap"><input type="text" name="post_password" class="inline-edit-password-input" value="" /></span> </label> <em class="alignleft inline-edit-or"> <?php /* translators: Between password field and private checkbox on post quick edit interface */ _e('–OR–'); ?> </em> <label class="alignleft inline-edit-private"> <input type="checkbox" name="keep_private" value="private" /> <span class="checkbox-title"><?php _e('Private'); ?> </span> </label> </div> <?php } ?> </div></fieldset> <?php if (count($hierarchical_taxonomies) && !$bulk) { ?> <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col"> <?php foreach ($hierarchical_taxonomies as $taxonomy) { ?> <span class="title inline-edit-categories-label"><?php echo esc_html($taxonomy->labels->name); ?> </span> <input type="hidden" name="<?php echo $taxonomy->name == 'category' ? 'post_category[]' : 'tax_input[' . esc_attr($taxonomy->name) . '][]'; ?> " value="0" /> <ul class="cat-checklist <?php echo esc_attr($taxonomy->name); ?> -checklist"> <?php wp_terms_checklist(null, array('taxonomy' => $taxonomy->name)); ?> </ul> <?php } //$hierarchical_taxonomies as $taxonomy ?> </div></fieldset> <?php } // count( $hierarchical_taxonomies ) && !$bulk ?> <fieldset class="inline-edit-col-right"><div class="inline-edit-col"> <?php if (post_type_supports($screen->post_type, 'author') && $bulk) { echo $authors_dropdown; } if (post_type_supports($screen->post_type, 'page-attributes')) { if ($post_type_object->hierarchical) { ?> <label> <span class="title"><?php _e('Parent'); ?> </span> <?php $dropdown_args = array('post_type' => $post_type_object->name, 'selected' => $post->post_parent, 'name' => 'post_parent', 'show_option_none' => __('Main Page (no parent)'), 'option_none_value' => 0, 'sort_column' => 'menu_order, post_title'); if ($bulk) { $dropdown_args['show_option_no_change'] = __('— No Change —'); } /** * Filter the arguments used to generate the Quick Edit page-parent drop-down. * * @since 2.7.0 * * @see wp_dropdown_pages() * * @param array $dropdown_args An array of arguments. */ $dropdown_args = apply_filters('quick_edit_dropdown_pages_args', $dropdown_args); wp_dropdown_pages($dropdown_args); ?> </label> <?php } // hierarchical if (!$bulk) { ?> <label> <span class="title"><?php _e('Order'); ?> </span> <span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order; ?> " /></span> </label> <?php } // !$bulk if ('page' == $screen->post_type) { ?> <label> <span class="title"><?php _e('Template'); ?> </span> <select name="page_template"> <?php if ($bulk) { ?> <option value="-1"><?php _e('— No Change —'); ?> </option> <?php } // $bulk ?> <?php /** This filter is documented in wp-admin/includes/meta-boxes.php */ $default_title = apply_filters('default_page_template_title', __('Default Template'), 'quick-edit'); ?> <option value="default"><?php echo esc_html($default_title); ?> </option> <?php page_template_dropdown(); ?> </select> </label> <?php } // page post_type } // page-attributes ?> <?php if (count($flat_taxonomies) && !$bulk) { ?> <?php foreach ($flat_taxonomies as $taxonomy) { ?> <?php if (current_user_can($taxonomy->cap->assign_terms)) { ?> <label class="inline-edit-tags"> <span class="title"><?php echo esc_html($taxonomy->labels->name); ?> </span> <textarea cols="22" rows="1" name="tax_input[<?php echo esc_attr($taxonomy->name); ?> ]" class="tax_input_<?php echo esc_attr($taxonomy->name); ?> "></textarea> </label> <?php } ?> <?php } //$flat_taxonomies as $taxonomy ?> <?php } // count( $flat_taxonomies ) && !$bulk ?> <?php if (post_type_supports($screen->post_type, 'comments') || post_type_supports($screen->post_type, 'trackbacks')) { if ($bulk) { ?> <div class="inline-edit-group"> <?php if (post_type_supports($screen->post_type, 'comments')) { ?> <label class="alignleft"> <span class="title"><?php _e('Comments'); ?> </span> <select name="comment_status"> <option value=""><?php _e('— No Change —'); ?> </option> <option value="open"><?php _e('Allow'); ?> </option> <option value="closed"><?php _e('Do not allow'); ?> </option> </select> </label> <?php } if (post_type_supports($screen->post_type, 'trackbacks')) { ?> <label class="alignright"> <span class="title"><?php _e('Pings'); ?> </span> <select name="ping_status"> <option value=""><?php _e('— No Change —'); ?> </option> <option value="open"><?php _e('Allow'); ?> </option> <option value="closed"><?php _e('Do not allow'); ?> </option> </select> </label> <?php } ?> </div> <?php } else { // $bulk ?> <div class="inline-edit-group"> <?php if (post_type_supports($screen->post_type, 'comments')) { ?> <label class="alignleft"> <input type="checkbox" name="comment_status" value="open" /> <span class="checkbox-title"><?php _e('Allow Comments'); ?> </span> </label> <?php } if (post_type_supports($screen->post_type, 'trackbacks')) { ?> <label class="alignleft"> <input type="checkbox" name="ping_status" value="open" /> <span class="checkbox-title"><?php _e('Allow Pings'); ?> </span> </label> <?php } ?> </div> <?php } // $bulk } // post_type_supports comments or pings ?> <div class="inline-edit-group"> <label class="inline-edit-status alignleft"> <span class="title"><?php _e('Status'); ?> </span> <select name="_status"> <?php if ($bulk) { ?> <option value="-1"><?php _e('— No Change —'); ?> </option> <?php } // $bulk ?> <?php if ($can_publish) { // Contributors only get "Unpublished" and "Pending Review" ?> <option value="publish"><?php _e('Published'); ?> </option> <option value="future"><?php _e('Scheduled'); ?> </option> <?php if ($bulk) { ?> <option value="private"><?php _e('Private'); ?> </option> <?php } // $bulk ?> <?php } ?> <option value="pending"><?php _e('Pending Review'); ?> </option> <option value="draft"><?php _e('Draft'); ?> </option> </select> </label> <?php if ('post' == $screen->post_type && $can_publish && current_user_can($post_type_object->cap->edit_others_posts)) { ?> <?php if ($bulk) { ?> <label class="alignright"> <span class="title"><?php _e('Sticky'); ?> </span> <select name="sticky"> <option value="-1"><?php _e('— No Change —'); ?> </option> <option value="sticky"><?php _e('Sticky'); ?> </option> <option value="unsticky"><?php _e('Not Sticky'); ?> </option> </select> </label> <?php } else { // $bulk ?> <label class="alignleft"> <input type="checkbox" name="sticky" value="sticky" /> <span class="checkbox-title"><?php _e('Make this post sticky'); ?> </span> </label> <?php } // $bulk ?> <?php } // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?> </div> <?php if ($bulk && current_theme_supports('post-formats') && post_type_supports($screen->post_type, 'post-formats')) { $post_formats = get_theme_support('post-formats'); ?> <label class="alignleft"> <span class="title"><?php _ex('Format', 'post format'); ?> </span> <select name="post_format"> <option value="-1"><?php _e('— No Change —'); ?> </option> <option value="0"><?php echo get_post_format_string('standard'); ?> </option> <?php if (is_array($post_formats[0])) { foreach ($post_formats[0] as $format) { ?> <option value="<?php echo esc_attr($format); ?> "><?php echo esc_html(get_post_format_string($format)); ?> </option> <?php } } ?> </select></label> <?php } ?> </div></fieldset> <?php list($columns) = $this->get_column_info(); foreach ($columns as $column_name => $column_display_name) { if (isset($core_columns[$column_name])) { continue; } if ($bulk) { /** * Fires once for each column in Bulk Edit mode. * * @since 2.7.0 * * @param string $column_name Name of the column to edit. * @param WP_Post $post_type The post type slug. */ do_action('bulk_edit_custom_box', $column_name, $screen->post_type); } else { /** * Fires once for each column in Quick Edit mode. * * @since 2.7.0 * * @param string $column_name Name of the column to edit. * @param string $post_type The post type slug. */ do_action('quick_edit_custom_box', $column_name, $screen->post_type); } } ?> <p class="submit inline-edit-save"> <button type="button" class="button-secondary cancel alignleft"><?php _e('Cancel'); ?> </button> <?php if (!$bulk) { wp_nonce_field('inlineeditnonce', '_inline_edit', false); ?> <button type="button" class="button-primary save alignright"><?php _e('Update'); ?> </button> <span class="spinner"></span> <?php } else { submit_button(__('Update'), 'button-primary alignright', 'bulk_edit', false); } ?> <input type="hidden" name="post_view" value="<?php echo esc_attr($m); ?> " /> <input type="hidden" name="screen" value="<?php echo esc_attr($screen->id); ?> " /> <?php if (!$bulk && !post_type_supports($screen->post_type, 'author')) { ?> <input type="hidden" name="post_author" value="<?php echo esc_attr($post->post_author); ?> " /> <?php } ?> <span class="error" style="display:none"></span> <br class="clear" /> </p> </td></tr> <?php $bulk++; } ?> </tbody></table></form> <?php }
function form($instance) { //Defaults $instance = wp_parse_args((array) $instance, array('images' => true, 'name' => true, 'description' => false, 'rating' => false, 'category' => false, 'orderby' => 'name', 'limit' => -1)); $link_cats = get_terms('link_category'); if (!($limit = intval($instance['limit']))) { $limit = -1; } ?> <p> <label for="<?php echo $this->get_field_id('category'); ?> "><?php _e('Select Link Category:'); ?> </label> <select class="widefat" id="<?php echo $this->get_field_id('category'); ?> " name="<?php echo $this->get_field_name('category'); ?> "> <option value=""><?php _ex('All Links', 'links widget'); ?> </option> <?php foreach ($link_cats as $link_cat) { echo '<option value="' . intval($link_cat->term_id) . '"' . selected($instance['category'], $link_cat->term_id, false) . '>' . $link_cat->name . "</option>\n"; } ?> </select> <label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Sort by:'); ?> </label> <select name="<?php echo $this->get_field_name('orderby'); ?> " id="<?php echo $this->get_field_id('orderby'); ?> " class="widefat"> <option value="name"<?php selected($instance['orderby'], 'name'); ?> ><?php _e('Link title'); ?> </option> <option value="rating"<?php selected($instance['orderby'], 'rating'); ?> ><?php _e('Link rating'); ?> </option> <option value="id"<?php selected($instance['orderby'], 'id'); ?> ><?php _e('Link ID'); ?> </option> <option value="rand"<?php selected($instance['orderby'], 'rand'); ?> ><?php _e('Random'); ?> </option> </select> </p> <p> <input class="checkbox" type="checkbox" <?php checked($instance['images'], true); ?> id="<?php echo $this->get_field_id('images'); ?> " name="<?php echo $this->get_field_name('images'); ?> " /> <label for="<?php echo $this->get_field_id('images'); ?> "><?php _e('Show Link Image'); ?> </label><br /> <input class="checkbox" type="checkbox" <?php checked($instance['name'], true); ?> id="<?php echo $this->get_field_id('name'); ?> " name="<?php echo $this->get_field_name('name'); ?> " /> <label for="<?php echo $this->get_field_id('name'); ?> "><?php _e('Show Link Name'); ?> </label><br /> <input class="checkbox" type="checkbox" <?php checked($instance['description'], true); ?> id="<?php echo $this->get_field_id('description'); ?> " name="<?php echo $this->get_field_name('description'); ?> " /> <label for="<?php echo $this->get_field_id('description'); ?> "><?php _e('Show Link Description'); ?> </label><br /> <input class="checkbox" type="checkbox" <?php checked($instance['rating'], true); ?> id="<?php echo $this->get_field_id('rating'); ?> " name="<?php echo $this->get_field_name('rating'); ?> " /> <label for="<?php echo $this->get_field_id('rating'); ?> "><?php _e('Show Link Rating'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('limit'); ?> "><?php _e('Number of links to show:'); ?> </label> <input id="<?php echo $this->get_field_id('limit'); ?> " name="<?php echo $this->get_field_name('limit'); ?> " type="text" value="<?php echo $limit == -1 ? '' : intval($limit); ?> " size="3" /> </p> <?php }
function output($options) { global $dslc_active; if ($dslc_active && is_user_logged_in() && current_user_can(DS_LIVE_COMPOSER_CAPABILITY)) { $dslc_is_admin = true; } else { $dslc_is_admin = false; } $options['module_id'] = $this->module_id; $this->module_start($options); /* Module output stars here */ if (!isset($options['excerpt_length'])) { $options['excerpt_length'] = 20; } if (!isset($options['type'])) { $options['type'] = 'grid'; } if (is_front_page()) { $paged = get_query_var('page') ? get_query_var('page') : 1; } else { $paged = get_query_var('paged') ? get_query_var('paged') : 1; } // Fix for pagination from other modules affecting this one when pag disabled if ($options['pagination_type'] == 'disabled') { $paged = 1; } // Fix for offset braking pagination $query_offset = $options['offset']; if ($query_offset > 0 && $paged > 1) { $query_offset = ($paged - 1) * $options['amount'] + $options['offset']; } $args = array('paged' => $paged, 'post_type' => 'dslc_projects', 'posts_per_page' => $options['amount'], 'order' => $options['order'], 'orderby' => $options['orderby'], 'offset' => $query_offset); if (isset($options['categories']) && $options['categories'] != '') { $cats_array = explode(' ', trim($options['categories'])); $args['tax_query'] = array(array('taxonomy' => 'dslc_projects_cats', 'field' => 'slug', 'terms' => $cats_array, 'operator' => $options['categories_operator'])); } // Exlcude and Include arrays $exclude = array(); $include = array(); // Exclude current post if (is_singular(get_post_type())) { $exclude[] = get_the_ID(); } // Exclude posts ( option ) if ($options['query_post_not_in']) { $exclude = array_merge($exclude, explode(' ', $options['query_post_not_in'])); } // Include posts ( option ) if ($options['query_post_in']) { $include = array_merge($include, explode(' ', $options['query_post_in'])); } // Include query parameter if (!empty($include)) { $args['post__in'] = $include; } // Exclude query parameter if (!empty($exclude)) { $args['post__not_in'] = $exclude; } // Author archive page if (is_author()) { global $authordata; $args['author__in'] = array($authordata->data->ID); } // No paging if ($options['pagination_type'] == 'disabled') { $args['no_found_rows'] = true; } // Do the query if (is_category() || is_tax() || is_search()) { global $wp_query; $dslc_query = $wp_query; } else { $dslc_query = new WP_Query($args); } $wrapper_class = ''; $columns_class = 'dslc-col dslc-' . $options['columns'] . '-col '; $count = 0; $real_count = 0; $increment = $options['columns']; $max_count = 12; /** * Elements to show */ // Main Elements $elements = $options['elements']; if (!empty($elements)) { $elements = explode(' ', trim($elements)); } else { $elements = array(); } // Post Elements $post_elements = $options['post_elements']; if (!empty($post_elements)) { $post_elements = explode(' ', trim($post_elements)); } else { $post_elements = 'all'; } // Carousel Elements $carousel_elements = $options['carousel_elements']; if (!empty($carousel_elements)) { $carousel_elements = explode(' ', trim($carousel_elements)); } else { $carousel_elements = array(); } /* Container Class */ $container_class = 'dslc-posts dslc-projects dslc-clearfix dslc-posts-orientation-' . $options['orientation'] . ' '; if ($options['type'] == 'masonry') { $container_class .= 'dslc-init-masonry '; } elseif ($options['type'] == 'grid') { $container_class .= 'dslc-init-grid '; } /* Element Class */ $element_class = 'dslc-post dslc-project '; if ($options['type'] == 'masonry') { $element_class .= 'dslc-masonry-item '; } elseif ($options['type'] == 'carousel') { $element_class .= 'dslc-carousel-item '; } /** * What is shown */ $show_header = false; $show_heading = false; $show_filters = false; $show_carousel_arrows = false; $show_view_all_link = false; if (in_array('main_heading', $elements)) { $show_heading = true; } if (($elements == 'all' || in_array('filters', $elements)) && $options['type'] !== 'carousel') { $show_filters = true; } if ($options['type'] == 'carousel' && in_array('arrows', $carousel_elements)) { $show_carousel_arrows = true; } if ($show_heading || $show_filters || $show_carousel_arrows) { $show_header = true; } /** * Carousel Items */ switch ($options['columns']) { case 12: $carousel_items = 1; break; case 6: $carousel_items = 2; break; case 4: $carousel_items = 3; break; case 3: $carousel_items = 4; break; case 2: $carousel_items = 6; break; default: $carousel_items = 6; break; } /** * Heading ( output ) */ if ($show_header) { ?> <div class="dslc-module-heading"> <!-- Heading --> <?php if ($show_heading) { ?> <h2 class="dslca-editable-content" data-id="main_heading_title" data-type="simple" <?php if ($dslc_is_admin) { echo 'contenteditable'; } ?> ><?php echo $options['main_heading_title']; ?> </h2> <!-- View all --> <?php if (isset($options['view_all_link']) && $options['view_all_link'] !== '') { ?> <span class="dslc-module-heading-view-all"><a href="<?php echo $options['view_all_link']; ?> " class="dslca-editable-content" data-id="main_heading_link_title" data-type="simple" <?php if ($dslc_is_admin) { echo 'contenteditable'; } ?> ><?php echo $options['main_heading_link_title']; ?> </a></span> <?php } ?> <?php } ?> <!-- Filters --> <?php if ($show_filters) { $cats_array = array(); if ($dslc_query->have_posts()) { while ($dslc_query->have_posts()) { $dslc_query->the_post(); $post_cats = get_the_terms(get_the_ID(), 'dslc_projects_cats'); if (!empty($post_cats)) { foreach ($post_cats as $post_cat) { $cats_array[$post_cat->slug] = $post_cat->name; } } } } ?> <div class="dslc-post-filters"> <span class="dslc-post-filter dslc-active" data-id=" "><?php _ex('All', 'Post Filter', 'dslc_string'); ?> </span> <?php foreach ($cats_array as $cat_slug => $cat_name) { ?> <span class="dslc-post-filter dslc-inactive" data-id="<?php echo $cat_slug; ?> "><?php echo $cat_name; ?> </span> <?php } ?> </div><!-- .dslc-post-filters --> <?php } ?> <!-- Carousel --> <?php if ($show_carousel_arrows) { ?> <span class="dslc-carousel-nav fr"> <span class="dslc-carousel-nav-inner"> <a href="#" class="dslc-carousel-nav-prev"><span class="dslc-icon-chevron-left dslc-init-center"></span></a> <a href="#" class="dslc-carousel-nav-next"><span class="dslc-icon-chevron-right dslc-init-center"></span></a> </span> </span><!-- .carousel-nav --> <?php } ?> </div><!-- .dslc-module-heading --> <?php } /** * Posts ( output ) */ if ($dslc_query->have_posts()) { ?> <div class="<?php echo $container_class; ?> "><?php if ($options['type'] == 'carousel') { ?> <div class="dslc-loader"></div><div class="dslc-carousel" data-stop-on-hover="<?php echo $options['carousel_autoplay_hover']; ?> " data-autoplay="<?php echo $options['carousel_autoplay']; ?> " data-columns="<?php echo $carousel_items; ?> " data-pagination="<?php if (in_array('circles', $carousel_elements)) { echo 'true'; } else { echo 'false'; } ?> " data-slide-speed="<?php echo $options['arrows_slide_speed']; ?> " data-pagination-speed="<?php echo $options['circles_slide_speed']; ?> "><?php } while ($dslc_query->have_posts()) { $dslc_query->the_post(); $count += $increment; $real_count++; if ($count == $max_count) { $count = 0; $extra_class = ' dslc-last-col'; } elseif ($count == $increment) { $extra_class = ' dslc-first-col'; } else { $extra_class = ''; } if (!has_post_thumbnail()) { $extra_class .= ' dslc-post-no-thumb'; } $project_cats_count = 0; $project_cats = get_the_terms(get_the_ID(), 'dslc_projects_cats'); $project_cats_data = ''; if (!empty($project_cats)) { foreach ($project_cats as $project_cat) { $project_cats_data .= $project_cat->slug . ' '; } } // Project URL $the_project_url = get_permalink(); if ($options['link'] == 'custom') { if (get_post_meta(get_the_ID(), 'dslc_project_url', true)) { $the_project_url = get_post_meta(get_the_ID(), 'dslc_project_url', true); } else { $the_project_url = '#'; } } // Project URL target $the_project_url_target = $options['link_target']; ?> <div class="<?php echo $element_class . $columns_class . $extra_class; ?> " data-cats="<?php echo $project_cats_data; ?> "> <?php if ($post_elements == 'all' || in_array('thumbnail', $post_elements)) { ?> <?php /** * Manual Resize */ $manual_resize = false; if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height']) || isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) { $manual_resize = true; $thumb_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); $thumb_url = $thumb_url[0]; $thumb_alt = get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true); if (!$thumb_alt) { $thumb_alt = ''; } $resize_width = false; $resize_height = false; if (isset($options['thumb_resize_width_manual']) && !empty($options['thumb_resize_width_manual'])) { $resize_width = $options['thumb_resize_width_manual']; } if (isset($options['thumb_resize_height']) && !empty($options['thumb_resize_height'])) { $resize_height = $options['thumb_resize_height']; } } ?> <?php if (has_post_thumbnail()) { ?> <div class="dslc-post-thumb dslc-project-thumb dslc-on-hover-anim"> <div class="dslc-project-thumb-inner dslca-post-thumb"> <?php if ($manual_resize) { ?> <a href="<?php echo $the_project_url; ?> " target="<?php echo $the_project_url_target; ?> "><img src="<?php $res_img = dslc_aq_resize($thumb_url, $resize_width, $resize_height, true); echo $res_img; ?> " alt="<?php echo $thumb_alt; ?> " /></a> <?php } else { ?> <a href="<?php echo $the_project_url; ?> " target="<?php echo $the_project_url_target; ?> "><?php the_post_thumbnail('full'); ?> </a> <?php } ?> </div><!-- .dslc-project-thumb-inner --> <?php if (($options['main_location'] == 'inside' || $options['main_location'] == 'inside_visible') && ($post_elements == 'all' || in_array('title', $post_elements) || in_array('categories', $post_elements) || in_array('excerpt', $post_elements) || in_array('button', $post_elements))) { ?> <div class="dslc-project-main <?php if ($options['main_location'] == 'inside_visible') { echo 'dslc-project-main-visible'; } ?> dslc-on-hover-anim-target dslc-anim-<?php echo $options['css_anim_hover']; ?> " data-dslc-anim="<?php echo $options['css_anim_hover']; ?> " data-dslc-anim-speed="<?php echo $options['css_anim_speed']; ?> "> <div class="dslc-project-main-inner dslc-init-<?php echo $options['main_position']; ?> "> <?php if ($post_elements == 'all' || in_array('title', $post_elements)) { ?> <div class="dslc-project-title"> <h2><a href="<?php echo $the_project_url; ?> " target="<?php echo $the_project_url_target; ?> "><?php the_title(); ?> </a></h2> </div><!-- .dslc-project-title --> <?php } ?> <?php if ($post_elements == 'all' || in_array('categories', $post_elements)) { ?> <?php if (!empty($project_cats)) { ?> <div class="dslc-project-cats"> <?php foreach ($project_cats as $project_cat) { $project_cats_count++; if ($project_cats_count > 1) { echo ', '; } echo $project_cat->name; } ?> </div><!-- .dslc-project-cats --> <?php } ?> <?php } ?> <?php if ($post_elements == 'all' || in_array('excerpt', $post_elements)) { ?> <div class="dslc-project-excerpt"> <?php if ($options['excerpt_or_content'] == 'content') { ?> <?php the_content(); ?> <?php } else { ?> <?php if (has_excerpt()) { echo do_shortcode(wp_trim_words(get_the_excerpt(), $options['excerpt_length'])); } else { echo do_shortcode(wp_trim_words(get_the_content(), $options['excerpt_length'])); } ?> <?php } ?> </div><!-- .dslc-project-excerpt --> <?php } ?> <?php if ($post_elements == 'all' || in_array('button', $post_elements)) { ?> <div class="dslc-project-read-more"> <a href="<?php echo $the_project_url; ?> " target="<?php echo $the_project_url_target; ?> "> <?php if (isset($options['button_icon_id']) && $options['button_icon_id'] != '') { ?> <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?> "></span> <?php } ?> <?php echo $options['button_text']; ?> </a> </div><!-- .dslc-project-read-more --> <?php } ?> </div><!-- .dslc-init-center --> </div><!-- .dslc-project-main --> <?php } ?> </div><!-- .dslc-project-thumb --> <?php } ?> <?php } ?> <?php if ($options['main_location'] == 'bellow' && ($post_elements == 'all' || in_array('title', $post_elements) || in_array('categories', $post_elements) || in_array('excerpt', $post_elements) || in_array('button', $post_elements))) { ?> <div class="dslc-post-main dslc-project-main"> <?php if ($post_elements == 'all' || in_array('title', $post_elements)) { ?> <div class="dslc-project-title"> <h2><a href="<?php echo $the_project_url; ?> " target="<?php echo $the_project_url_target; ?> "><?php the_title(); ?> </a></h2> </div><!-- .dslc-project-title --> <?php } ?> <?php if ($post_elements == 'all' || in_array('categories', $post_elements)) { ?> <?php if (!empty($project_cats)) { ?> <div class="dslc-project-cats"> <?php foreach ($project_cats as $project_cat) { $project_cats_count++; if ($project_cats_count > 1) { echo ', '; } echo $project_cat->name; } ?> </div><!-- .dslc-project-cats --> <?php } ?> <?php } ?> <?php if ($post_elements == 'all' || in_array('excerpt', $post_elements)) { ?> <div class="dslc-project-excerpt"> <?php if ($options['excerpt_or_content'] == 'content') { ?> <?php the_content(); ?> <?php } else { ?> <?php if (has_excerpt()) { echo do_shortcode(wp_trim_words(get_the_excerpt(), $options['excerpt_length'])); } else { echo do_shortcode(wp_trim_words(get_the_content(), $options['excerpt_length'])); } ?> <?php } ?> </div><!-- .dslc-project-excerpt --> <?php } ?> <?php if ($post_elements == 'all' || in_array('button', $post_elements)) { ?> <div class="dslc-project-read-more"> <a href="<?php echo $the_project_url; ?> " target="<?php echo $the_project_url_target; ?> "> <?php if (isset($options['button_icon_id']) && $options['button_icon_id'] != '') { ?> <span class="dslc-icon dslc-icon-<?php echo $options['button_icon_id']; ?> "></span> <?php } ?> <?php echo $options['button_text']; ?> </a> </div><!-- .dslc-project-read-more --> <?php } ?> </div><!-- .dslc-project-main --> <?php } ?> </div><!-- .dslc-project --> <?php // Row Separator if ($options['type'] == 'grid' && $count == 0 && $real_count != $dslc_query->found_posts && $real_count != $options['amount'] && $options['separator_enabled'] == 'enabled') { echo '<div class="dslc-post-separator"></div>'; } } if ($options['type'] == 'carousel') { ?> </div><?php } ?> </div><!-- .dslc-projects --> <?php } else { if ($dslc_is_admin) { ?> <div class="dslc-notification dslc-red"><?php _e('You do not have any projects at the moment. Go to <strong>WP Admin → Projects</strong> to add some.', 'dslc_string'); ?> <span class="dslca-refresh-module-hook dslc-icon dslc-icon-refresh"></span></span></div><?php } } /** * Pagination */ if (isset($options['pagination_type']) && $options['pagination_type'] != 'disabled') { $num_pages = $dslc_query->max_num_pages; if ($options['offset'] > 0) { $num_pages = ceil(($dslc_query->found_posts - $options['offset']) / $options['amount']); } dslc_post_pagination(array('pages' => $num_pages, 'type' => $options['pagination_type'])); } wp_reset_postdata(); /* Module output ends here */ $this->module_end($options); }
echo esc_attr($step); ?> " <?php if (is_numeric($min_value)) { ?> min="<?php echo esc_attr($min_value); ?> "<?php } ?> <?php if (is_numeric($max_value)) { ?> max="<?php echo esc_attr($max_value); ?> "<?php } ?> name="<?php echo esc_attr($input_name); ?> " value="<?php echo esc_attr($input_value); ?> " title="<?php _ex('Quantity', 'Product quantity input tooltip', 'woocommerce'); ?> " class="input-text qty text" size="4" /></div> </div>
/** * Renders the Members metabox on single group pages. * * @since 1.7.0 * * @param BP_Groups_Group $item The BP_Groups_Group object for the current group. */ function bp_groups_admin_edit_metabox_members($item) { // Pull up a list of group members, so we can separate out the types // We'll also keep track of group members here to place them into a // JavaScript variable, which will help with group member autocomplete $members = array('admin' => array(), 'mod' => array(), 'member' => array(), 'banned' => array()); $pagination = array('admin' => array(), 'mod' => array(), 'member' => array(), 'banned' => array()); foreach ($members as $type => &$member_type_users) { $page_qs_key = $type . '_page'; $current_type_page = isset($_GET[$page_qs_key]) ? absint($_GET[$page_qs_key]) : 1; $member_type_query = new BP_Group_Member_Query(array('group_id' => $item->id, 'group_role' => array($type), 'type' => 'alphabetical', 'per_page' => 10, 'page' => $current_type_page)); $member_type_users = $member_type_query->results; $pagination[$type] = bp_groups_admin_create_pagination_links($member_type_query, $type); } // Echo out the JavaScript variable echo '<script type="text/javascript">var group_id = "' . esc_js($item->id) . '";</script>'; // Loop through each member type foreach ($members as $member_type => $type_users) { ?> <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr($member_type); ?> "> <h4><?php switch ($member_type) { case 'admin': esc_html_e('Administrators', 'buddypress'); break; case 'mod': esc_html_e('Moderators', 'buddypress'); break; case 'member': esc_html_e('Members', 'buddypress'); break; case 'banned': esc_html_e('Banned Members', 'buddypress'); break; } ?> </h4> <div class="bp-group-admin-pagination table-top"> <?php echo $pagination[$member_type]; ?> </div> <?php if (!empty($type_users)) { ?> <table class="widefat bp-group-members"> <thead> <tr> <th scope="col" class="uid-column"><?php _ex('ID', 'Group member user_id in group admin', 'buddypress'); ?> </th> <th scope="col" class="uname-column"><?php _ex('Name', 'Group member name in group admin', 'buddypress'); ?> </th> <th scope="col" class="urole-column"><?php _ex('Group Role', 'Group member role in group admin', 'buddypress'); ?> </th> </tr> </thead> <tbody> <?php foreach ($type_users as $type_user) { ?> <tr> <th scope="row" class="uid-column"><?php echo esc_html($type_user->ID); ?> </th> <td class="uname-column"> <a style="float: left;" href="<?php echo bp_core_get_user_domain($type_user->ID); ?> "><?php echo bp_core_fetch_avatar(array('item_id' => $type_user->ID, 'width' => '32', 'height' => '32')); ?> </a> <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink($type_user->ID); ?> </span> </td> <td class="urole-column"> <label for="bp-groups-role-<?php echo esc_attr($type_user->ID); ?> " class="screen-reader-text"><?php _e('Select group role for member', 'buddypress'); ?> </label> <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr($type_user->ID); ?> " name="bp-groups-role[<?php echo esc_attr($type_user->ID); ?> ]"> <optgroup label="<?php esc_attr_e('Roles', 'buddypress'); ?> "> <option class="admin" value="admin" <?php selected('admin', $member_type); ?> ><?php esc_html_e('Administrator', 'buddypress'); ?> </option> <option class="mod" value="mod" <?php selected('mod', $member_type); ?> ><?php esc_html_e('Moderator', 'buddypress'); ?> </option> <option class="member" value="member" <?php selected('member', $member_type); ?> ><?php esc_html_e('Member', 'buddypress'); ?> </option> <?php if ('banned' === $member_type) { ?> <option class="banned" value="banned" <?php selected('banned', $member_type); ?> ><?php esc_html_e('Banned', 'buddypress'); ?> </option> <?php } ?> </optgroup> <optgroup label="<?php esc_attr_e('Actions', 'buddypress'); ?> "> <option class="remove" value="remove"><?php esc_html_e('Remove', 'buddypress'); ?> </option> <?php if ('banned' !== $member_type) { ?> <option class="banned" value="banned"><?php esc_html_e('Ban', 'buddypress'); ?> </option> <?php } ?> </optgroup> </select> <?php /** * Store the current role for this user, * so we can easily detect changes. * * @todo remove this, and do database detection on save */ ?> <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr($type_user->ID); ?> ]" value="<?php echo esc_attr($member_type); ?> " /> </td> </tr> <?php if (has_filter('bp_groups_admin_manage_member_row')) { ?> <tr> <td colspan="3"> <?php /** * Fires after the listing of a single row for members in a group on the group edit screen. * * @since 1.8.0 * * @param int $ID ID of the user being rendered. * @param BP_Groups_Group $item Object for the current group. */ do_action('bp_groups_admin_manage_member_row', $type_user->ID, $item); ?> </td> </tr> <?php } ?> <?php } ?> </tbody> </table> <div class="bp-group-admin-pagination table-bottom"> <?php echo $pagination[$member_type]; ?> </div> <?php } else { ?> <p class="bp-groups-no-members description"><?php esc_html_e('No members of this type', 'buddypress'); ?> </p> <?php } ?> </div><!-- .bp-groups-member-type --> <?php } }
/** * Prints the form in the Custom Fields meta box. * * @since 1.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param WP_Post $post Optional. The post being edited. */ function meta_form($post = null) { global $wpdb; $post = get_post($post); /** * Filters values for the meta key dropdown in the Custom Fields meta box. * * Returning a non-null value will effectively short-circuit and avoid a * potentially expensive query against postmeta. * * @since 4.4.0 * * @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. Default null. * @param WP_Post $post The current post object. */ $keys = apply_filters('postmeta_form_keys', null, $post); if (null === $keys) { /** * Filters the number of custom fields to retrieve for the drop-down * in the Custom Fields meta box. * * @since 2.1.0 * * @param int $limit Number of custom fields to retrieve. Default 30. */ $limit = apply_filters('postmeta_form_limit', 30); $sql = "SELECT DISTINCT meta_key\n\t\t\tFROM {$wpdb->postmeta}\n\t\t\tWHERE meta_key NOT BETWEEN '_' AND '_z'\n\t\t\tHAVING meta_key NOT LIKE %s\n\t\t\tORDER BY meta_key\n\t\t\tLIMIT %d"; $keys = $wpdb->get_col($wpdb->prepare($sql, $wpdb->esc_like('_') . '%', $limit)); } if ($keys) { natcasesort($keys); $meta_key_input_id = 'metakeyselect'; } else { $meta_key_input_id = 'metakeyinput'; } ?> <p><strong><?php _e('Add New Custom Field:'); ?> </strong></p> <table id="newmeta"> <thead> <tr> <th class="left"><label for="<?php echo $meta_key_input_id; ?> "><?php _ex('Name', 'meta name'); ?> </label></th> <th><label for="metavalue"><?php _e('Value'); ?> </label></th> </tr> </thead> <tbody> <tr> <td id="newmetaleft" class="left"> <?php if ($keys) { ?> <select id="metakeyselect" name="metakeyselect"> <option value="#NONE#"><?php _e('— Select —'); ?> </option> <?php foreach ($keys as $key) { if (is_protected_meta($key, 'post') || !current_user_can('add_post_meta', $post->ID, $key)) { continue; } echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . "</option>"; } ?> </select> <input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" value="" /> <a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;"> <span id="enternew"><?php _e('Enter new'); ?> </span> <span id="cancelnew" class="hidden"><?php _e('Cancel'); ?> </span></a> <?php } else { ?> <input type="text" id="metakeyinput" name="metakeyinput" value="" /> <?php } ?> </td> <td><textarea id="metavalue" name="metavalue" rows="2" cols="25"></textarea></td> </tr> <tr><td colspan="2"> <div class="submit"> <?php submit_button(__('Add Custom Field'), 'secondary', 'addmeta', false, array('id' => 'newmeta-submit', 'data-wp-lists' => 'add:the-list:newmeta')); ?> </div> <?php wp_nonce_field('add-meta', '_ajax_nonce-add-meta', false); ?> </td></tr> </tbody> </table> <?php }