Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
avag-novembit opened this issue Jun 14, 2019 · 1 comment · May be fixed by #411
Open

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

avag-novembit opened this issue Jun 14, 2019 · 1 comment · May be fixed by #411
Assignees
Labels
type:enhancement New feature or request.
Milestone

Comments

@avag-novembit
Copy link
Contributor

avag-novembit commented Jun 14, 2019

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

@avag-novembit avag-novembit added the type:enhancement New feature or request. label Jun 14, 2019
@avag-novembit avag-novembit linked a pull request Jun 14, 2019 that will close this issue
@jeffpaul jeffpaul added this to the 1.5.0 milestone Jun 14, 2019
@jeffpaul
Copy link
Member

Thanks again for the feedback and PR @avag-novembit, I'm tagging this for review and potential inclusion in our 1.5.0 release and will get back to you with any questions.

@helen helen modified the milestones: 1.5.0, Future Release Jul 17, 2019
@jeffpaul jeffpaul modified the milestones: Future Release, 2.1.0 Jan 30, 2023
@vikrampm1 vikrampm1 moved this from Incoming to Code Review in Open Source Practice Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request.
Projects
Status: Code Review
Development

Successfully merging a pull request may close this issue.

3 participants