return all post types
189711
private function _get_post_types(){
    global $wpdb;

    $query = sprintf('SELECT * FROM %s ORDER BY id',MF_TABLE_POSTTYPES);
    $posttypes = $wpdb->get_results( $query, ARRAY_A );
    return $posttypes;
  }
153372
def get_post_fields(request):
    '''
    '''
    fields = dict()
    for field,value in request.form.items():
        fields[field] = value
    return fields
808447
function query_posts()
   	{
   		// vars
   		$r = array(
   			'next_page_exists' => 1,
   			'html' => ''
   		);
   		
   		
   		// options
		$options = array(
			'post_type'					=>	'all',
			'taxonomy'					=>	'all',
			'posts_per_page'			=>	10,
			'paged'						=>	1,
			'orderby'					=>	'title',
			'order'						=>	'ASC',
			'post_status'				=>	'any',
			'suppress_filters'			=>	false,
			's'							=>	'',
			'lang'						=>	false,
			'update_post_meta_cache'	=>	false,
			'field_key'					=>	'',
			'nonce'						=>	'',
			'ancestor'					=>	false,
		);
		
		$options = array_merge( $options, $_POST );
		
		
		// validate
		if( ! wp_verify_nonce($options['nonce'], 'acf_nonce') )
		{
			die();
		}
		
		
		// WPML
		if( $options['lang'] )
		{
			global $sitepress;
			
			if( !empty($sitepress) )
			{
				$sitepress->switch_lang( $options['lang'] );
			}
		}
		
		
		// convert types
		$options['post_type'] = explode(',', $options['post_type']);
		$options['taxonomy'] = explode(',', $options['taxonomy']);
		
		
		// load all post types by default
		if( in_array('all', $options['post_type']) )
		{
			$options['post_type'] = apply_filters('acf/get_post_types', array());
		}
		
		
		// attachment doesn't work if it is the only item in an array???
		if( is_array($options['post_type']) && count($options['post_type']) == 1 )
		{
			$options['post_type'] = $options['post_type'][0];
		}
		
		
		// create tax queries
		if( ! in_array('all', $options['taxonomy']) )
		{
			// vars
			$taxonomies = array();
			$options['tax_query'] = array();
			
			foreach( $options['taxonomy'] as $v )
			{
				
				// find term (find taxonomy!)
				// $term = array( 0 => $taxonomy, 1 => $term_id )
				$term = explode(':', $v); 
				
				
				// validate
				if( !is_array($term) || !isset($term[1]) )
				{
					continue;
				}
				
				
				// add to tax array
				$taxonomies[ $term[0] ][] = $term[1];
				
			}
			
			
			// now create the tax queries
			foreach( $taxonomies as $k => $v )
			{
				$options['tax_query'][] = array(
					'taxonomy' => $k,
					'field' => 'id',
					'terms' => $v,
				);
			}
		}
		
		unset( $options['taxonomy'] );
		
		
		// load field
		$field = array();
		if( $options['ancestor'] )
		{
			$ancestor = apply_filters('acf/load_field', array(), $options['ancestor'] );
			$field = acf_get_child_field_from_parent_field( $options['field_key'], $ancestor );
		}
		else
		{
			$field = apply_filters('acf/load_field', array(), $options['field_key'] );
		}
		
		
		// get the post from which this field is rendered on
		$the_post = get_post( $options['post_id'] );
		
		
		// filters
		$options = apply_filters('acf/fields/relationship/query', $options, $field, $the_post);
		$options = apply_filters('acf/fields/relationship/query/name=' . $field['_name'], $options, $field, $the_post );
		$options = apply_filters('acf/fields/relationship/query/key=' . $field['key'], $options, $field, $the_post );
		
		
		// query
		$wp_query = new WP_Query( $options );

		
		// global
		global $post;
		
		
		// loop
		while( $wp_query->have_posts() ) {
			
			$wp_query->the_post();
			
			
			// get title
			$title = $this->get_result($post, $field, $the_post, $options);
			
			
			// update html
			$r['html'] .= '<li><a href="' . get_permalink($post->ID) . '" data-post_id="' . $post->ID . '">' . $title .  '<span class="acf-button-add"></span></a></li>';
				
		}
		
		
		// next page
		if( (int)$options['paged'] >= $wp_query->max_num_pages ) {
			
			$r['next_page_exists'] = 0;
			
		}
		
		
		// reset
		wp_reset_postdata();
		
		
		// return JSON
		echo json_encode( $r );
		
		die();
			
	}
353514
def list_types(index_name, host='localhost',port='9200'):
        '''
        
        '''
        return ElasticSearch(host=host, port=port).type_list(index_name)
