当前位置: 首页>>代码示例>>PHP>>正文


PHP nextgen_esc_url函数代码示例

本文整理汇总了PHP中nextgen_esc_url函数的典型用法代码示例。如果您正苦于以下问题:PHP nextgen_esc_url函数的具体用法?PHP nextgen_esc_url怎么用?PHP nextgen_esc_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了nextgen_esc_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _render_ngg_page_in_frame

 /**
  * Renders a NextGen Gallery page in an iframe, suited for the attach to post
  * interface
  * @param string $page
  * @return string
  */
 public function _render_ngg_page_in_frame($page, $tab_id = null)
 {
     $frame_url = admin_url("/admin.php?page={$page}&attach_to_post");
     $frame_url = nextgen_esc_url($frame_url);
     if ($tab_id) {
         $tab_id = " id='ngg-iframe-{$tab_id}'";
     }
     return "<iframe name='{$page}' frameBorder='0'{$tab_id} class='ngg-attach-to-post ngg-iframe-page-{$page}' scrolling='no' src='{$frame_url}'></iframe>";
 }
开发者ID:tleonard2,项目名称:durablegbFeb,代码行数:15,代码来源:package.module.attach_to_post.php

示例2: pagination

 /**
  * Display the pagination.
  *
  * @since 1.8.0
  * @author taken from WP core (see includes/class-wp-list-table.php)
  * @return string echo the html pagination bar
  */
 function pagination($which, $current, $total_items, $per_page)
 {
     $total_pages = $per_page > 0 ? ceil($total_items / $per_page) : 1;
     $output = '<span class="displaying-num">' . sprintf(_n('1 item', '%s items', $total_items), number_format_i18n($total_items)) . '</span>';
     $current_url = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     $current_url = remove_query_arg(array('hotkeys_highlight_last', 'hotkeys_highlight_first'), $current_url);
     $page_links = array();
     $disable_first = $disable_last = '';
     if ($current == 1) {
         $disable_first = ' disabled';
     }
     if ($current == $total_pages) {
         $disable_last = ' disabled';
     }
     $page_links[] = sprintf("<a class='%s' title='%s' href='%s'>%s</a>", 'first-page' . $disable_first, esc_attr__('Go to the first page'), nextgen_esc_url(remove_query_arg('paged', $current_url)), '&laquo;');
     $page_links[] = sprintf("<a class='%s' title='%s' href='%s'>%s</a>", 'prev-page' . $disable_first, esc_attr__('Go to the previous page'), nextgen_esc_url(add_query_arg('paged', max(1, $current - 1), $current_url)), '&lsaquo;');
     if ('bottom' == $which) {
         $html_current_page = $current;
     } else {
         $html_current_page = sprintf("<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />", esc_attr__('Current page'), esc_attr('post_paged'), $current, strlen($total_pages));
     }
     $html_total_pages = sprintf("<span class='total-pages'>%s</span>", number_format_i18n($total_pages));
     $page_links[] = '<span class="paging-input">' . sprintf(_x('%1$s of %2$s', 'paging'), $html_current_page, $html_total_pages) . '</span>';
     $page_links[] = sprintf("<a class='%s' title='%s' href='%s'>%s</a>", 'next-page' . $disable_last, esc_attr__('Go to the next page'), nextgen_esc_url(add_query_arg('paged', min($total_pages, $current + 1), $current_url)), '&rsaquo;');
     $page_links[] = sprintf("<a class='%s' title='%s' href='%s'>%s</a>", 'last-page' . $disable_last, esc_attr__('Go to the last page'), nextgen_esc_url(add_query_arg('paged', $total_pages, $current_url)), '&raquo;');
     $output .= "\n<span class='pagination-links'>" . join("\n", $page_links) . '</span>';
     if ($total_pages) {
         $page_class = $total_pages < 2 ? ' one-page' : '';
     } else {
         $page_class = ' no-pages';
     }
     $pagination = "<div class='tablenav-pages{$page_class}'>{$output}</div>";
     echo $pagination;
 }
开发者ID:vadia007,项目名称:frg,代码行数:41,代码来源:manage.php

