/**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = Magee_Core::set_shortcode_defaults(array('url' => '', 'number' => 3, 'class' => '', 'id' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = '';
     //$html = '<h2>'._e( 'Recent news from Some-Other Blog:', 'my-text-domain' ).'<h2>';
     if ($url !== '') {
         include_once ABSPATH . WPINC . '/feed.php';
         $rss = fetch_feed(esc_url($url));
         $maxitems = 0;
         if (!is_wp_error($rss)) {
             $maxitems = $rss->get_item_quantity(esc_attr($number));
             $rss_items = $rss->get_items(0, $maxitems);
         }
         $html = '<ul class="' . esc_attr($class) . '" id="' . esc_attr($id) . '">';
         if ($maxitems == 0) {
             $html .= '<li>' . _e('No items', 'magee-shortcodes') . '</li>';
         } else {
             foreach ($rss_items as $item) {
                 $html .= '<li>';
                 $html .= '<a target="_blank" href="' . esc_url($item->get_permalink()) . '" ';
                 $html .= 'title="' . __('Posted ' . $item->get_date('j F Y | g:i a'), 'magee-shortcodes') . '">';
                 $html .= $item->get_title();
                 $html .= '</a>';
                 $html .= '</li>';
             }
         }
         $html .= '</ul>';
     }
     return $html;
 }
 function cherry_plugin_settings()
 {
     global $wpdb;
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $upload_dir = wp_upload_dir();
     $plugin_data = get_plugin_data(plugin_dir_path(__FILE__) . 'cherry-plugin.php');
     //Cherry plugin constant variables
     define('CHERRY_PLUGIN_DIR', plugin_dir_path(__FILE__));
     define('CHERRY_PLUGIN_URL', plugin_dir_url(__FILE__));
     define('CHERRY_PLUGIN_DOMAIN', $plugin_data['TextDomain']);
     define('CHERRY_PLUGIN_DOMAIN_DIR', $plugin_data['DomainPath']);
     define('CHERRY_PLUGIN_VERSION', $plugin_data['Version']);
     define('CHERRY_PLUGIN_NAME', $plugin_data['Name']);
     define('CHERRY_PLUGIN_SLUG', plugin_basename(__FILE__));
     define('CHERRY_PLUGIN_DB', $wpdb->prefix . CHERRY_PLUGIN_DOMAIN);
     define('CHERRY_PLUGIN_REMOTE_SERVER', esc_url('http://tmbhtest.com/cherryframework.com/components_update/'));
     //Other constant variables
     define('CURRENT_THEME_DIR', get_stylesheet_directory());
     define('CURRENT_THEME_URI', get_stylesheet_directory_uri());
     define('UPLOAD_BASE_DIR', str_replace("\\", "/", $upload_dir['basedir']));
     define('UPLOAD_DIR', str_replace("\\", "/", $upload_dir['path'] . '/'));
     // if ( !defined('API_URL') ) {
     // 	define( 'API_URL', esc_url( 'http://updates.cherry.template-help.com/cherrymoto/v3/api/' ) );
     // }
     load_plugin_textdomain(CHERRY_PLUGIN_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/' . CHERRY_PLUGIN_DOMAIN_DIR);
     do_action('cherry_plugin_settings');
 }
 /**
  * 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.
 }
Beispiel #4
1
function xfac_get_avatar($avatar = '', $id_or_email, $size = 96, $default = '', $alt = '')
{
    if (is_numeric($id_or_email)) {
        $wpUserId = (int) $id_or_email;
    } elseif (is_string($id_or_email) && ($user = get_user_by('email', $id_or_email))) {
        $wpUserId = $user->ID;
    } elseif (is_object($id_or_email) && !empty($id_or_email->user_id)) {
        $wpUserId = (int) $id_or_email->user_id;
    }
    if (empty($wpUserId)) {
        // cannot figure out the user id...
        return $avatar;
    }
    $apiRecords = xfac_user_getRecordsByUserId($wpUserId);
    if (empty($apiRecords)) {
        // no api records
        return $avatar;
    }
    $apiRecord = reset($apiRecords);
    if (empty($apiRecord->profile['links']['avatar'])) {
        // no avatar?
        return $avatar;
    }
    $avatar = $apiRecord->profile['links']['avatar'];
    $size = (int) $size;
    if (empty($alt)) {
        $alt = get_the_author_meta('display_name', $wpUserId);
    }
    $author_class = is_author($wpUserId) ? ' current-author' : '';
    $avatar = "<img alt='" . esc_attr($alt) . "' src='" . esc_url($avatar) . "' class='avatar avatar-{$size}{$author_class} photo' height='{$size}' width='{$size}' />";
    return $avatar;
}
/**
 * Add contextual help to the Themes and Post edit screens.
 *
 * @since Twenty Fourteen 1.0
 */
