Skip to content

Complex Query #303

@dshanske

Description

@dshanske

public static function check_dupes( $commentdata ) {

Wondering...the code looks for webmention_source_url, then _crossposting_link. And in the future, we discussed switching to source_url to match activitypub.

Wondering if there is a reason we shouldn't construct a single query with WP_Meta_Query and OR?

Essentially..

                        'meta_query' => array(
                                'relation' => 'OR',
                                // Check for source_url, which is used by Refback, ActivityPub, and will eventually be used by Webmention as well.
                                array(
                                        'key'   => 'source_url',
                                        'value' => $commentdata['comment_author_url'],
                                ),
                                /* check for duplicate webmentions using the old property.
                                 */
                                array(
                                        'key'   => 'webmention_source_url',
                                        'value' => $commentdata['comment_author_url'],
                                ),
                                array(
                                        'key'   => '_crossposting_link',
                                        'value' => $commentdata['comment_author_url'],
                                ),
                        ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions