Skip to content

Add function to fetch post from 'original id' #410

Open
@avag-novembit

Description

@avag-novembit

Is your enhancement related to a problem? Please describe.

Currently there is no function to fetch post using dt_original_post_id meta key stored in {prefix}postmeta table.

Describe the solution you'd like

Going to send a PR added mentioned functionality in utils.php file.

Designs

The mentioned functionality is enwrapped in function get_post_from_original_id(..):

function get_post_from_original_id( $original_id ) {
    global $wpdb;
    return $wpdb->get_var( $wpdb->prepare( "SELECT post_id from $wpdb->postmeta WHERE meta_key = 'dt_original_post_id' AND meta_value = %s", $original_id ) );
}

Describe alternatives you've considered

n/a

Additional context

n/a

Thanks.

Avag

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status

    Code Review

Relationships

None yet

Development

No branches or pull requests

Issue actions