function twentyfourteen_contextual_help()
{
    if ('admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow']) {
        return;
    }
    get_current_screen()->add_help_tab(array('id' => 'twentyfourteen', 'title' => __('Twenty Fourteen', 'twentyfourteen'), 'content' => '<ul>' . '<li>' . sprintf(__('The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen'), esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))), admin_url('customize.php'), admin_url('edit.php?show_sticky=1')) . '</li>' . '<li>' . sprintf(__('Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen'), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail') . '</li>' . '<li>' . sprintf(__('For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen'), 'https://codex.wordpress.org/Twenty_Fourteen') . '</li>' . '</ul>'));
}
Beispiel #6
0
function x_shortcode_toc_item($atts)
{
    extract(shortcode_atts(array('id' => '', 'class' => '', 'style' => '', 'title' => '', 'page' => ''), $atts, 'x_toc_item'));
    $id = $id != '' ? 'id="' . esc_attr($id) . '"' : '';
    $class = $class != '' ? 'x-toc-item ' . esc_attr($class) : 'x-toc-item';
    $style = $style != '' ? 'style="' . $style . '"' : '';
    $title = $title != '' ? $title : '';
    switch ($page) {
        case 0:
            $page = '';
            break;
        case 1:
            $page = '';
            break;
        default:
            $page = $page;
            if (get_post_status(get_the_ID()) == "draft") {
                $page = '&page=' . $page;
            } else {
                $page = get_the_ID() == get_option('page_on_front') ? 'page/' . $page . '/' : $page . '/';
            }
    }
    $link = esc_url(get_permalink());
    $output = "<li {$id} class=\"{$class}\" {$style}><a href=" . $link . $page . " title=\"Go to {$title}\">" . $title . '</a></li>';
    return $output;
}
 /**
  * Displays the widget contents.
  */
 public function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     $photos = $this->get_photos(array('username' => $instance['username'], 'count' => $instance['count'], 'tags' => $instance['tags']));
     if (is_wp_error($photos)) {
         echo $photos->get_error_message();
     } else {
         echo '<ul>';
         foreach ($photos as $photo) {
             $link = esc_url($photo->link);
             $src = esc_url($photo->media->m);
             $title = esc_attr($photo->title);
             $item = sprintf('<a href="%s"><img src="%s" alt="%s" /></a>', $link, $src, $title);
             $item = sprintf('<li>%s</li>', $item);
             echo $item;
         }
         echo '</ul>';
     }
     echo $args['after_widget'];
 }
