/*
get_result

description

@type	function
@date	5/02/2015
@since	5.1.5

@param	$post_id (int)
@return	$post_id (int)
327053
function get_result( $post, $field, $the_post, $options = array() ) {
		
		// right aligned info
		$title = '<span class="relationship-item-info">';
			
			if( in_array('post_type', $field['result_elements']) ) {
				
				$post_type_object = get_post_type_object( $post->post_type );
				$title .= $post_type_object->labels->singular_name;
				
			}
			
			
			// WPML
			if( !empty($options['lang']) ) {
				
				$title .= ' (' . $options['lang'] . ')';
				
			} elseif( defined('ICL_LANGUAGE_CODE') ) {
				
				$title .= ' (' . ICL_LANGUAGE_CODE . ')';
				
			}
			
		$title .= '</span>';
		
		
		// featured_image
		if( in_array('featured_image', $field['result_elements']) ) {
			
			$image = '';
			
			if( $post->post_type == 'attachment' ) {
				
				$image = wp_get_attachment_image( $post->ID, array(21, 21) );
				
			} else {
				
				$image = get_the_post_thumbnail( $post->ID, array(21, 21) );
				
			}
			
			$title .= '<div class="result-thumbnail">' . $image . '</div>';
			
		}
		
		
		// title
		$post_title = get_the_title( $post->ID );
		
		
		// empty
		if( $post_title === '' ) {
			
			$post_title = __('(no title)', 'acf');
			
		}
		
		
		$title .= $post_title;
		
		
		// status
		if( get_post_status( $post->ID ) != "publish" ) {
			
			$title .= ' (' . get_post_status( $post->ID ) . ')';
			
		}
			
		
		// filters
		$title = apply_filters('acf/fields/relationship/result', $title, $post, $field, $the_post);
		$title = apply_filters('acf/fields/relationship/result/name=' . $field['_name'] , $title, $post, $field, $the_post);
		$title = apply_filters('acf/fields/relationship/result/key=' . $field['key'], $title, $post, $field, $the_post);
		
		
		// return
		return $title;
		
	}
217358
public function getClientDetails($client_id)
    {
        $result = $this->getObjectByType('client_table',$client_id);

        return is_null($result) ? false : $result;
    }
711616
public function getPostMeta($postId, $metaName, $fetchOneResult = false)
    {
        return $this->postMetaManager->getPostMeta($postId, $metaName, $fetchOneResult);
    }
298748
public function getValue ($post_ID)
    {
        if ($post_ID === self::SITE)
            return get_option($this->identifier, $this->default);
        else {
            $value = get_post_meta($post_ID, $this->identifier, true);
            return $value === '' ? $this->default : $value;
        }
    }
315476
public function view($_type = null, $id = null)
    {
        // setting up an event for the view
        $_event = new Event('Controller.PostTypes.beforeView.' . $this->_type, $this, [
            'id' => $id,
        ]);
        $this->eventManager()->dispatch($_event);

        $type = $this->Model->get($id, [
            'contain' => $this->Settings['contain']
        ]);
        $this->set('type', $type);

        // setting up an event for the view
        $_event = new Event('Controller.PostTypes.afterView.' . $this->_type, $this, [
            'id' => $id,
        ]);
        $this->eventManager()->dispatch($_event);

        if (!$this->Settings['views']['view']) {
            $this->render(Configure::read('PostTypes.AdminPostTypeViews.view'));
            return;
        }

        $this->render($this->Settings['views']['view']);
    }
117747
public function getPostTypeObject($post_type)
    {
        if ( ! isset($this->postTypes[ $post_type ])) {
            return false;
        }

        return $this->postTypes[ $post_type ];
    }
354170
public function postIdOfPostupdate($id)
    {
        // $record is a stdClass
        $record = DB::table('postupdates')
            ->select('post_id')
            ->where('id', '=', $id)
            ->first()
        ;

        return $record->post_id;
    }
49322
public function getAttachmentURL($url, $post_id) {
	    if ($this->skipGifs) {
	        $mimeType = get_post_mime_type($post_id);
	        if ($mimeType == 'image/gif') {
                /** @var StorageTool $storageTool */
                $storageTool = ToolsManager::instance()->tools['storage'];

                $gifURL = $storageTool->getAttachmentURL($url, $post_id);
                return $gifURL;
            }
        }

		$res = $this->buildImgixImage($post_id, 'full');
		if(!$res || !is_array($res)) {
			return $url;
		}

		$new_url = $res[0];
		if(!$new_url) {
			return $url;
		}

		return $new_url;
	}
844254
public function getMidByKey( $post_id, $meta_key ) {

		/** @var \wpdb $wpdb */
		global $wpdb;
		$mid = $wpdb->get_var( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = %s LIMIT 1 ", $post_id, $meta_key ) );
		if ( ! empty( $mid ) ) {
			return absint( $mid );
		}

		return false;
	}
25177
public static function extractPostId($postOrPostId = null)
    {
        if (is_object($postOrPostId)) {
            return property_exists($postOrPostId, 'ID')
                ? (int) $postOrPostId->ID
                : null;
        }

        if ($postOrPostId > 0) {
            return (int) $postOrPostId;
        }

        return get_the_ID();
    }
1285191
public function getDelete($id = null)
    {
        // Get comment information
        $comment = Comments::getCommentsRepository()->find($id);

        if ($comment == null)
        {
            // Prepare the error message
            $error = Lang::get('comments.comment.not_found');

            // Redirect to the post management page
            return Redirect::route('posts')->with('error', $error);
        }

        Base::Log('Comment (' . $comment->id . ') was deleted.');

        // Delete the post
        $comment->delete();

        // Prepare the success message
        $success = Lang::get('comments.comment.deleted');

        // Redirect to the post management page
        return Redirect::back()->with('success', $success);
    }
79240
protected function get_post($postid) {
        if (empty($this->postsdata[$postid])) {
            $this->postsdata[$postid] = forum_get_post_full($postid);
            if (!$this->postsdata[$postid]) {
                throw new \dml_missing_record_exception('forum_posts');
            }
        }
        return $this->postsdata[$postid];
    }
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;
	}
257263
private function get_category( $post_id ) {
		$category_data = get_the_category( $post_id );
		$category_arr  = [];
		foreach ( $category_data as $cat ) {
			array_push( $category_arr, $cat->term_id );
		}

		return $category_arr;
	}
808572
def query_by_post(postid):
        '''
        
        '''
        return TabReply.select().where(
            TabReply.post_id == postid
        ).order_by(TabReply.timestamp.desc())
366849
public function get_edit_post_link( $post_id ) {
		if ( ! $post = get_post( $post_id ) ) {
			return admin_url( 'edit.php?post_type=' . $this->get_post_type() );
		}
		$post_type_object = get_post_type_object( $post->post_type );
		if ( ! $post_type_object ) {
			return admin_url( 'edit.php?post_type=' . $this->get_post_type() );
		}
		$action = '&action=edit';

		return admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
	}
580255
public function getPost()
    {
        if (!isset($_POST['id']) || empty($_POST['id']) || is_null($_POST['id'])) {
            echo 'false';
            wp_die();
        }

        echo json_encode(get_post($_POST['id']));
        wp_die();
    }