GET /posts/:permalink
489627
def show
      @post = Post.published.where(:permalink => params[:permalink]).first!
      set_vars

      @meta = {}
      @meta[:title]       = "#{@post.title} - #{Blogo.config.site_title}"
      @meta[:description] = @post.meta_description
      @meta[:keywords]    = [@post.tags_string, Blogo.config.keywords].flatten.join(", ")
      @meta[:url]         = request.url
      @meta[:image]       = meta_image
      @meta[:type]        = 'article'
      @meta[:site_name]   = Blogo.config.site_title
    end
1256200
public function getRequestedPostTypeArchivePermalink()
    {
        $requested_post_type = $this->getRequestedPostType();

        if (!is_null($requested_post_type)) {
            $this->data['post_type_permalink']  = get_post_type_archive_link($requested_post_type);
        } else {
            $this->data['post_type_permalink'] = false;
        }

        return;
    }
367088
function(tag) {
    var posts = [];
    for (var key in this.posts) {
      if (this.posts[key].tags && this.posts[key].tags.indexOf(tag) !== -1) {
        posts.push(this.posts[key]);
      }
    }
    return posts;
  }
723216
function get_posts( $post_ids )
	{
		// validate
		if( empty($post_ids) )
		{
			return $post_ids;
		}
		
		
		// vars
		$r = array();
		
		
		// find posts (DISTINCT POSTS)
		$posts = get_posts(array(
			'numberposts'	=>	-1,
			'post__in'		=>	$post_ids,
			'post_type'		=>	apply_filters('acf/get_post_types', array()),
			'post_status'	=>	'any',
		));

		
		$ordered_posts = array();
		foreach( $posts as $p )
		{
			// create array to hold value data
			$ordered_posts[ $p->ID ] = $p;
		}
		
		
		// override value array with attachments
		foreach( $post_ids as $k => $v)
		{
			// check that post exists (my have been trashed)
			if( isset($ordered_posts[ $v ]) )
			{
				$r[] = $ordered_posts[ $v ];
			}
		}
		
		
		// return
		return $r;
	}
638670
def permalink
      templatable_page = Kms::Page.where(templatable_type: self.class.name).first
      if templatable_page
        Pathname.new(templatable_page.parent.fullpath).join(slug.to_s).to_s
      end
    end
1024306
protected function postsArgs() {
		global $wp_query, $wp_rewrite;

		// Setting up default values based on the current URL.
		$pagenum_link    = html_entity_decode( get_pagenum_link() );
		$this->url_parts = explode( '?', $pagenum_link );

		// Get total number of pages.
		$total = isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1;

		// Get the current page.
		$current = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;

		// Append the format placeholder to the base URL.
		$base = trailingslashit( $this->url_parts[0] ) . '%_%';

		// URL base depends on permalink settings.
		$format  = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
		$format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%';

		return [
			'base'    => $base,
			'format'  => $format,
			'total'   => $total,
			'current' => $current
		];
	}
128043
public function link() {
		if ( isset($this->_permalink) ) {
			return $this->_permalink;
		}
		$this->_permalink = get_permalink($this->ID);
		return $this->_permalink;
	}
803859
def postadressen(self):
        '''
         
        '''
        return [h.postadres for h in self.huisnummers if h.status.id == '3']
121279
def retrieve_posts(dir)
      return if outside_configured_directory?(dir)

      site.posts.docs.concat(post_reader.read_posts(dir))
      site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
    end
894448
def post(self, urls=None, **overrides):
        """"""
        if urls is not None:
            overrides['urls'] = urls
        return self.where(accept='POST', **overrides)
1230084
def get(permalink, kclass_name, relationship_name = nil)
      case kclass_name
      when 'Person'
        person(permalink, relationship_name)
      when 'Organization'
        organization(permalink, relationship_name)
      end
    end
583555
def _permalink(self, absolute=False, expand=True, **kwargs):
        
        return flask.url_for('entry',
                             entry_id=self._record.id,
                             category=self._record.category if expand else None,
                             slug_text=self._record.slug_text if expand else None,
                             _external=absolute,
                             **kwargs)
136765
def blog__get_posts(
      order: nil,
      language: nil,
      category_permalink: nil,
      category_permalink_AND: false,
      category_id: nil,
      category_id_AND: false,
      tag_permalink: nil,
      tag_permalink_AND: false,
      tag_id: nil,
      tag_id_AND: false,
      search: nil,
      page: nil,
      per_page: nil
    )
      posts = LatoBlog::Post.published.joins(:post_parent).where('lato_blog_post_parents.publication_datetime <= ?', DateTime.now)

      # apply filters
      order = order && order == 'ASC' ? 'ASC' : 'DESC'
      posts = _posts_filter_by_order(posts, order)
      posts = _posts_filter_by_language(posts, language)
      if category_permalink || category_id
        posts = posts.joins(:categories)
        posts = _posts_filter_by_category_permalink(posts, category_permalink, category_permalink_AND)
        posts = _posts_filter_category_id(posts, category_id, category_id_AND)
      end
      if tag_permalink || tag_id
        posts = posts.joins(:tags)
        posts = _posts_filter_by_tag_permalink(posts, tag_permalink, tag_permalink_AND)
        posts = _posts_filter_tag_id(posts, tag_id, tag_id_AND)
      end
      posts = _posts_filter_search(posts, search)

      # take posts uniqueness
      posts = posts.uniq(&:id)

      # save total posts
      total = posts.length

      # manage pagination
      page = page&.to_i || 1
      per_page = per_page&.to_i || 20
      posts = core__paginate_array(posts, per_page, page)

      # return result
      {
        posts: posts && !posts.empty? ? posts.map(&:serialize) : [],
        page: page,
        per_page: per_page,
        order: order,
        total: total
      }
    end
55097
function getPosts (poet) {
  if (poet.cache.posts)
    return poet.cache.posts;

  var posts = utils.sortPosts(poet.posts).filter(function (post) {
    // Filter out draft posts if showDrafts is false
    return (poet.options.showDrafts || !post.draft) &&
    // Filter out posts in the future if showFuture is false
      (poet.options.showFuture || post.date < Date.now());
  });

  return poet.cache.posts = posts;
}
1108071
public static function get_permalink_structure( $post_type ) {
		if ( is_string( $post_type ) ) {
			$post_type = get_post_type_object( $post_type );
		}

		if ( ! empty( $post_type->cptp ) && ! empty( $post_type->cptp['permalink_structure'] ) ) {
			$structure = $post_type->cptp->permalink_structure;
		} else if ( ! empty( $post_type->cptp_permalink_structure ) ) {
			$structure = $post_type->cptp_permalink_structure;
		} else {
			$structure = get_option( $post_type->name . '_structure', '%postname%' );
		}
		$structure = '/' . ltrim( $structure, '/' );

		return apply_filters( 'CPTP_' . $post_type->name . '_structure', $structure );
	}
1255121
public function post_type_link( $post_link, $post ) {

		if ( empty( $post ) || $this->object_type != $post->post_type ) {
			return $post_link;
		}

		$post_link = get_site_url() . '/';

		if ( false === strpos( $post->post_title, '*' ) ) {
			$post_link .= trim( $post->post_title, '/ ' ) . '/';
		}

		return $post_link;
	}
183844
def _fast_permalink(self):
        """"""
        if hasattr(self, 'link_id'):  # from /r or /u comments page
            sid = self.link_id.split('_')[1]
        else:  # from user's /message page
            sid = self.context.split('/')[4]
        return urljoin(self.reddit_session.config['comments'], '{0}/_/{1}'
                       .format(sid, self.id))