Beispiel #8
0
 function widget($args, $instance)
 {
     global $polylang;
     if (!(isset($polylang) && $polylang->model->get_languages_list() && ($list = pll_the_languages(array_merge($instance, array('echo' => 0)))))) {
         return;
     }
     extract($args);
     extract($instance);
     echo "{$before_widget}\n";
     if ($title = apply_filters('widget_title', $title, $instance, $this->id_base)) {
         echo $before_title . $title . $after_title;
     }
     echo $dropdown ? $list : "<ul>\n" . $list . "</ul>\n";
     echo "{$after_widget}\n";
     // javascript to switch the language when using a dropdown list
     if ($dropdown) {
         foreach ($polylang->model->get_languages_list() as $language) {
             $url = $force_home || ($url = $polylang->links->get_translation_url($language)) == null ? $polylang->links->get_home_url($language) : $url;
             $urls[] = '"' . esc_js($language->slug) . '":"' . esc_url($url) . '"';
         }
         $urls = implode(',', $urls);
         $js = "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t//<![CDATA[\n\t\t\t\t\tvar urls = {{$urls}};\n\t\t\t\t\tvar d = document.getElementById('lang_choice');\n\t\t\t\t\td.onchange = function() {\n\t\t\t\t\t\tfor (var i in urls) {\n\t\t\t\t\t\t\tif (this.value == i)\n\t\t\t\t\t\t\t\tlocation.href = urls[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//]]>\n\t\t\t\t</script>";
         echo $js;
     }
 }
 function gdlr_print_hotel_availability_item($settings = array())
 {
     $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
     global $gdlr_spaces, $hotel_option;
     $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
     $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
     $current_date = current_time('Y-m-d');
     $next_date = date('Y-m-d', strtotime($current_date . "+1 days"));
     $value = array('gdlr-check-in' => $current_date, 'gdlr-night' => 1, 'gdlr-check-out' => $next_date, 'gdlr-room-number' => 1, 'gdlr-adult-number' => 1, 'gdlr-children-number' => 0);
     $ret = gdlr_get_item_title($settings);
     $ret .= '<div class="gdlr-hotel-availability-wrapper';
     if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
         $ret .= ' gdlr-hotel-branches-enable';
     }
     $ret .= '" ' . $margin_style . $item_id . ' >';
     $ret .= '<form class="gdlr-hotel-availability gdlr-item" id="gdlr-hotel-availability" method="post" action="' . esc_url(add_query_arg(array($hotel_option['booking-slug'] => ''), home_url('/'))) . '" >';
     if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
         $ret .= gdlr_get_reservation_branch_combobox(array('title' => __('Hotel Branches', 'gdlr-hotel'), 'slug' => 'gdlr-hotel-branches', 'id' => 'gdlr-hotel-branches', 'value' => ''));
     }
     $ret .= gdlr_get_reservation_datepicker(array('title' => __('Check In', 'gdlr-hotel'), 'slug' => 'gdlr-check-in', 'id' => 'gdlr-check-in', 'value' => $value['gdlr-check-in']));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Night', 'gdlr-hotel'), 'slug' => 'gdlr-night', 'id' => 'gdlr-night', 'value' => $value['gdlr-night']));
     $ret .= gdlr_get_reservation_datepicker(array('title' => __('Check Out', 'gdlr-hotel'), 'slug' => 'gdlr-check-out', 'id' => 'gdlr-check-out', 'value' => $value['gdlr-check-out']));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Adults', 'gdlr-hotel'), 'slug' => 'gdlr-adult-number', 'id' => '', 'value' => $value['gdlr-adult-number'], 'multiple' => true));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Children', 'gdlr-hotel'), 'slug' => 'gdlr-children-number', 'id' => '', 'value' => $value['gdlr-children-number'], 'multiple' => true));
     $ret .= '<div class="gdlr-hotel-availability-submit" >';
     $ret .= '<input type="hidden" name="hotel_data" value="1" >';
     $ret .= '<input type="hidden" name="gdlr-room-number" value="1" />';
     $ret .= '<input type="submit" class="gdlr-reservation-bar-button gdlr-button with-border" value="' . __('Check Availability', 'gdlr-hotel') . '" >';
     $ret .= '</div>';
     $ret .= '<div class="clear"></div>';
     $ret .= '</form>';
     $ret .= '</div>';
     return $ret;
 }
