Пример #1
0
 static function defineRewriteRules()
 {
     # Add filter permalink structure for post type archive
     $post_type = Get_Post_Type_Object(Post_Type::$post_type_name);
     $archive_url_path = $post_type->rewrite['slug'];
     self::$rewrite_rules[LTrim(SPrintF('%s/filter:([^/]+)/?$', $archive_url_path), '/')] = SPrintF('index.php?post_type=%s&filter=$matches[1]', Post_Type::$post_type_name);
     self::$rewrite_rules[LTrim(SPrintF('%s/filter:([^/]+)/page/([0-9]{1,})/?$', $archive_url_path), '/')] = SPrintF('index.php?post_type=%s&filter=$matches[1]&paged=$matches[2]', Post_Type::$post_type_name);
     # Add filter permalink structure for taxonomy archives
     foreach (Get_Taxonomies(Null, 'objects') as $taxonomy) {
         $taxonomy_slug = $taxonomy->rewrite['slug'];
         if (!In_Array(Post_Type::$post_type_name, $taxonomy->object_type)) {
             continue;
         }
         self::$rewrite_rules[LTrim(SPrintF('%s/([^/]+)/filter:([^/]+)/?$', $taxonomy_slug), '/')] = SPrintF('index.php?%s=$matches[1]&filter=$matches[2]', $taxonomy->name);
         self::$rewrite_rules[LTrim(SPrintF('%s/([^/]+)/filter:([^/]+)/page/([0-9]{1,})/?$', $taxonomy_slug), '/')] = SPrintF('index.php?%s=$matches[1]&filter=$matches[2]&paged=$matches[3]', $taxonomy->name);
     }
 }
Пример #2
0
<?php

namespace WordPress\Plugin\Fancy_Gallery;

?>

<p><?php 
echo $this->core->mocking_bird->Pro_Notice('feature');
?>
</p>

<?php 
# User capabilities
$post_type = Get_Post_Type_Object($this->core->gallery_post_type->name);
if (!$post_type) {
    return;
}
$arr_capabilities = array($post_type->cap->edit_posts => I18n::t('Edit and create (own) galleries'), $post_type->cap->edit_others_posts => I18n::t('Edit others galleries'), $post_type->cap->edit_private_posts => I18n::t('Edit (own) private galleries'), $post_type->cap->edit_published_posts => I18n::t('Edit (own) published galleries'), $post_type->cap->delete_posts => I18n::t('Delete (own) galleries'), $post_type->cap->delete_private_posts => I18n::t('Delete (own) private galleries'), $post_type->cap->delete_published_posts => I18n::t('Delete (own) published galleries'), $post_type->cap->delete_others_posts => I18n::t('Delete others galleries'), $post_type->cap->publish_posts => I18n::t('Publish galleries'), $post_type->cap->read_private_posts => I18n::t('View (others) private galleries'), 'manage_categories' => I18n::t('Manage taxonomies'));
# Show the user roles
foreach ($GLOBALS['wp_roles']->roles as $role_name => $arr_role) {
    ?>
  <h4><?php 
    echo Translate_User_Role($arr_role['name']);
    ?>
</h4>

  <?php 
    foreach ($arr_capabilities as $capability => $caption) {
        ?>

    <div class="capability-selection">
Пример #3
0
    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 
    PrintF($this->t('Image: "%s"'), $image->post_title);