示例3: get_image_mrss_node

 /**
  * Get the XML <item> node corresponding to one single image
  *
  * @param $image The image object
  */
 function get_image_mrss_node($image, $indent = "\t\t")
 {
     $ngg_options = nggGallery::get_option('ngg_options');
     $tags = $image->get_tags();
     $tag_names = '';
     foreach ($tags as $tag) {
         $tag_names .= $tag_names == '' ? $tag->name : ', ' . $tag->name;
     }
     $title = html_entity_decode(stripslashes($image->alttext));
     $desc = html_entity_decode(stripslashes($image->description));
     $thumbwidth = $ngg_options['thumbwidth'];
     $thumbheight = $ngg_options['thumbfix'] ? $ngg_options['thumbheight'] : $thumbwidth;
     $out = $indent . "<item>\n";
     $out .= $indent . "\t<title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></title>\n";
     $out .= $indent . "\t<description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></description>\n";
     $out .= $indent . "\t<link><![CDATA[" . $image->get_permalink() . "]]></link>\n";
     $out .= $indent . "\t<guid>image-id:" . $image->pid . "</guid>\n";
     $out .= $indent . "\t<media:content url='" . nextgen_esc_url($image->imageURL) . "' medium='image' />\n";
     $out .= $indent . "\t<media:title><![CDATA[" . nggGallery::i18n($title, 'pic_' . $image->pid . '_alttext') . "]]></media:title>\n";
     $out .= $indent . "\t<media:description><![CDATA[" . nggGallery::i18n($desc, 'pic_' . $image->pid . '_description') . "]]></media:description>\n";
     $out .= $indent . "\t<media:thumbnail url='" . nextgen_esc_url($image->thumbURL) . "' width='" . $thumbwidth . "' height='" . $thumbheight . "' />\n";
     $out .= $indent . "\t<media:keywords><![CDATA[" . nggGallery::i18n($tag_names) . "]]></media:keywords>\n";
     $out .= $indent . "\t<media:copyright><![CDATA[Copyright (c) " . get_option("blogname") . " (" . site_url() . ")]]></media:copyright>\n";
     $out .= $indent . "</item>\n";
     return $out;
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:31,代码来源:media-rss.php

示例4: substr_replace

    ?>
		<?php 
    $image_url = $storage->get_image_url($image, 'full', TRUE);
    $thumb_url = $storage->get_thumb_url($image, TRUE);
    $thumb_size = $storage->get_thumb_dimensions($image);
    $width = $thumb_size['width'];
    $height = $thumb_size['height'];
    $image_title = $image->description;
    if ($image_title == null) {
        $image_title = $image->alttext;
    }
    if (strlen($image_title) >= 25) {
        $image_title = substr_replace($image_title, '...', 15, -10);
    }
    ?>
		<track>
			<title><![CDATA[<?php 
    echo_h($image_title);
    ?>
]]></title>
			<location><![CDATA[<?php 
    echo nextgen_esc_url($image_url);
    ?>
]]></location>
		</track>
		<?php 
}
?>
	</trackList>
</playlist>
开发者ID:jeanpage,项目名称:ca_learn,代码行数:30,代码来源:playlist_feed.php

示例5: ngg_dashboard_quota

function ngg_dashboard_quota()
{
    if (get_site_option('upload_space_check_disabled')) {
        return;
    }
    if (!wpmu_enable_function('wpmuQuotaCheck')) {
        return;
    }
    $settings = C_NextGen_Settings::get_instance();
    $fs = C_Fs::get_instance();
    $dir = $fs->join_paths($fs->get_document_root('content'), $settings->gallerypath);
    $quota = get_space_allowed();
    $used = get_dirsize($dir) / 1024 / 1024;
    if ($used > $quota) {
        $percentused = '100';
    } else {
        $percentused = $used / $quota * 100;
    }
    $used_color = $percentused < 70 ? $percentused >= 40 ? 'waiting' : 'approved' : 'spam';
    $used = round($used, 2);
    $percentused = number_format($percentused);
    ?>
	<p class="sub musub" style="position:static" ><?php 
    _e('Storage Space');
    ?>
</p>
	<div class="table table_content musubtable">
	<table>
		<tr class="first">
			<td class="first b b-posts"><?php 
    printf(__('<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>'), nextgen_esc_url(admin_url('admin.php?page=nggallery-manage-gallery')), $quota);
    ?>
</td>
			<td class="t posts"><?php 
    _e('Space Allowed');
    ?>
</td>
		</tr>
	</table>
	</div>
	<div class="table table_discussion musubtable">
	<table>
		<tr class="first">
			<td class="b b-comments"><?php 
    printf(__('<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>'), nextgen_esc_url(admin_url('admin.php?page=nggallery-manage-gallery')), $used, $percentused);
    ?>
</td>
			<td class="last t comments <?php 
    echo $used_color;
    ?>
"><?php 
    _e('Space Used');
    ?>
</td>
		</tr>
	</table>
	</div>
	<br class="clear" />
	<?php 
}
开发者ID:piletteantoine,项目名称:oilinwater,代码行数:60,代码来源:overview.php