Beispiel #10
0
function wen_business_custom_customize_enqueue_scripts()
{
    wp_register_script('wen_business_customizer_button', get_template_directory_uri() . '/assets/js/customizer-button.js', array('customize-controls'), '20130508', true);
    $data = array('updrade_button_text' => __('Upgrade To Pro', 'wen-business'), 'updrade_button_link' => esc_url('http://catchthemes.com/themes/wen-business-pro'));
    wp_localize_script('wen_business_customizer_button', 'WEN_Business_Customizer_Object', $data);
    wp_enqueue_script('wen_business_customizer_button');
}
Beispiel #11
0
    function widget($args, $instance)
    {
        extract($args);
        $rss = fetch_feed('http://feeds.feedburner.com/INNMemberInvestigations');
        $title = __('Stories From Other INN Members', 'largo');
        $desc = __('View more recent stories from members of INN', 'largo');
        $link = 'http://inn.org/network-content';
        $title = "<a class='rsswidget' href='{$link}' title='{$desc}'>{$title}</a>";
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Stories From Other INN Members', 'largo') : $instance['title'], $instance, $this->id_base);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        largo_widget_rss_output($rss, $instance);
        ?>

		<p class="morelink"><a href="<?php 
        echo esc_url($link);
        ?>
"><?php 
        _e('More Stories From INN Members', 'largo');
        ?>
&nbsp;&raquo;</a></p>

		<?php 
        echo $after_widget;
        unset($rss);
    }
Beispiel #12
0
    function widget($args, $instance)
    {
        extract($args);
        $title = empty($instance['title']) ? '' : strip_tags($instance['title']);
        echo $before_widget;
        if (!empty($title)) {
            echo $before_title . $title . $after_title;
        }
        if (dt_theme_option('general', 'show-sociables')) {
            ?>
					<ul class="dt-sc-social-icons"><?php 
            $socials = dt_theme_option('social');
            if ($socials != null) {
                foreach ($socials as $social) {
                    $link = esc_url($social['link']);
                    $icon = esc_attr($social['icon']);
                    echo "<li class='" . substr($icon, 3) . "'>";
                    echo "<a class='fa {$icon}' href='{$link}'></a>";
                    echo "</li>";
                }
            } else {
                echo "<div class='error message'><span class='icon'></span>" . __('Please add social icons in general settings.', 'iamd_text_domain') . "</div>";
            }
            ?>
					</ul><?php 
        } else {
            echo "<div class='error message'><span class='icon'></span>" . __('Please enable social icons in general settings.', 'iamd_text_domain') . "</div>";
        }
        echo $after_widget;
    }
Beispiel #13
0
function latex_render($latex, $fg, $bg, $s = 0)
{
    $url = "//s0.wp.com/latex.php?latex=" . urlencode($latex) . "&bg=" . $bg . "&fg=" . $fg . "&s=" . $s;
    $url = esc_url($url);
    $alt = str_replace('\\', '&#92;', esc_attr($latex));
    return '<img src="' . $url . '" alt="' . $alt . '" title="' . $alt . '" class="latex" />';
}
    /**
     * Renders Remote Viewing portion of Plugin Settings Page
     *
     * @since 1.0
     *
     * @return void
     */
    static function remote_viewing_section()
    {
        $value = get_option('simple_system_status_remote_url');
        $url = home_url() . '/?simple_system_status=' . $value;
        ?>
		<p><?php 
        _e('Users with this URL can view a plain-text version of your System Status.<br />This link can be handy in support forums, as access to this information can be removed after you receive the help you need.<br />Generating a new URL will safely void access to all who have the existing URL.', WC_QD_TXT);
        ?>
</p>
		<p><input type="text" readonly="readonly" class="sss-url sss-url-text" onclick="this.focus();this.select()" value="<?php 
        echo esc_url($url);
        ?>
" title="<?php 
        _e('To copy the System Status, click below then press Ctrl + C (PC) or Cmd + C (Mac).', WC_QD_TXT);
        ?>
" />&nbsp;&nbsp;<a href="<?php 
        echo esc_url($url);
        ?>
" target="_blank" class="sss-tiny sss-url-text-link"><?php 
        _e('test url', WC_QD_TXT);
        ?>
</a></p>
		<p class="submit">
			<input type="submit" onClick="return false;" class="button-secondary" name="generate-new-url" value="<?php 
        _e('Generate New URL', WC_QD_TXT);
        ?>
" />
		</p>
		<?php 
    }
