Example #1
1
function cimy_um_download_database()
{
    global $cum_upload_path;
    if (!empty($_POST["cimy_um_filename"])) {
        if (strpos($_SERVER['HTTP_REFERER'], admin_url('users.php?page=cimy_user_manager')) !== false) {
            // not whom we are expecting? exit!
            if (!check_admin_referer('cimy_um_download', 'cimy_um_downloadnonce')) {
                return;
            }
            $cimy_um_filename = $_POST["cimy_um_filename"];
            // sanitize the file name
            $cimy_um_filename = sanitize_file_name($cimy_um_filename);
            $cimy_um_fullpath_file = $cum_upload_path . $cimy_um_filename;
            // does not exist? exit!
            if (!is_file($cimy_um_fullpath_file)) {
                return;
            }
            header("Pragma: ");
            // Leave blank for issues with IE
            header("Expires: 0");
            header('Vary: User-Agent');
            header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
            header("Content-Type: text/csv");
            header("Content-Type: application/force-download");
            header("Content-Type: application/download");
            header("Content-Disposition: attachment; filename=\"" . esc_html($cimy_um_filename) . "\";");
            // cannot use esc_url any more because prepends 'http' (doh)
            header("Content-Transfer-Encoding: binary");
            header("Content-Length: " . filesize($cimy_um_fullpath_file));
            readfile($cimy_um_fullpath_file);
            exit;
        }
    }
}
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function square_posted_on()
 {
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     $posted_on = sprintf(esc_html_x('%s', 'post date', 'square'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf(esc_html_x('by %s', 'post author', 'square'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     $comment_count = get_comments_number();
     // get_comments_number returns only a numeric value
     if (comments_open()) {
         if ($comment_count == 0) {
             $comments = __('No Comments', 'square');
         } elseif ($comment_count > 1) {
             $comments = $comment_count . __(' Comments', 'square');
         } else {
             $comments = __('1 Comment', 'square');
         }
         $comment_link = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
     } else {
         $comment_link = __(' Comment Closed', 'square');
     }
     echo '<span class="posted-on"><i class="fa fa-clock-o"></i>' . $posted_on . '</span><span class="byline"> ' . $byline . '</span><span class="comment-count"><i class="fa fa-comments-o"></i>' . $comment_link . "</span>";
     // WPCS: XSS OK.
 }
        public function render_content()
        {
            $args = array('orderby' => $this->orderby, 'order' => $this->order, 'taxonomy' => $this->taxonomy, 'hide_empty' => $this->hide_empty ? '1' : '0');
            $categories = get_categories($args);
            ?>
			<label>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
				<select <?php 
            $this->link();
            ?>
>
					<?php 
            // The default value (nothing is selected)
            printf("<option value='%s' %s>%s</option>", '0', selected($this->value(), '0', false), 'โ€” ' . __('Select', PARADOX_TF_I18NDOMAIN) . ' โ€”');
            // Print all the other pages
            foreach ($categories as $category) {
                printf("<option value='%s' %s>%s</option>", esc_attr($category->term_id), selected($this->value(), $category->term_id, false), $category->name . ($this->show_count ? ' (' . $category->count . ')' : ''));
            }
            ?>
				</select>
			</label>
			<?php 
            echo "<p class='description'>{$this->description}</p>";
        }
 /**
  * Return the terms for the given type.
  *
  * @param int $site_id Blog ID.
  *
  * @return array
  */
 public function get_terms_for_site($site_id)
 {
     $out = [];
     switch_to_blog($site_id);
     $taxonomy_object = get_taxonomy($this->taxonomy_name);
     if (!current_user_can($taxonomy_object->cap->edit_terms)) {
         $terms = [];
     } else {
         $terms = get_terms($this->taxonomy_name, ['hide_empty' => FALSE]);
     }
     foreach ($terms as $term) {
         if (is_taxonomy_hierarchical($this->taxonomy_name)) {
             $ancestors = get_ancestors($term->term_id, $this->taxonomy_name);
             if (!empty($ancestors)) {
                 foreach ($ancestors as $ancestor) {
                     $parent_term = get_term($ancestor, $this->taxonomy_name);
                     $term->name = $parent_term->name . '/' . $term->name;
                 }
             }
         }
         $out[$term->term_taxonomy_id] = esc_html($term->name);
     }
     restore_current_blog();
     uasort($out, 'strcasecmp');
     return $out;
 }
    /**
     * Render the content on the theme customizer page
     */
    public function render_content()
    {
        if (!empty($this->menus)) {
            ?>
                <label>
                    <span class="customize-menu-dropdown"><?php 
            echo esc_html($this->label);
            ?>
</span>
                    <select name="<?php 
            echo $this->id;
            ?>
" id="<?php 
            echo $this->id;
            ?>
">
                    <?php 
            foreach ($this->menus as $menu) {
                printf('<option value="%s" %s>%s</option>', $menu->term_id, selected($this->value(), $menu->term_id, false), $menu->name);
            }
            ?>
                    </select>
                </label>
            <?php 
        }
    }
Example #6
0
 /**
  * @see CPAC_Column::get_value()
  * @since 2.0
  */
 function get_value($post_id)
 {
     if (!($format = $this->get_raw_value($post_id))) {
         return false;
     }
     return esc_html(get_post_format_string($format));
 }
Example #7
0
    public function display_region_drop_down()
    {
        $base_region = get_option('base_region');
        if (!empty($this->regions)) {
            ?>
				<select name='wpmlm_options[base_region]'>
					<?php 
            foreach ($this->regions as $region) {
                ?>
						<option value='<?php 
                echo esc_attr($region->id);
                ?>
' <?php 
                selected($region->id, $base_region);
                ?>
><?php 
                echo esc_html($region->name);
                ?>
</option>
					<?php 
            }
            ?>
				</select>
			<?php 
        }
    }
Example #8
0
function showgallery()
{
    global $wpdb;
    $limit = 0;
    if (isset($_POST['search_events_by_title'])) {
        $search_tag = esc_html(stripslashes($_POST['search_events_by_title']));
        $search_tag = sanitize_text_field($search_tag);
    } else {
        $search_tag = '';
    }
    $cat_row_query = "SELECT id,name FROM " . $wpdb->prefix . "huge_itgallery_gallerys WHERE sl_width=0";
    $cat_row = $wpdb->get_results($cat_row_query);
    $query = $wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "huge_itgallery_gallerys WHERE name LIKE %s", "%{$search_tag}}%");
    $total = $wpdb->get_var($query);
    $query = $wpdb->prepare("SELECT  a.* ,  COUNT(b.id) AS count, g.par_name AS par_name FROM " . $wpdb->prefix . "huge_itgallery_gallerys  AS a LEFT JOIN " . $wpdb->prefix . "huge_itgallery_gallerys AS b ON a.id = b.sl_width \nLEFT JOIN (SELECT  " . $wpdb->prefix . "huge_itgallery_gallerys.ordering as ordering," . $wpdb->prefix . "huge_itgallery_gallerys.id AS id, COUNT( " . $wpdb->prefix . "huge_itgallery_images.gallery_id ) AS prod_count\nFROM " . $wpdb->prefix . "huge_itgallery_images, " . $wpdb->prefix . "huge_itgallery_gallerys\nWHERE " . $wpdb->prefix . "huge_itgallery_images.gallery_id = " . $wpdb->prefix . "huge_itgallery_gallerys.id\nGROUP BY " . $wpdb->prefix . "huge_itgallery_images.gallery_id) AS c ON c.id = a.id LEFT JOIN\n(SELECT " . $wpdb->prefix . "huge_itgallery_gallerys.name AS par_name," . $wpdb->prefix . "huge_itgallery_gallerys.id FROM " . $wpdb->prefix . "huge_itgallery_gallerys) AS g\n ON a.sl_width=g.id WHERE a.name LIKE %s  group by a.id  ", "%" . $search_tag . "%");
    $rows = $wpdb->get_results($query);
    $rows = open_cat_in_tree($rows);
    $query = "SELECT  " . $wpdb->prefix . "huge_itgallery_gallerys.ordering," . $wpdb->prefix . "huge_itgallery_gallerys.id, COUNT( " . $wpdb->prefix . "huge_itgallery_images.gallery_id ) AS prod_count\nFROM " . $wpdb->prefix . "huge_itgallery_images, " . $wpdb->prefix . "huge_itgallery_gallerys\nWHERE " . $wpdb->prefix . "huge_itgallery_images.gallery_id = " . $wpdb->prefix . "huge_itgallery_gallerys.id\nGROUP BY " . $wpdb->prefix . "huge_itgallery_images.gallery_id ";
    $prod_rows = $wpdb->get_results($query);
    foreach ($rows as $row) {
        foreach ($prod_rows as $row_1) {
            if ($row->id == $row_1->id) {
                $row->ordering = $row_1->ordering;
                $row->prod_count = $row_1->prod_count;
            }
        }
    }
    $pageNav = '';
    $sort = '';
    $cat_row = open_cat_in_tree($cat_row);
    html_showgallerys($rows, $pageNav, $sort, $cat_row);
}
Example #9
0
        public function render_content()
        {
            ?>
				<label>
					<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
					<?php 
            if (!empty($this->description)) {
                ?>
						<span class="description customize-control-description"><?php 
                echo $this->description;
                ?>
</span>
					<?php 
            }
            ?>
				</label>
					
			<?php 
            echo '<div class="zerowp-customizer-fonts-block">';
            echo '<div class="zerowp-customizer-show-selected-font"><div class="zerowp-customizer-font-item"></div></div>
				<div class="zerowp-customizer-fonts">
					<input type="text" class="zerowp-customizer-fonts-search-field" placeholder="' . __('Search font', 'zerowp_customizer_local') . '" />
					<input type="hidden" class="zerowp-customizer-fonts-value" ' . $this->get_link() . ' ' . $this->value() . ' />' . $this->fontsList() . '</div>
			</div>';
        }
Example #10
0
/**
 * Replace the default search form with a Genesis-specific form.
 *
 * The exact output depends on whether the child theme supports HTML5 or not.
 *
 * Applies the `genesis_search_text`, `genesis_search_button_text`, `genesis_search_form_label` and
 * `genesis_search_form` filters.
 *
 * @since 0.2.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 *
 * @return string HTML markup.
 */
function genesis_search_form()
{
    $search_text = get_search_query() ? apply_filters('the_search_query', get_search_query()) : apply_filters('genesis_search_text', __('Search this website', 'genesis') . ' &#x02026;');
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis'));
    $onfocus = "if ('" . esc_js($search_text) . "' === this.value) {this.value = '';}";
    $onblur = "if ('' === this.value) {this.value = '" . esc_js($search_text) . "';}";
    //* Empty label, by default. Filterable.
    $label = apply_filters('genesis_search_form_label', '');
    $value_or_placeholder = get_search_query() == '' ? 'placeholder' : 'value';
    if (genesis_html5()) {
        $form = sprintf('<form %s>', genesis_attr('search-form'));
        if (genesis_a11y('search-form')) {
            if ('' == $label) {
                $label = apply_filters('genesis_search_text', __('Search this website', 'genesis'));
            }
            $form_id = uniqid('searchform-');
            $form .= sprintf('<meta itemprop="target" content="%s"/><label class="search-form-label screen-reader-text" for="%s">%s</label><input itemprop="query-input" type="search" name="s" id="%s" %s="%s" /><input type="submit" value="%s" /></form>', home_url('/?s={s}'), esc_attr($form_id), esc_html($label), esc_attr($form_id), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        } else {
            $form .= sprintf('%s<meta itemprop="target" content="%s"/><input itemprop="query-input" type="search" name="s" %s="%s" /><input type="submit" value="%s"  /></form>', esc_html($label), home_url('/?s={s}'), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        }
    } else {
        $form = sprintf('<form method="get" class="searchform search-form" action="%s" role="search" >%s<input type="text" value="%s" name="s" class="s search-input" onfocus="%s" onblur="%s" /><input type="submit" class="searchsubmit search-submit" value="%s" /></form>', home_url('/'), esc_html($label), esc_attr($search_text), esc_attr($onfocus), esc_attr($onblur), esc_attr($button_text));
    }
    return apply_filters('genesis_search_form', $form, $search_text, $button_text, $label);
}
 public function execute()
 {
     $type = isset($_GET['type']) ? esc_html($_GET['type']) : 'display';
     $edit_type = isset($_GET['edit_type']) ? esc_html($_GET['edit_type']) : '';
     $image_id = isset($_GET['image_id']) ? esc_html($_GET['image_id']) : 0;
     $this->display($type);
 }
        public static function create_fields($ops = array(), $options = array())
        {
            foreach ($ops as $k => $v) {
                if (!isset($v['type'])) {
                    continue;
                }
                switch ($v['type']) {
                    case 'select':
                        break;
                    default:
                        $output = '<input type="text" name="' . esc_attr($k) . '" id="' . esc_attr($k) . '" />';
                }
                ?>
				<tr valign="top">
					<th scope="row"><label for="<?php 
                echo esc_attr($k);
                ?>
"><?php 
                echo esc_html($v['label']);
                ?>
</label></th>
					<td class="forminp forminp-text">
						<?php 
                echo $output;
                ?>
					</td>
				</tr>
				<?php 
            }
        }
        public function render_content()
        {
            ?>
			<label>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
				<select <?php 
            $this->link();
            ?>
>
					<?php 
            foreach ($this->choices as $value => $label) {
                ?>
<optgroup label="<?php 
                echo $value;
                ?>
"><?php 
                foreach ($label as $subValue => $subLabel) {
                    printf("<option value=\"%s\" %s>%s</option>", esc_attr($subValue), selected($this->value(), $subValue, false), $subLabel);
                }
                ?>
</optgroup><?php 
            }
            ?>
				</select>
			</label>
			<?php 
            echo "<p class='description'>{$this->description}</p>";
        }
 /**
  * Displaying Prodcuts
  *
  * Does prepare the data for displaying the products in the table.
  */
 function display_seller_review()
 {
     $data = array();
     $prefix = FARMTOYOU_META_PREFIX;
     //if search is call then pass searching value to function for displaying searching values
     $args = array('post_type' => FARMTOYOU_SELLER_REVIEW_POST_TYPE, 'post_status' => 'any', 'posts_per_page' => '-1');
     //get seller_review data from database
     $all_seller_review = get_posts($args);
     foreach ($all_seller_review as $key => $value) {
         $seller_id = get_post_meta($value->ID, $prefix . 'seller_id', true);
         $store_info = dokan_get_store_info($seller_id);
         $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'dokan');
         $curr_user_id = get_post_meta($value->ID, $prefix . 'current_user_id', true);
         $user_info = get_userdata($curr_user_id);
         $first_name = $user_info->first_name;
         $last_name = $user_info->last_name;
         $user_email = $user_info->user_email;
         $data[$key]['ID'] = isset($value->ID) ? $value->ID : '';
         $data[$key]['seller_store'] = $store_name;
         $data[$key]['curr_user_name'] = $first_name . " " . $last_name;
         $data[$key]['curr_user_email'] = $user_email;
         $data[$key]['user_rating'] = get_post_meta($value->ID, $prefix . 'seller_rating', true);
         $data[$key]['user_comment'] = get_post_meta($value->ID, $prefix . 'user_comment', true);
         $data[$key]['post_status'] = isset($value->post_status) ? $value->post_status : '';
         $data[$key]['post_date'] = isset($value->post_date) ? $value->post_date : '';
     }
     return $data;
 }
Example #15
0
 /**
  * Validate XML to be valid for import
  * @param string $xml
  * @param WP_Error[optional] $errors
  * @return bool Validation status
  */
 public static function validateXml(&$xml, $errors = NULL)
 {
     if (FALSE === $xml or '' == $xml) {
         $errors and $errors->add('form-validation', __('WP All Import can\'t read your file.<br/><br/>Probably, you are trying to import an invalid XML feed. Try opening the XML feed in a web browser (Google Chrome is recommended for opening XML files) to see if there is an error message.<br/>Alternatively, run the feed through a validator: http://validator.w3.org/<br/>99% of the time, the reason for this error is because your XML feed isn\'t valid.<br/>If you are 100% sure you are importing a valid XML feed, please contact WP All Import support.', 'wp_all_import_plugin'));
     } else {
         PMXI_Import_Record::preprocessXml($xml);
         if (function_exists('simplexml_load_string')) {
             libxml_use_internal_errors(true);
             libxml_clear_errors();
             $_x = @simplexml_load_string($xml);
             $xml_errors = libxml_get_errors();
             libxml_clear_errors();
             if ($xml_errors) {
                 $error_msg = '<strong>' . __('Invalid XML', 'wp_all_import_plugin') . '</strong><ul>';
                 foreach ($xml_errors as $error) {
                     $error_msg .= '<li>';
                     $error_msg .= __('Line', 'wp_all_import_plugin') . ' ' . $error->line . ', ';
                     $error_msg .= __('Column', 'wp_all_import_plugin') . ' ' . $error->column . ', ';
                     $error_msg .= __('Code', 'wp_all_import_plugin') . ' ' . $error->code . ': ';
                     $error_msg .= '<em>' . trim(esc_html($error->message)) . '</em>';
                     $error_msg .= '</li>';
                 }
                 $error_msg .= '</ul>';
                 $errors and $errors->add('form-validation', $error_msg);
             } else {
                 return true;
             }
         } else {
             $errors and $errors->add('form-validation', __('Required PHP components are missing.', 'wp_all_import_plugin'));
             $errors and $errors->add('form-validation', __('WP All Import requires the SimpleXML PHP module to be installed. This is a standard feature of PHP, and is necessary for WP All Import to read the files you are trying to import.<br/>Please contact your web hosting provider and ask them to install and activate the SimpleXML PHP module.', 'wp_all_import_plugin'));
         }
     }
     return false;
 }
 /**
  * Starts the element output.
  *
  * @since 2.1.0
  * @access public
  *
  * @see Walker::start_el()
  *
  * @param string  $output Used to append additional content. Passed by reference.
  * @param WP_Post $page   Page data object.
  * @param int     $depth  Optional. Depth of page in reference to parent pages. Used for padding.
  *                        Default 0.
  * @param array   $args   Optional. Uses 'selected' argument for selected page to set selected HTML
  *                        attribute for option element. Uses 'value_field' argument to fill "value"
  *                        attribute. See wp_dropdown_pages(). Default empty array.
  * @param int     $id     Optional. ID of the current page. Default 0 (unused).
  */
 public function start_el(&$output, $page, $depth = 0, $args = array(), $id = 0)
 {
     $pad = str_repeat('&nbsp;', $depth * 3);
     if (!isset($args['value_field']) || !isset($page->{$args['value_field']})) {
         $args['value_field'] = 'ID';
     }
     $output .= "\t<option class=\"level-{$depth}\" value=\"" . esc_attr($page->{$args['value_field']}) . "\"";
     if ($page->ID == $args['selected']) {
         $output .= ' selected="selected"';
     }
     $output .= '>';
     $title = $page->post_title;
     if ('' === $title) {
         /* translators: %d: ID of a post */
         $title = sprintf(__('#%d (no title)'), $page->ID);
     }
     /**
      * Filters the page title when creating an HTML drop-down list of pages.
      *
      * @since 3.1.0
      *
      * @param string $title Page title.
      * @param object $page  Page data object.
      */
     $title = apply_filters('list_pages', $title, $page);
     $output .= $pad . esc_html($title);
     $output .= "</option>\n";
 }
Example #17
0
function aaron_highlights()
{
    /* 
    * Frontpage Highlights
    */
    if (get_theme_mod('aaron_hide_highlight') == "") {
        for ($i = 1; $i < 10; $i++) {
            if (get_theme_mod('aaron_highlight' . $i . '_headline') or get_theme_mod('aaron_highlight' . $i . '_text') or get_theme_mod('aaron_highlight' . $i . '_icon') and get_theme_mod('aaron_highlight' . $i . '_icon') != "no-icon" or get_theme_mod('aaron_highlight' . $i . '_image')) {
                echo '<div class="highlights" style="background:' . get_theme_mod('aaron_highlight' . $i . '_bgcolor', '#fafafa') . ';">';
                if (get_theme_mod('aaron_highlight' . $i . '_icon') != "" and get_theme_mod('aaron_highlight' . $i . '_icon') != "no-icon" and get_theme_mod('aaron_highlight' . $i . '_image') == "") {
                    echo '<i aria-hidden="true" class="dashicons ' . esc_attr(get_theme_mod('aaron_highlight' . $i . '_icon')) . '"  style="color:' . get_theme_mod('aaron_highlight' . $i . '_textcolor', '#333333') . ';"></i>';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_image') != "") {
                    echo '<img src="' . esc_url(get_theme_mod('aaron_highlight' . $i . '_image')) . '">';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_link') != "") {
                    echo '<a href="' . esc_url(get_theme_mod('aaron_highlight' . $i . '_link')) . '">';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_headline') != "") {
                    echo '<h2 style="color:' . get_theme_mod('aaron_highlight' . $i . '_textcolor', '#333333') . ';">' . esc_html(get_theme_mod('aaron_highlight' . $i . '_headline')) . '</h2>';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_text') != "") {
                    echo '<p style="color:' . get_theme_mod('aaron_highlight' . $i . '_textcolor', '#333333') . ';">' . esc_html(get_theme_mod('aaron_highlight' . $i . '_text')) . '</p>';
                }
                if (get_theme_mod('aaron_highlight' . $i . '_link') != "") {
                    echo '</a>';
                }
                echo '</div>';
            }
        }
    }
}
function wptreehouse_badges_options_page()
{
    if (!current_user_can('manage_options')) {
        wp_die('You do not have sufficient permissions to access this page.');
    }
    global $plugin_url;
    global $options;
    global $display_json;
    if (isset($_POST['wptreehouse_form_submitted'])) {
        $hidden_field = esc_html($_POST['wptreehouse_form_submitted']);
        if ($hidden_field == 'Y') {
            $wptreehouse_username = esc_html($_POST['wptreehouse_username']);
            $wptreehouse_profile = wptreehouse_badges_get_profile($wptreehouse_username);
            $options['wptreehouse_username'] = $wptreehouse_username;
            $options['wptreehouse_profile'] = $wptreehouse_profile;
            $options['last_updated'] = time();
            update_option('wptreehouse_badges', $options);
        }
    }
    $options = get_option('wptreehouse_badges');
    if ($options != '') {
        $wptreehouse_username = $options['wptreehouse_username'];
        $wptreehouse_profile = $options['wptreehouse_profile'];
    }
    require 'inc/options-page-wrapper.php';
}
Example #19
0
 /**
  * Prints HTML with meta information for the current post-date/time, author, comment count and categories.
  */
 function ultra_posted_on()
 {
     echo '<div class="entry-meta-inner">';
     if (is_sticky() && is_home() && !is_paged()) {
         echo '<span class="featured-post">' . __('Sticky', 'ultra') . '</span>';
     }
     if (is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date')) {
         echo '<span class="entry-date"><a href="' . esc_url(get_permalink()) . '" rel="bookmark"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span></a>';
     }
     if (is_single() && siteorigin_setting('blog_post_date')) {
         echo '<span class="entry-date"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span>';
     }
     if (siteorigin_setting('blog_post_author')) {
         echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '" rel="author">' . esc_html(get_the_author()) . '</a></span></span>';
     }
     if (comments_open() && siteorigin_setting('blog_post_comment_count')) {
         echo '<span class="comments-link">';
         comments_popup_link(__('Leave a comment', 'ultra'), __('1 Comment', 'ultra'), __('% Comments', 'ultra'));
         echo '</span>';
     }
     echo '</div>';
     if (is_single() && siteorigin_setting('navigation_post_nav')) {
         the_post_navigation($args = array('prev_text' => '', 'next_text' => ''));
     }
 }
 /**
  * Create the markup to start an element.
  *
  * @see Walker::start_el() for description of parameters.
  *
  * @param string $output Passed by reference. Used to append additional
  *        content.
  * @param object $item Menu item data object.
  * @param int $depth Depth of menu item. Used for padding.
  * @param object $args See {@Walker::start_el()}.
  * @param int $id See {@Walker::start_el()}.
  */
 public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     global $_nav_menu_placeholder;
     $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? intval($_nav_menu_placeholder) - 1 : -1;
     $possible_object_id = isset($item->post_type) && 'nav_menu_item' == $item->post_type ? $item->object_id : $_nav_menu_placeholder;
     $possible_db_id = !empty($item->ID) && 0 < $possible_object_id ? (int) $item->ID : 0;
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $output .= $indent . '<li>';
     $output .= '<label class="menu-item-title">';
     $output .= '<input type="checkbox" class="menu-item-checkbox';
     if (property_exists($item, 'label')) {
         $title = $item->label;
     }
     $output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="' . esc_attr($item->object_id) . '" /> ';
     $output .= isset($title) ? esc_html($title) : esc_html($item->title);
     $output .= '</label>';
     if (empty($item->url)) {
         $item->url = $item->guid;
     }
     if (!in_array(array('umnm-menu', 'umnm-' . $item->post_excerpt . '-nav'), $item->classes)) {
         $item->classes[] = 'umnm-menu';
         $item->classes[] = 'umnm-' . $item->post_excerpt . '-nav';
     }
     // Menu item hidden fields
     $output .= '<input type="hidden" class="menu-item-db-id" name="menu-item[' . $possible_object_id . '][menu-item-db-id]" value="' . $possible_db_id . '" />';
     $output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="' . esc_attr($item->object) . '" />';
     $output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="' . esc_attr($item->menu_item_parent) . '" />';
     $output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="custom" />';
     $output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="' . esc_attr($item->title) . '" />';
     $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="' . esc_attr($item->url) . '" />';
     $output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="' . esc_attr($item->target) . '" />';
     $output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="' . esc_attr($item->attr_title) . '" />';
     $output .= '<input type="hidden" class="menu-item-classes" name="menu-item[' . $possible_object_id . '][menu-item-classes]" value="' . esc_attr(implode(' ', $item->classes)) . '" />';
     $output .= '<input type="hidden" class="menu-item-xfn" name="menu-item[' . $possible_object_id . '][menu-item-xfn]" value="' . esc_attr($item->xfn) . '" />';
 }
Example #21
0
    /**
     * Render the content of the category dropdown
     *
     * @return HTML
     */
    public function render_content()
    {
        if (!empty($this->cats)) {
            ?>

            <label>
                <span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
                <select <?php 
            $this->link();
            ?>
>
                    <?php 
            // Add an empty default option
            printf('<option value="0">' . esc_html('Disable Featured Posts', 'wedge') . '</option>');
            printf('<option value="0">--</option>');
            foreach ($this->cats as $cat) {
                printf('<option value="%s" %s>%s</option>', $cat->term_id, selected($this->value(), $cat->term_id, false), $cat->name);
            }
            ?>
            </select>
            </label>

        <?php 
        }
    }
    public function render_content()
    {
        ?>
		<label>
		<span class="customize-control-title"><?php 
        echo esc_html($this->label);
        ?>
</span>
		<p class="description customize-section-description"><?php 
        echo esc_html($this->description);
        ?>
</p>
		<select <?php 
        $this->link();
        ?>
 disabled="disabled">
		<?php 
        $var = get_option($this->field);
        foreach ($this->options as $option) {
            if ($this->options == $var) {
                echo '<option value="' . $option . '" selected="selected">' . $option . '</option>';
            } else {
                echo '<option value="' . $option . '">' . $option . '</option>';
            }
        }
        ?>
		</select>

		</label>
	<?php 
    }
    public function addOperatorNameField($user)
    {
        if (!user_can($user, 'chamame_chat_with_visitor')) {
            return;
        }
        $name = esc_attr(get_user_meta($user->ID, 'chamameOperatorName', true));
        $textDomain = $this->config->getTextDomain();
        $header = esc_html(__('Chat Settings', $textDomain));
        $label = esc_html(__('Operator Name', $textDomain));
        $description = esc_html(__('Input operator name. If this item is empty, "Display name publicly as" is displayed as operator name.', $textDomain));
        echo <<<EOM
<h3>{$header}</h3>
<table class="form-table">
  <tr>
    <th scope="row">
      <label for="chamameOperatorName">{$label}</label>
    </th>
    <td>
      <input type="text" id="chamameOperatorName" name="chamameOperatorName" value="{$name}" class="regular-text" />
      <br />
      <span class="description">{$description}</span>
    </td>
  </tr>
</table>
EOM;
    }
 public function save_all()
 {
     global $wpdb;
     $flag = FALSE;
     $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
     foreach ($ips_id_col as $ip_id) {
         if (isset($_POST['ip' . $ip_id])) {
             $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
             if ($ip == '') {
                 $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
             } else {
                 $flag = TRUE;
                 $wpdb->update($wpdb->prefix . 'formmaker_blocked', array('ip' => $ip), array('id' => $ip_id));
             }
         }
     }
     if ($flag) {
         $message = 1;
     } else {
         $message = 0;
     }
     // $this->display();
     $page = WDW_FM_Library::get('page');
     WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
 }
Example #25
0
function manage_portfolio_columns($column)
{
    global $post;
    if ($post->post_type == "portfolio") {
        switch ($column) {
            case "description":
                the_excerpt();
                break;
            case "portfolio_categories":
                $terms = get_the_terms($post->ID, 'portfolio_category');
                if (!empty($terms)) {
                    foreach ($terms as $t) {
                        $output[] = "<a href='edit.php?post_type=portfolio&portfolio_tag={$t->slug}'> " . esc_html(sanitize_term_field('name', $t->name, $t->term_id, 'portfolio_tag', 'display')) . "</a>";
                    }
                    $output = implode(', ', $output);
                } else {
                    $t = get_taxonomy('portfolio_category');
                    $output = "No {$t->label}";
                }
                echo $output;
                break;
            case 'thumbnail':
                echo the_post_thumbnail('thumbnail');
                break;
        }
    }
}
Example #26
0
/**
* Cultiv8 Theme Customizer
*
* @package Cultiv8
*/
function cultiv8_customize_register($wp_customize)
{
    // Site Logo functionality if Jetpack is not installed or WP4.5 which has site logo built in
    if (!function_exists('the_custom_logo') && !function_exists('jetpack_the_site_logo')) {
        $wp_customize->get_section('title_tagline')->title = __('Site Title, Tagline, and Logo', 'cultiv8');
        $wp_customize->add_setting('cultiv8_site_logo', array('default' => '', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage'));
        $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'cultiv8_site_logo', array('label' => esc_html__('Site Logo', 'cultiv8'), 'section' => 'title_tagline', 'settings' => 'cultiv8_site_logo', 'description' => sprintf(__('The Site Logo is displayed in the header. Uncheck <code>%s</code> to display only the logo. ', 'cultiv8'), __('Display Header Text')))));
    }
    // Podcasting options
    cultiv8_customize_createSection($wp_customize, array('id' => 'podcast', 'title' => _x('Podcasting', 'Customizer section title', 'cultiv8'), 'description' => _x('Settings for audio podcast', 'Customizer section description', 'cultiv8')));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_podcast_desc', 'label' => _x('Podcast Description', 'Customizer setting', 'cutiv8'), 'type' => 'textarea', 'default' => get_bloginfo('description'), 'section' => 'podcast'));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_podcast_author', 'label' => _x('Podcast Author', 'Customizer setting', 'cultiv8'), 'type' => 'text', 'default' => get_bloginfo('name'), 'section' => 'podcast'));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_podcast_logo', 'label' => _x('Podcast Logo', 'Customizer setting', 'cultiv8'), 'type' => 'image', 'default' => '', 'section' => 'podcast', 'description' => _x('Logo used in podcast feed. Must be 1400 x 1400 jpg or png.', 'Podcast logo option description', 'cultiv8')));
    // RSS
    cultiv8_customize_createSection($wp_customize, array('id' => 'rss', 'title' => _x('RSS Options', 'Customizer section title', 'cultiv8'), 'description' => _x('Settings for RSS feed', 'Customizer section description', 'cultiv8')));
    cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_feed_logo', 'label' => _x('RSS feed Logo', 'Customizer setting', 'cultiv8'), 'type' => 'image', 'default' => '', 'section' => 'rss', 'description' => _x('Logo used in RSS feed. Sometimes a white + transparent logo does not show well in RSS readers. Use this to display a different logo than your site logo.', 'RSS feed logo option description', 'cultiv8')));
    // Panel options
    $panels = 12;
    // New panels
    for ($i = 9; $i <= $panels; $i++) {
        $wp_customize->add_section('pique_panel' . $i, array('title' => esc_html__('Panel ' . $i, 'pique'), 'active_callback' => 'is_front_page', 'panel' => 'pique_options_panel', 'description' => __('Add a background image to your panel by setting a featured image in the page editor. If you don&rsquo;t select a page, this panel will not be displayed.', 'pique')));
        $wp_customize->add_setting('pique_panel' . $i, array('default' => false, 'sanitize_callback' => 'pique_sanitize_numeric_value'));
        $wp_customize->add_control('pique_panel' . $i, array('label' => esc_html__('Panel Content', 'pique'), 'section' => 'pique_panel' . $i, 'type' => 'dropdown-pages'));
        $wp_customize->add_setting('pique_panel' . $i . '_background', array('default' => 'default', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage'));
        $wp_customize->add_control('pique_panel' . $i . '_background', array('label' => esc_html__('Background Color', 'pique'), 'section' => 'pique_panel' . $i, 'type' => 'color'));
        $wp_customize->add_setting('pique_panel' . $i . '_opacity', array('default' => 'default', 'sanitize_callback' => 'pique_sanitize_opacity', 'transport' => 'postMessage'));
        $wp_customize->add_control('pique_panel' . $i . '_opacity', array('label' => esc_html__('Featured Image Opacity', 'pique'), 'section' => 'pique_panel' . $i, 'type' => 'select', 'description' => esc_html('Set the opacity of the featured image over the panel background.', 'pique'), 'choices' => array('0.25' => esc_html__('25%', 'pique'), '0.5' => esc_html__('50%', 'pique'), '0.75' => esc_html__('75%', 'pique'), '1' => esc_html__('100%', 'pique'))));
    }
    for ($i = 1; $i <= $panels; $i++) {
        cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_panel' . $i . '_hidetitle', 'label' => _x('Hide Title', 'Customizer setting', 'cultiv8'), 'type' => 'checkbox', 'default' => false, 'section' => 'pique_panel' . $i, 'transport' => 'postMessage', 'description' => __('Check to hide the title in this section', 'cultiv8')));
        cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_panel' . $i . '_height', 'label' => _x('Auto height', 'Customizer setting', 'cultiv8'), 'type' => 'checkbox', 'default' => false, 'section' => 'pique_panel' . $i, 'transport' => 'postMessage', 'description' => __('Check to adjust panel height to content', 'cultiv8')));
        cultiv8_customize_createSetting($wp_customize, array('id' => 'cultiv8_panel' . $i . '_hideinmenu', 'label' => _x('Hide from Menu', 'Customizer setting', 'cultiv8'), 'type' => 'checkbox', 'default' => false, 'section' => 'pique_panel' . $i, 'description' => __('Check to hide this pane from the top menu if the <code>Add an anchor menu to the front page</code> option is selected.', 'cultiv8')));
    }
}
 /**
  * Output the settings
  */
 public function output()
 {
     global $woocommerce, $woocommerce_settings, $current_section, $current_tab;
     if (!current_user_can('manage_woocommerce')) {
         wp_die(__('You do not have sufficient permissions to access this page.', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN));
     }
     do_action('woocommerce_mailpoet_settings_start');
     $mailpoet_settings = $this->get_settings();
     // Get current section
     $current_section = empty($_REQUEST['section']) ? 'general' : sanitize_text_field(urldecode($_REQUEST['section']));
     $current = $current_section ? '' : ' class="current"';
     // Creates each settings section.
     $mailpoet_section = apply_filters('woocommerce_mailpoet_settings_sections', array('general' => __('General', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN), 'lists' => __('Lists', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN)));
     foreach ($mailpoet_section as $section => $title) {
         $title = ucwords($title);
         $current = $section == $current_section ? ' class="current"' : '';
         $links[] = '<a href="' . add_query_arg('section', $section, admin_url('admin.php?page=woocommerce_settings&tab=mailpoet')) . '"' . $current . '>' . esc_html($title) . '</a>';
     }
     echo '<ul class="subsubsub"><li>' . implode('| </li><li>', $links) . '</li></ul><br class="clear" />';
     woocommerce_admin_fields($mailpoet_settings);
     if ($current_section == 'lists') {
         include_once MailPoet_WooCommerce_Add_on()->plugin_path() . '/includes/admin/settings/settings-newsletters.php';
         $mailpoet_list = mailpoet_lists();
         do_action('woocommerce_mailpoet_list_newsletters', $mailpoet_list);
     }
 }
    /**
     * Display the font control.
     *
     * @since 1.0.0
     */
    function render_content()
    {
        $v = $this->value();
        $values = json_decode($v);
        wp_enqueue_script('json2');
        $font_options = isset($this->font_options) ? $this->font_options : array();
        ?>

		<?php 
        if ($this->show_label && !empty($this->label)) {
            ?>
			<span class="customize-control-title themify-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
		<?php 
        }
        ?>

		<?php 
        $this->render_fonts($values, $font_options);
        ?>

		<input <?php 
        $this->link();
        ?>
 value='<?php 
        echo esc_attr($v);
        ?>
' type="hidden" class="<?php 
        echo esc_attr($this->type);
        ?>
_control themify-customizer-value-field"/>
	<?php 
    }
Example #29
0
 function update($id, $values)
 {
     global $wpdb;
     $query = 'UPDATE ' . $this->table_name . ' SET name=\'' . esc_html($values['name']) . '\', ' . ' description=\'' . esc_html($values['description']) . '\' ' . ' WHERE id=' . $id;
     $query_results = $wpdb->query($query);
     return $query_results;
 }
    public function render_field($options)
    {
        if (!empty($options['field']['options'])) {
            if (empty($options['value']) || !is_array($options['value'])) {
                $options['value'] = array();
            }
            ?>
<ul><?php 
            foreach ($options['field']['options'] as $i => $option) {
                ?>
<li>
				<label>
				<input type="checkbox" value="<?php 
                echo esc_attr($option['value']);
                ?>
" name="<?php 
                echo esc_attr($options['field_name']);
                ?>
[]" id="<?php 
                echo esc_attr($options['field_id']) . '-' . $i;
                ?>
"<?php 
                echo checked(in_array($option['value'], $options['value']), true, false);
                ?>
/>
				<?php 
                echo esc_html($option['value']);
                ?>
				</li>
			<?php 
            }
            ?>
			</ul><?php 
        }
    }