示例6: nextgen_esc_url

    echo $image->previous_pid;
    ?>
" href="<?php 
    echo nextgen_esc_url($image->previous_image_link);
    ?>
">&#9668; <?php 
    _e('Back', 'nggallery');
    ?>
</a>
		</div>
		<div class="next">
			<a class="ngg-browser-next" id="ngg-next-<?php 
    echo $image->next_pid;
    ?>
" href="<?php 
    echo nextgen_esc_url($image->next_image_link);
    ?>
"><?php 
    _e('Next', 'nggallery');
    ?>
 &#9658;</a>
		</div>
		<div class="counter"><?php 
    _e('Picture', 'nggallery');
    ?>
 <?php 
    echo $image->number;
    ?>
 <?php 
    _e('of', 'nggallery');
    ?>
开发者ID:JeffreyBue,项目名称:jb,代码行数:31,代码来源:imagebrowser-caption.php

示例7: nggallery_picturelist


//.........这里部分代码省略.........
                        ?>
						<th <?php 
                        echo $attributes;
                        ?>
 scope="row"><input name="doaction[]" type="checkbox" value="<?php 
                        echo $pid;
                        ?>
" /></th>
						<?php 
                        break;
                    case 'id':
                        ?>
						<td <?php 
                        echo $attributes;
                        ?>
 style=""><?php 
                        echo $pid;
                        ?>
							<input type="hidden" name="pid[]" value="<?php 
                        echo $pid;
                        ?>
" />
						</td>
						<?php 
                        break;
                    case 'filename':
                        $attributes = 'class="title column-filename column-title"' . $style;
                        ?>
						<td <?php 
                        echo $attributes;
                        ?>
>
							<strong><a href="<?php 
                        echo nextgen_esc_url($picture->imageURL);
                        ?>
" class="thickbox" title="<?php 
                        echo esc_attr($picture->filename);
                        ?>
">
								<?php 
                        echo empty($picture->alttext) ? esc_html($picture->filename) : esc_html(stripslashes(nggGallery::i18n($picture->alttext)));
                        ?>
							</a></strong>
							<br /><?php 
                        echo $date;
                        ?>
							<?php 
                        if (!empty($picture->meta_data)) {
                            ?>
							<br /><?php 
                            echo $picture->meta_data['width'];
                            ?>
 x <?php 
                            echo $picture->meta_data['height'];
                            ?>
 <?php 
                            _e('pixel', 'nggallery');
                            ?>

							<?php 
                        }
                        ?>
							<p>
							<?php 
                        $actions = array();
                        $actions['view'] = '<a class="shutter" href="' . nextgen_esc_url($picture->imageURL) . '" title="' . esc_attr(sprintf(__('View "%s"'), sanitize_title($picture->filename))) . '">' . __('View', 'nggallery') . '</a>';
开发者ID:jeanpage,项目名称:ca_learn,代码行数:67,代码来源:manage-images.php

示例8: ngg_locale

function ngg_locale()
{
    global $ngg;
    require_once NGGALLERY_ABSPATH . '/lib/locale.php';
    $locale = new ngg_locale();
    $overview_url = admin_url() . 'admin.php?page=' . NGGFOLDER;
    $result = $locale->check();
    $update_url = wp_nonce_url($overview_url . '&amp;locale=update', 'ngg_update_locale');
    //Translators can change this text via gettext
    if ($result == 'installed') {
        echo $ngg->translator;
        if (!is_wp_error($locale->response) && $locale->response['response']['code'] == '200') {
            ?>
		<p class="textright">
			<a class="button" href="<?php 
            echo nextgen_esc_url(strip_tags($update_url));
            ?>
"><?php 
            _e('Update', 'nggallery');
            ?>
</a>
		</p>
		<?php 
        }
    }
    //Translators can change this text via gettext
    if ($result == 'available') {
        ?>
		<p><strong>Download now your language file !</strong></p>
		<p class="textright">
			<a class="button" href="<?php 
        echo nextgen_esc_url(strip_tags($update_url));
        ?>
"><?php 
        _e('Download', 'nggallery');
        ?>
</a>
		</p>
		<?php 
    }
    if ($result == 'not_exist') {
        echo '<p class="hint">' . sprintf('<strong>Would you like to help translating this plugin?</strong> <a target="_blank" href="%s">Download</a> the current pot file and read <a href="http://www.nextgen-gallery.com/translating-nextgen-gallery/">here</a> how you can translate the plugin.', NGGALLERY_URLPATH . 'lang/nggallery.pot') . '</p>';
    }
}
开发者ID:jeanpage,项目名称:ca_learn,代码行数:44,代码来源:overview.php