1306519
def List(type='All'):
		
		r = clc.v1.API.Call('post','Queue/ListQueueRequests',{'ItemStatusType': Queue.item_status_type_map[type] })
		if int(r['StatusCode']) == 0:  return(r['Requests'])
897307
public function getAllTerms(Post $post)
    {
        $taxonomies = get_object_taxonomies($this->getSlug());

        $adaptees = wp_get_object_terms($post->id, $taxonomies);

        return $this->plugAdapter(Term::class, $adaptees);
    }
355546
def get_post_data(self):
        '''
        
        '''
        post_data = {}
        for key in self.request.arguments:
            post_data[key] = self.get_arguments(key)[0]
        return post_data
245324
protected function get_counts( $post_types ) {
		global $wpdb;

		if ( count( $post_types ) <= 0 ) {
			return [];
		}

		$query = $wpdb->prepare(
			"SELECT `post_type`, COUNT(*) AS `count`
			FROM $wpdb->posts
			WHERE `post_type` IN (" . implode( ',', array_fill( 0, count( $post_types ), '%s' ) ) . ')
			GROUP BY `post_type`',
			$post_types
		);
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- $query is already prepared above.
		$counts = $wpdb->get_results( $query );

		// Make sure there's a count for every item.
		$counts = array_merge(
			array_fill_keys( $post_types, 0 ),
			wp_list_pluck( $counts, 'count', 'post_type' )
		);

		return $counts;
	}
117747
public function getPostTypeObject($post_type)
    {
        if ( ! isset($this->postTypes[ $post_type ])) {
            return false;
        }

        return $this->postTypes[ $post_type ];
    }
1261788
def get_types(self):
        
        types = [str, int, int]
        if self.strandPos is not None:
            types.append(str)
        if self.otherPos:
            for o in self.otherPos:
                types.append(o[2])

        return types
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;
	}
1077785
def _get_post_data(cls, args):
        ''''''
        if args.post_data:
            return args.post_data
        elif args.post_file:
            return args.post_file.read()
1143712
def get_types(obj, **kwargs):
    """"""
    max_iterable_length = kwargs.get('max_iterable_length', 100000)

    it, = itertools.tee(obj, 1)
    s = set()

    too_big = False

    for i, v in enumerate(it):
        if i <= max_iterable_length:
            s.add(type(v))
        else:
            too_big = True
            break

    return {"types": s, "too_big": too_big}
30493
def get_allposts(self):
		''' 
		'''
		result = self.client.posts(self.blog, offset = 0, limit = 1)
		try: 
			total_posts = result['total_posts']
		except:
			raise phasetumblr_errors.TumblrBlogException(result['meta']['msg'])

		delta = (total_posts / 10) + 1

		all_posts = []
		posts_ids = []
		for j in range(delta):
			start = j * 10
			end = (j + 1) * 10
			posts = self.client.posts(self.blog, offset = start, limit = end)['posts']
			if not len(posts):
				break
			for i in posts:
				if i['id'] in posts_ids:
					continue
				description = split_body(i['body'])
				body = split_body(i['body'], 1)
				post = {}
				post['title'] = i['title']
				post['link'] = i['post_url']
				post['date'] = datetime.strptime(i['date'], '%Y-%m-%d %H:%M:%S %Z')
				post['tags'] = i['tags']
				post['id'] = i['id']
				post['body'] = body
				post['description'] = description
				all_posts.append(post)
				posts_ids.append(i['id'])

		newlist = sorted(all_posts, key=lambda k: k['date']) 
		return newlist
1305297
function posts (content, contentType) {
  let output = {}
  const allFiles = content.filter(each => each.dir.includes(`/${contentType}`))
  const index = allFiles.filter(each => each.base === 'index.md')[0]
  index.attr.forEach(each => {
    allFiles.forEach(file => {
      if (file.name === each) {
        output[each] = file
      }
    })
  })
  return output
}
993357
def fetch_post_data(self):
        '''
        
        '''
        post_data = {}
        ext_dic = {}
        for key in self.request.arguments:
            if key.startswith('def_'):
                ext_dic[key] = self.get_argument(key)
            else:
                post_data[key] = self.get_arguments(key)[0]

        post_data['user_name'] = self.userinfo.user_name

        ext_dic = dict(ext_dic, **self.ext_post_data(postdata=post_data))

        return (post_data, ext_dic)
886039
def filter_by_type():
    """"""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    stmts_json = body.get('statements')
    stmt_type_str = body.get('type')
    stmt_type_str = stmt_type_str.capitalize()
    stmt_type = getattr(sys.modules[__name__], stmt_type_str)
    stmts = stmts_from_json(stmts_json)
    stmts_out = ac.filter_by_type(stmts, stmt_type)
    return _return_stmts(stmts_out)