예제 #1
0
 static function filterUpdatedMessages($arr_message)
 {
     return Array_Merge($arr_message, array(self::$post_type_name => array(1 => SPrintF(I18n::t('Term updated. (<a href="%s">View Term</a>)'), Get_Permalink()), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => I18n::t('Term updated.'), 5 => isset($_GET['revision']) ? SPrintF(I18n::t('Term restored to revision from %s'), WP_Post_Revision_Title((int) $_GET['revision'], False)) : False, 6 => SPrintF(I18n::t('Term published. (<a href="%s">View Term</a>)'), Get_Permalink()), 7 => I18n::t('Term saved.'), 8 => I18n::t('Term submitted.'), 9 => SPrintF(I18n::t('Term scheduled. (<a target="_blank" href="%s">View Term</a>)'), Get_Permalink()), 10 => SPrintF(I18n::t('Draft updated. (<a target="_blank" href="%s">Preview Term</a>)'), Add_Query_Arg('preview', 'true', Get_Permalink())))));
 }
예제 #2
0
	<div class="tablenav-pages"><?php 
    echo $page_links;
    ?>
</div>
</div>
<?php 
}
?>

<?php 
foreach ($images_query->posts as $image) {
    $attachment_counter++;
    $image->parent = Get_Post($image->post_parent);
    if (Is_Object($image->parent)) {
        $image->parent->title = Get_The_Title($image->parent->ID);
        $image->parent->link = Get_Permalink($image->parent->ID);
        $image->parent->type = Get_Post_Type_Object($image->parent->post_type);
    } else {
        $image->parent = False;
    }
    $image->move_link = Add_Query_Arg(array('move_attachment' => $image->ID, 'move_to' => $current_gallery->ID));
    ?>
<div class="attachment" id="attachment-<?php 
    echo $image->ID;
    ?>
">
	<?php 
    echo wp_get_attachment_image($image->ID);
    ?>
	<div class="details">
		<div class="name"><?php 
 function Updated_Messages($arr_message)
 {
     return Array_Merge($arr_message, array($this->name => array(1 => SPrintF(I18n::t('Gallery updated. <a href="%s">View Gallery</a>'), Get_Permalink()), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => I18n::t('Gallery updated.'), 5 => isset($_GET['revision']) ? SPrintF(I18n::t('Gallery restored to revision from %s'), WP_Post_Revision_Title((int) $_GET['revision'], False)) : False, 6 => SPrintF(I18n::t('Gallery published. <a href="%s">View Gallery</a>'), Get_Permalink()), 7 => I18n::t('Gallery saved.'), 8 => I18n::t('Gallery submitted.'), 9 => SPrintF(I18n::t('Gallery scheduled. <a target="_blank" href="%s">View Gallery</a>'), Get_Permalink()), 10 => SPrintF(I18n::t('Gallery draft updated. <a target="_blank" href="%s">Preview Gallery</a>'), Add_Query_Arg('preview', 'true', Get_Permalink())))));
 }
 function Widget($args, $settings)
 {
     // Load options
     $this->load_options($settings);
     unset($settings);
     // Get random images
     $arr_images = $this->Get_Fancy_Images('ID', 'RAND', $this->get_option('limit'));
     if (empty($arr_images)) {
         return False;
     } else {
         foreach ($arr_images as &$image) {
             $include .= $image->ID . ',';
             $this->Get_Option('link_target') == 'gallery' ? $image->href = Get_Permalink($image->gallery_id) : '';
         }
     }
     // Generate Attributes
     $attributes = $this->fancy_gallery->Generate_Gallery_Attributes(array('include' => $include, 'thumb_width' => $this->Get_Option('thumb_width'), 'thumb_height' => $this->Get_Option('thumb_height'), 'thumb_grayscale' => $this->Get_Option('thumb_grayscale'), 'thumb_negate' => $this->Get_Option('thumb_negate')));
     // Build Gallery
     $this->fancy_gallery->Build_Gallery($arr_images, $attributes);
     // Display Widget
     echo $args['before_widget'];
     echo $args['before_title'] . Apply_Filters('widget_title', $this->get_option('title'), $settings, $this->id_base) . $args['after_title'];
     echo $this->fancy_gallery->Render_Gallery($this->get_option('template'));
     echo $args['after_widget'];
 }
// Read base url
$base_url = SPrintF('%s/%s', Get_Bloginfo('wpurl'), SubStr(RealPath(DirName(__FILE__)), Strlen(ABSPATH)));
$base_url = Str_Replace("\\", '/', $base_url);
// Windows Workaround
?>
<div class="gallery fancy-gallery <?php 
echo BaseName(__FILE__, '.php');
?>
" id="gallery_<?php 
echo $this->gallery->id;
?>
"><?php 
foreach ($this->gallery->images as $image) {
    // Build <img> Tags
    $img_code = '<img';
    foreach ($image->attributes as $attribute => $value) {
        $img_code .= SPrintF(' %s="%s"', $attribute, HTMLSpecialChars(Strip_Tags($value)));
    }
    $img_code .= '>';
    // Build FB share button
    $fb_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s" target="_blank">%4$s</a>', SPrintF('https://www.facebook.com/sharer/sharer.php?u=%s', $image->href), HTMLSpecialChars($image->title), $this->gallery->attributes->link_class, SPrintF('<img src="%s/facebook-button.png" alt="Share it" height="20">', $base_url));
    // Build Pintarest share button
    $pinterest_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s" target="_blank">%4$s</a>', SPrintF('https://pinterest.com/pin/create/button/?url=%1$s&media=%2$s', Get_Permalink($this->gallery->id), $image->href), HTMLSpecialChars($image->title), $this->gallery->attributes->link_class, SPrintF('<img src="%s/pinterest-button.png" alt="Pin it" height="20">', $base_url));
    // Build Twitter share button
    $twitter_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s" target="_blank">%4$s</a>', SPrintF('https://twitter.com/share?url=%1$s', $image->href), HTMLSpecialChars($image->title), $this->gallery->attributes->link_class, SPrintF('<img src="%s/twitter-button.png" alt="Tweet it" height="20">', $base_url));
    // Build <a> Tag for the image
    $link_code = SPrintF('<a href="%1$s" title="%2$s" class="%3$s">%4$s</a>', $image->href, HTMLSpecialChars(SPrintF('%s %s %s %s', $image->title, $fb_code, $pinterest_code, $twitter_code)), $this->gallery->attributes->link_class, $img_code);
    echo $link_code;
}
?>
</div>