示例9: nextgen_esc_url

" <?php 
        echo $image->size;
        ?>
 />
			</a>
		</li>

	 	<?php 
    }
    ?>
	 	
	 	<!-- NEXT LINK -->
		<?php 
    if ($next) {
        ?>
		<li class="ngg-next">
			<a class="next" href="<?php 
        echo nextgen_esc_url($next);
        ?>
">&#9658;</a>
		</li>
		<?php 
    }
    ?>
	 	
	</ul>
 	
</div>

<?php 
}
开发者ID:ayoayco,项目名称:upbeat,代码行数:31,代码来源:gallery-carousel.php

示例10: jQuery

		jQuery('#thumbMsg').html(message);
		jQuery('#thumbMsg').css({'display':'block'});
		setTimeout(function(){ jQuery('#thumbMsg').fadeOut('slow'); }, 1500);
		
		var d = new Date();
		newUrl = jQuery("#imageToEdit").attr("src") + "?" + d.getTime();
		jQuery("#imageToEdit").attr("src" , newUrl);
							
	}
</script>

<table width="98%" align="center" style="border:1px solid #DADADA">
	<tr style="height : 360px;">
		<td valign="middle" align="center" style="background-color:#DADADA; width : 370px;">
			<img src="<?php 
echo nextgen_esc_url($preview_image);
?>
" alt="" id="imageToEdit" />	
		</td>
		<td>
			<input type="radio" name="ra" value="cw" /><?php 
esc_html_e('90&deg; clockwise', 'nggallery');
?>
<br />
			<input type="radio" name="ra" value="ccw" /><?php 
esc_html_e('90&deg; counter-clockwise', 'nggallery');
?>
<br />
			<input type="radio" name="ra" value="fv" /><?php 
esc_html_e('Flip vertically', 'nggallery');
?>
开发者ID:albinmartinsson91,项目名称:ux_blog,代码行数:31,代码来源:rotate.php

示例11: nggallery_sortorder


//.........这里部分代码省略.........
			// Listen for events in other frames
			if (window.Frame_Event_Publisher) {
				Frame_Event_Publisher.listen_for('attach_to_post:manage_galleries attach_to_post:manage_images', function(){
					window.location.href = window.location.href;
				});
			}

			$(this).data('ready', true);
		});


	</script>
	<div class="wrap">
		<form id="sortGallery" method="POST" action="<?php 
    echo $clean_url;
    ?>
" accept-charset="utf-8">
			<h2><?php 
    _e('Sort Gallery', 'nggallery');
    ?>
</h2>
			<div class="tablenav">
				<div class="alignleft actions">
					<?php 
    wp_nonce_field('ngg_updatesortorder');
    ?>
					<input class="button-primary action" type="submit" name="updateSortorder" value="<?php 
    _e('Update Sort Order', 'nggallery');
    ?>
" />
				</div>
				<div class="alignright actions">
					<a href="<?php 
    echo nextgen_esc_url($back_url);
    ?>
" class="button"><?php 
    _e('Back to gallery', 'nggallery');
    ?>
</a>
				</div>
			</div>
			<input name="sortorder" type="hidden" />
			<ul class="subsubsub">
				<li><?php 
    _e('Presort', 'nggallery');
    ?>
 :</li>
				<li><a href="<?php 
    echo esc_attr(remove_query_arg('presort', $base_url));
    ?>
" <?php 
    if ($presort == '') {
        echo 'class="current"';
    }
    ?>
><?php 
    _e('Unsorted', 'nggallery');
    ?>
</a> |</li>
				<li><a href="<?php 
    echo esc_attr(add_query_arg('presort', 'pid', $base_url));
    ?>
" <?php 
    if ($presort == 'pid') {
        echo 'class="current"';
    }
开发者ID:ayoayco,项目名称:upbeat,代码行数:67,代码来源:manage-sort.php

示例12: get_container

    /**
     * Create the album or gallery container
     *
     * @param integer $id (the prefix 'a' indidcates that you look for a album
     * @param bool $used (object will be hidden)
     * @return $output
     */
    function get_container($id = 0, $used = false)
    {
        global $wpdb, $nggdb;
        $obj = array();
        $preview_image = '';
        $class = '';
        // if the id started with a 'a', then it's a sub album
        if (substr($id, 0, 1) == 'a') {
            if (!($album = $this->_get_album(substr($id, 1)))) {
                return;
            }
            $obj['id'] = $album->id;
            $obj['name'] = $obj['title'] = $album->name;
            $obj['type'] = 'album';
            $class = 'album_obj';
            // get the post name
            $post = get_post($album->pageid);
            $obj['pagenname'] = $post == null ? '---' : $post->post_title;
            // for speed reason we limit it to 50
            if ($this->num_albums < 50) {
                $thumbURL = "";
                if ($album->previewpic) {
                    $image = $nggdb->find_image($album->previewpic);
                    if ($image) {
                        $thumbURL = @add_query_arg('timestamp', time(), $image->thumbURL);
                    }
                }
                $preview_image = $thumbURL ? '<div class="inlinepicture"><img rel="' . $album->previewpic . '" src="' . nextgen_esc_url($thumbURL) . '" /></div>' : '';
            }
            // this indicates that we have a album container
            $prefix = 'a';
        } else {
            if (!($gallery = $nggdb->find_gallery($id))) {
                return;
            }
            $obj['id'] = $gallery->gid;
            $obj['name'] = $gallery->name;
            $obj['title'] = $gallery->title;
            $obj['type'] = 'gallery';
            // get the post name
            $post = get_post($gallery->pageid);
            $obj['pagenname'] = $post == null ? '---' : $post->post_title;
            // for spped reason we limit it to 50
            if ($this->num_galleries < 50) {
                // set image url
                $thumbURL = "";
                if ($gallery->previewpic) {
                    $image = $nggdb->find_image($gallery->previewpic);
                    $thumbURL = @add_query_arg('timestamp', time(), $image->thumbURL);
                }
                $preview_image = !is_null($thumbURL) ? '<div class="inlinepicture"><img rel="' . $gallery->previewpic . '" src="' . nextgen_esc_url($thumbURL) . '" /></div>' : '';
            }
            $prefix = '';
        }
        // add class if it's in use in other albums
        $used = $used ? ' inUse' : '';
        echo '<div id="gid-' . $prefix . $obj['id'] . '" class="groupItem' . $used . '">
				<div class="innerhandle">
					<div class="item_top ' . $class . '">
						<a href="#" class="min" title="close">[-]</a>
						ID: ' . $obj['id'] . ' | ' . wp_html_excerpt(esc_html(M_I18N::translate($obj['title'])), 25) . '
					</div>
					<div class="itemContent">
							' . $preview_image . '
							<p><strong>' . __('Name', 'nggallery') . ' : </strong>' . esc_html(M_I18N::translate($obj['name'])) . '</p>
							<p><strong>' . __('Title', 'nggallery') . ' : </strong>' . esc_html(M_I18N::translate($obj['title'])) . '</p>
							<p><strong>' . __('Page', 'nggallery') . ' : </strong>' . esc_html(M_I18N::translate($obj['pagenname'])) . '</p>
							' . apply_filters('ngg_display_album_item_content', '', $obj) . '
						</div>
				</div>
			   </div>';
    }
开发者ID:kixortillan,项目名称:dfosashworks,代码行数:79,代码来源:album.php

示例13: echo_h

}
?>
	<?php 
if ($success and empty($errors)) {
    ?>
	<div class='success updated'>
		<p><?php 
    echo_h($success);
    ?>
</p>
	</div>
	<?php 
}
?>
	<form method="POST" action="<?php 
echo nextgen_esc_url($_SERVER['REQUEST_URI']);
?>
">
		<?php 
if (isset($form_header)) {
    ?>
		<?php 
    echo $form_header . "\n";
    ?>
		<?php 
}
?>
		<input type="hidden" name="action"/>
		<div class="accordion" id="nextgen_admin_accordion">
		<?php 