function lp_thumbnail_metabox()
{
    global $post;
    $template = get_post_meta($post->ID, 'lp-selected-template', true);
    $template = apply_filters('lp_selected_template', $template);
    $permalink = get_permalink($post->ID);
    $datetime = the_modified_date('YmjH', null, null, false);
    $permalink = $permalink . '?dt=' . $datetime;
    if (in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
        if (file_exists(LANDINGPAGES_UPLOADS_PATH . $template . '/thumbnail.png')) {
            $thumbnail = LANDINGPAGES_UPLOADS_URLPATH . $template . '/thumbnail.png';
        } else {
            $thumbnail = LANDINGPAGES_URLPATH . 'templates/' . $template . '/thumbnail.png';
        }
    } else {
        $thumbnail = 'http://s.wordpress.com/mshots/v1/' . urlencode(esc_url($permalink)) . '?w=250';
    }
    $permalink = apply_filters('lp_live_screenshot_url', $permalink);
    ?>
	<div >
		<div class="inside" style='margin-left:-8px;'>
			<table>
				<tr>
					<td>
						<?php 
    echo "<a href='{$permalink}' target='_blank' ><img src='{$thumbnail}' style='width:250px;height:250px;' title='" . __('Preview this theme', 'landing-pages') . " ,  ({$template})'></a>";
    ?>
					</td>
				</tr>
			</table>

		</div>
	</div>
	<?php 
}
/**
 * The Shortcode
 */
function ebor_call_to_action_block_shortcode($atts, $content = null)
{
    extract(shortcode_atts(array('title' => '', 'url' => '', 'button_text' => '', 'target' => '_blank'), $atts));
    $output = '
		<div class="cta-text-basic row">
			<div class="container-fluid">
				<div class="row">
					<div class="col-sm-12">
						<hr>
					</div>
				</div><!--end of row-->
				<div class="row">
					<div class="col-md-9 col-sm-8">
						<h3>' . $title . '</h3>
					</div>
					<div class="col-md-3 col-sm-4 text-right text-left-xs">
						<a href="' . esc_url($url) . '" class="btn" target="' . esc_attr($target) . '">
							<span class="btn__text">
								' . $button_text . '
							</span>
							<i class="ion-arrow-right-c"></i>
						</a>
					</div>
				</div><!--end of row-->
			</div><!--end of container-->
		</div>
	';
    return $output;
}
Beispiel #17
0
/**
 * Filters the excerpt more output with internationalized text and a link to the post.
 *
 * @since  2.0.0
 * @access public
 * @param  string  $text
 * @return string
 */
function hybrid_excerpt_more($text)
{
    if (0 !== strpos($text, '<a')) {
        $text = sprintf(' <a href="%s" class="more-link">%s</a>', esc_url(get_permalink()), trim($text));
    }
    return $text;
}
Beispiel #18
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>';
            }
        }
    }
}
Beispiel #19
0
    function widget($args, $instance)
    {
        $settings = $this->woo_get_settings();
        extract($args, EXTR_SKIP);
        $instance = wp_parse_args($instance, $settings);
        extract($instance, EXTR_SKIP);
        echo '<div class="adspace-widget widget">';
        if ($title != '') {
            echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title;
        }
        if ($adcode != '') {
            echo $adcode;
        } else {
            ?>
<a href="<?php 
            echo esc_url($href);
            ?>
"><img src="<?php 
            echo apply_filters('widget_title', $title, $instance, $this->id_base);
            ?>
" alt="<?php 
            echo esc_attr($alt);
            ?>
" /></a><?php 
        }
        echo '</div>';
    }