foreach ($tabs as $tab) {
开发者ID:jeanpage,项目名称:ca_learn,代码行数:31,代码来源:nextgen_admin_page.php

示例14: nggallery_manage_gallery_main


//.........这里部分代码省略.........
				of:		window.parent
			}
    	});
        jQuery("#addGallery .dialog-cancel").click(function() { jQuery( "#addGallery" ).dialog("close"); });
	}
	//-->
	</script>
	<div class="wrap">
		<?php 
    screen_icon('nextgen-gallery');
    ?>
		<h2><?php 
    echo _n('Manage Galleries', 'Manage Galleries', 2, 'nggallery');
    ?>
</h2>
		<form class="search-form" action="" method="get">
		<p class="search-box">
			<label class="hidden" for="media-search-input"><?php 
    _e('Search Images', 'nggallery');
    ?>
:</label>
			<input type="hidden" id="page-name" name="page" value="nggallery-manage-gallery" />
			<input type="text" id="media-search-input" name="s" value="<?php 
    the_search_query();
    ?>
" />
			<input type="submit" value="<?php 
    _e('Search Images', 'nggallery');
    ?>
" class="button" />
		</p>
		</form>
		<form id="editgalleries" class="nggform" method="POST" action="<?php 
    echo nextgen_esc_url($ngg->manage_page->base_page . '&orderby=' . $orderby . '&order=' . $order . '&paged=' . $_GET['paged']);
    ?>
" accept-charset="utf-8">
		<?php 
    wp_nonce_field('ngg_bulkgallery');
    ?>
		<input type="hidden" name="page" value="manage-galleries" />

		<div class="tablenav top">

			<div class="alignleft actions">
				<?php 
    if (function_exists('json_encode')) {
        ?>
				<select name="bulkaction" id="bulkaction">
					<option value="no_action" ><?php 
        _e("Bulk actions", 'nggallery');
        ?>
</option>
					<option value="delete_gallery" ><?php 
        _e("Delete", 'nggallery');
        ?>
</option>
                    <option value="set_watermark" ><?php 
        _e("Set watermark", 'nggallery');
        ?>
</option>
					<option value="new_thumbnail" ><?php 
        _e("Create new thumbnails", 'nggallery');
        ?>
</option>
					<option value="resize_images" ><?php 
        _e("Resize images", 'nggallery');
开发者ID:kixortillan,项目名称:dfosashworks,代码行数:67,代码来源:manage-galleries.php

示例15: _wp_post_thumbnail_html

 /**
  * Output HTML for the post thumbnail meta-box.
  *
  * @see wp-admin\includes\post.php
  * @param int $thumbnail_id ID of the image used for thumbnail
  * @return string html output
  */
 function _wp_post_thumbnail_html($thumbnail_id = NULL)
 {
     global $_wp_additional_image_sizes, $post_ID;
     $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__('Set featured image', 'nggallery') . '" href="' . nextgen_esc_url(get_upload_iframe_src('image')) . '" id="set-post-thumbnail" class="thickbox">%s</a></p>';
     $content = sprintf($set_thumbnail_link, esc_html__('Set featured image', 'nggallery'));
     $image = nggdb::find_image($thumbnail_id);
     $img_src = false;
     // get the options
     $ngg_options = nggGallery::get_option('ngg_options');
     if ($image) {
         if (is_array($_wp_additional_image_sizes) && isset($_wp_additional_image_sizes['post-thumbnail'])) {
             // Use post thumbnail settings if defined
             $width = absint($_wp_additional_image_sizes['post-thumbnail']['width']);
             $height = absint($_wp_additional_image_sizes['post-thumbnail']['height']);
             $mode = $_wp_additional_image_sizes['post-thumbnail']['crop'] ? 'crop' : '';
             // check fo cached picture
             $img_src = $image->cached_singlepic_file($width, $height, $mode);
         }
         // if we didn't use a cached image then we take the on-the-fly mode
         if ($img_src == false) {
             $img_src = trailingslashit(home_url()) . 'index.php?callback=image&amp;pid=' . $image->pid . '&amp;width=' . $width . '&amp;height=' . $height . '&amp;mode=crop';
         }
         $thumbnail_html = '<img width="266" src="' . $img_src . '" alt="' . $image->alttext . '" title="' . $image->alttext . '" />';
         if (!empty($thumbnail_html)) {
             $ajax_nonce = wp_create_nonce("set_post_thumbnail-{$post_ID}");
             $content = sprintf($set_thumbnail_link, $thumbnail_html);
             $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html__('Remove featured image') . '</a></p>';
         }
     }
     return $content;
 }
开发者ID:radscheit,项目名称:unicorn,代码行数:38,代码来源:post-thumbnail.php


注:本文中的nextgen_esc_url函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。