Beispiel #20
0
 /**
  * @internal
  * @param string $url
  * @param string $text
  * @return mixed
  */
 protected function get_archives_link($url, $text)
 {
     $ret = array();
     $ret['text'] = $ret['title'] = $ret['name'] = wptexturize($text);
     $ret['url'] = $ret['link'] = esc_url(TimberURLHelper::prepend_to_url($url, $this->base));
     return $ret;
 }
    /**
     * Output the form
     *
     * @param array $atts
     */
    public static function output($atts, $content = null)
    {
        global $post, $wp;
        extract(shortcode_atts(self::options(), $atts));
        if ($content == null) {
            $content = self::content();
        }
        $current_url = add_query_arg($wp->query_string, '', home_url($wp->request));
        if (!isset($_GET['sp-unsubscribe'])) {
            ?>
<form method="post" action="<?php 
            echo home_url();
            ?>
">
			<input type="hidden" name="sendpress" value="post" />
			<input type="hidden" name="sp-shortcode" value="SC-Unsubscribe-Form" />
			<input type="hidden" name="sp-current-page" value="<?php 
            echo esc_url($current_url);
            ?>
" />
			<input type="text" name="sp-email" class="sp-input" placeholder="<?php 
            echo $placeholder;
            ?>
"/>
			<input type="submit" value="<?php 
            echo $btntxt;
            ?>
" />
			</form><?php 
        } else {
            echo do_shortcode($content);
        }
    }
 function after()
 {
     if (empty($this->upgrader->result['destination_name'])) {
         return;
     }
     $theme_info = $this->upgrader->theme_info();
     if (empty($theme_info)) {
         return;
     }
     $name = $theme_info['Name'];
     $stylesheet = $this->upgrader->result['destination_name'];
     $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
     $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
     $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
     $install_actions = array('preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>', 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $name)) . '">' . __('Activate') . '</a>');
     if (is_network_admin() && current_user_can('manage_network_themes')) {
         $install_actions['network_enable'] = '<a href="' . esc_url(wp_nonce_url('themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template)) . '" title="' . esc_attr__('Enable this theme for all sites in this network') . '" target="_parent">' . __('Network Enable') . '</a>';
     }
     $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('View Installed Themes', 'wp-app-store') . '</a>';
     if (!$this->result || is_wp_error($this->result) || is_network_admin()) {
         unset($install_actions['activate'], $install_actions['preview']);
     }
     $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
     if (!empty($install_actions)) {
         $this->feedback(implode(' | ', (array) $install_actions));
     }
 }
Beispiel #23
0
 function widget($args, $instance)
 {
     $title = apply_filters('widget_title', $instance['title']);
     if (empty($instance['user_id']) || 'invalid' === $instance['user_id']) {
         if (current_user_can('edit_theme_options')) {
             echo $args['before_widget'];
             echo '<p>' . sprintf(__('You need to enter your numeric user ID for the <a href="%1$s">Goodreads Widget</a> to work correctly. <a href="%2$s">Full instructions</a>.', 'jetpack'), esc_url(admin_url('widgets.php')), 'http://support.wordpress.com/widgets/goodreads-widget/#goodreads-user-id') . '</p>';
             echo $args['after_widget'];
         }
         return;
     }
     if (!array_key_exists($instance['shelf'], $this->shelves)) {
         return;
     }
     $instance['user_id'] = absint($instance['user_id']);
     // Set widget ID based on shelf.
     $this->goodreads_widget_id = $instance['user_id'] . '_' . $instance['shelf'];
     if (empty($title)) {
         $title = esc_html__('Goodreads', 'jetpack');
     }
     echo $args['before_widget'];
     echo $args['before_title'] . $title . $args['after_title'];
     $goodreads_url = 'https://www.goodreads.com/review/custom_widget/' . urlencode($instance['user_id']) . '.' . urlencode($instance['title']) . ':%20' . urlencode($instance['shelf']) . '?cover_position=&cover_size=small&num_books=5&order=d&shelf=' . urlencode($instance['shelf']) . '&sort=date_added&widget_bg_transparent=&widget_id=' . esc_attr($this->goodreads_widget_id);
     echo '<div class="gr_custom_widget" id="gr_custom_widget_' . esc_attr($this->goodreads_widget_id) . '"></div>' . "\n";
     echo '<script src="' . esc_url($goodreads_url) . '"></script>' . "\n";
     echo $args['after_widget'];
     do_action('jetpack_stats_extra', 'widget', 'goodreads');
 }
Beispiel #24
0
 /**
  * @see CPAC_Column_Actions::get_actions()
  * @since 2.4.7
  */
 public function get_actions($id)
 {
     $actions = array();
     $user_object = new WP_User($id);
     $screen = get_current_screen();
     if ('site-users-network' == $screen->id) {
         $url = "site-users.php?id={$this->site_id}&amp;";
     } else {
         $url = 'users.php?';
     }
     if (get_current_user_id() == $user_object->ID) {
         $edit_link = 'profile.php';
     } else {
         $edit_link = esc_url(add_query_arg('wp_http_referer', urlencode(stripslashes($_SERVER['REQUEST_URI'])), "user-edit.php?user_id={$user_object->ID}"));
     }
     if (current_user_can('edit_user', $user_object->ID)) {
         $edit = "<strong><a href=\"{$edit_link}\">{$user_object->user_login}</a></strong><br />";
         $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     } else {
         $edit = "<strong>{$user_object->user_login}</strong><br />";
     }
     if (!is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('delete_user', $user_object->ID)) {
         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Delete') . "</a>";
     }
     if (is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('remove_user', $user_object->ID)) {
         $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url($url . "action=remove&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Remove') . "</a>";
     }
     return $actions;
 }
 public function widget($args, $instance)
 {
     if (!is_singular()) {
         return;
     }
     $the_id = get_the_ID();
     if (!comments_open($the_id)) {
         return;
     } else {
         $html = $args['before_widget'];
         if (!empty($instance['title'])) {
             $html .= $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
         }
         $api_url = esc_url(home_url('/')) . 'wp-json/wp/v2/comments';
         $author = __('NAME:', 'rest-api-widgets');
         $mailaddress = __('MAIL:', 'rest-api-widgets');
         $content = __('COMMENTS:', 'rest-api-widgets');
         $send_btn = __('SEND', 'rest-api-widgets');
         $success_text = __('Success! Reload now.', 'rest-api-widgets');
         $fail_text = __('Fail :(', 'rest-api-widgets');
         $html .= "<form action={$api_url} method='post' id='rest-api-widgets-comment'>";
         $html .= '<dl>';
         $html .= "<dt>{$author}</dt><dd><input name='author_name' value=''></dd>";
         $html .= "<dt>{$mailaddress}</dt><dd><input name='author_email' value=''></dd>";
         $html .= "<dt>{$content}</dt><dd><textarea name='content' id=' cols='30' rows='10'></textarea></dd>";
         $html .= '</dl>';
         $html .= "<input type='hidden' name='post' value='{$the_id}'>";
         $html .= "<input type='hidden' name='success_text' value='{$success_text}'>";
         $html .= "<input type='hidden' name='fail_text' value='{$fail_text}'>";
         $html .= "<button>{$send_btn}</button>";
         $html .= '</form>';
     }
     echo $html . $args['after_widget'];
 }
Beispiel #26
0
/**
 * Vine embed code:
 * <iframe class="vine-embed" src="https://vine.co/v/bjHh0zHdgZT" width="600" height="600" frameborder="0"></iframe>
 * <script async src="//platform.vine.co/static/scripts/embed.js" charset="utf-8"></script>
 *
 * URL example:
 * https://vine.co/v/bjHh0zHdgZT/
 *
 * Embed shortcode examples:
 * [embed]https://vine.co/v/bjHh0zHdgZT[/embed]
 * [embed width="300"]https://vine.co/v/bjHh0zHdgZT[/embed]
 * [embed type="postcard" width="300"]https://vine.co/v/bjHh0zHdgZT[/embed]
 **/
function vine_embed_video($matches, $attr, $url, $rawattr)
{
    static $vine_flag_embedded_script;
    $max_height = 300;
    $type = 'simple';
    // Only allow 'postcard' or 'simple' types
    if (isset($rawattr['type']) && $rawattr['type'] === 'postcard') {
        $type = 'postcard';
    }
    $vine_size = Jetpack::get_content_width();
    // If the user enters a value for width or height, we ignore the Jetpack::get_content_width()
    if (isset($rawattr['width']) || isset($rawattr['height'])) {
        // 300 is the minimum size that Vine provides for embeds. Lower than that, the postcard embeds looks weird.
        $vine_size = max($max_height, min($attr['width'], $attr['height']));
    }
    if (empty($vine_size)) {
        $vine_size = $max_height;
    }
    $url = 'https://vine.co/v/' . $matches[1] . '/embed/' . $type;
    $vine_html = sprintf('<span class="embed-vine" style="display: block;"><iframe class="vine-embed" src="%s" width="%s" height="%s" frameborder="0"></iframe></span>', esc_url($url), (int) $vine_size, (int) $vine_size);
    if ($vine_flag_embedded_script !== true) {
        $vine_html .= '<script async src="//platform.vine.co/static/scripts/embed.js" charset="utf-8"></script>';
        $vine_flag_embedded_script = true;
    }
    return $vine_html;
}
Beispiel #27
0
/**
 * Add a link to the backups page to the plugin action links.
 *
 * @param array $links
 * @param string $file
 *
 * @return array $links
 */
function plugin_action_link($links, $file)
{
    if (false !== strpos($file, HMBKP_PLUGIN_SLUG)) {
        array_push($links, '<a href="' . esc_url(HMBKP_ADMIN_URL) . '">' . __('Backups', 'backupwordpress') . '</a>');
    }
    return $links;
}
Beispiel #28
0
/**
 * Add the settings link to the MailChimp plugin row
 *
 * @param array $links - Links for the plugin
 * @return array - Links
 */
function mailchimpSD_plugin_action_links($links)
{
    $settings_page = add_query_arg(array('page' => 'mailchimpSF_options'), admin_url('options-general.php'));
    $settings_link = '<a href="' . esc_url($settings_page) . '">' . __('Settings', 'mailchimp_i18n') . '</a>';
    array_unshift($links, $settings_link);
    return $links;
}
Beispiel #29
-1
    function widget($args, $instance)
    {
        extract($args);
        $title = isset($instance['title']) && $instance['title'] ? $instance['title'] : __('Recent tags', 'p2');
        $num_to_show = isset($instance['num_to_show']) && (int) $instance['num_to_show'] ? (int) $instance['num_to_show'] : $this->default_num_to_show;
        $recent_tags = $this->recent_tags($num_to_show);
        echo $before_widget . $before_title . esc_html($title) . $after_title;
        echo "\t<ul>\n";
        foreach ($recent_tags as $recent) {
            ?>
		<li>
			<a href="<?php 
            echo esc_url($recent['link']);
            ?>
"><?php 
            echo esc_html($recent['tag']->name);
            ?>
</a>&nbsp;
			(&nbsp;<?php 
            echo number_format_i18n($recent['tag']->count);
            ?>
&nbsp;)
		</li>
	<?php 
        }
        ?>
	</ul>
	<?php 
        echo $after_widget;
    }
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $classes[] = 'menu-item-' . $item->ID;
     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth));
     /**
      * Change WP's default classes to match Foundation's required classes
      */
     $class_names = str_replace(array('menu-item-has-children'), array('has-submenu'), $class_names);
     // ==========================
     $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
     $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth);
     $id = $id ? ' id="' . esc_attr($id) . '"' : '';
     $output .= $indent . '<li' . $id . $class_names . '>';
     $atts = array();
     $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
     $atts['target'] = !empty($item->target) ? $item->target : '';
     $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
     $atts['href'] = !empty($item->url) ? $item->url : '';
     $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth);
     $attributes = '';
     foreach ($atts as $attr => $value) {
         if (!empty($value)) {
             $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
             $attributes .= ' ' . $attr . '="' . $value . '"';
         }
     }
     $item_output = $args->before;
     $item_output .= '<a' . $attributes . '>';
     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
     $item_output .= '</a>';
     $item_output .= $args->after;
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }